Documentation ¶
Index ¶
- type Config
- type Publisher
- type Sink
- func (p *Sink) AddSample(key string, val float64, tags []metrics.Tag)
- func (p *Sink) Data() []types.MetricDatum
- func (p *Sink) Flush(ctx context.Context) error
- func (p *Sink) IncrCounter(key string, val float64, tags []metrics.Tag)
- func (p *Sink) Publish(ctx context.Context, data []types.MetricDatum) error
- func (p *Sink) Run(ctx context.Context)
- func (p *Sink) SetGauge(key string, val float64, tags []metrics.Tag)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // AwsRegion is the required AWS Region to use AwsRegion string // AwsEndpoint is the optional AWS endpoint to use AwsEndpoint string // Namespace specifies the namespace under which metrics should be published. Namespace string // PublishInterval specifies the frequency with which metrics should be published to Cloudwatch. PublishInterval time.Duration // MetricsExpiry is the period after wich the metrics will be deleted from reporting if not used. MetricsExpiry time.Duration // WithSampleCount specifies to create additional _count and _sum metrics for sample WithSampleCount bool // WithCleanup specifies to clean up published metrics WithCleanup bool }
Config defines configuration options
type Publisher ¶ added in v0.4.0
type Publisher interface { //Publish(ctx context.Context, data []types.MetricDatum) error PutMetricData(ctx context.Context, params *cloudwatch.PutMetricDataInput, optFns ...func(*cloudwatch.Options)) (*cloudwatch.PutMetricDataOutput, error) }
Publisher provides interface to publish metrics
type Sink ¶
type Sink struct { Publisher // contains filtered or unexported fields }
Sink provides a MetricSink that can be used with a prometheus server.
func NewSink ¶
NewSink initializes and returns a pointer to a CloudWatch Sink using the supplied configuration, or an error if there is a problem with the configuration
func (*Sink) Data ¶
func (p *Sink) Data() []types.MetricDatum
Data returns collected metrics and allows us to enforce our expiration logic to clean up ephemeral metrics if their value haven't been set for a duration exceeding our allowed expiration time.
func (*Sink) IncrCounter ¶
IncrCounter should accumulate values
Click to show internal directories.
Click to hide internal directories.