cloudwatch

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2018 License: MIT Imports: 10 Imported by: 0

README

Export cloudwatch metrics periodically

Permissions

cloudwatch:putMetricData

Documentation

Index

Constants

View Source
const (
	// DefaultEnable is default state for metrics
	DefaultEnable = false
)

Variables

This section is empty.

Functions

func Cloudwatch

func Cloudwatch(registry metrics.Registry, cfg *config.Config)

Cloudwatch blocks, run as go reporter.Cloudwatch(cfg)

Types

type Config

type Config struct {
	Enabled                  bool              `toml:"enabled"`
	WebookURL                string            `toml:"webook-url"`
	MessageFormat            string            `toml:"message-format"`
	ReportingInterval        toml.Duration     `toml:"reporting-interval"`
	Namespace                string            `toml:"namespace"`
	ResetCountersAfterReport bool              `toml:"reset-counters-after-report"`
	StaticDimensions         map[string]string `toml:"static-dimensions"`
}

Config represents the meta configuration.

func NewConfig

func NewConfig() Config

NewConfig builds a new configuration with default values.

func (Config) Validate

func (c Config) Validate() error

type Reporter

type Reporter struct {
	Config Config
}

Reporter type

func NewReporter

func NewReporter(config Config) *Reporter

NewReporter returns a new reporter

func (*Reporter) LogResult

func (r *Reporter) LogResult(evt *adapters.LogEvent) error

LogResult logs a log line if SupportsLogging is enabled

func (*Reporter) StartReporting

func (r *Reporter) StartReporting() error

StartReporting starts the recording process

func (*Reporter) StopReporting

func (r *Reporter) StopReporting() error

StopReporting stops the recording process

func (*Reporter) SupportsLogging

func (r *Reporter) SupportsLogging() bool

SupportsLogging returns if the adapter supports logging

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL