Documentation
¶
Overview ¶
Package cloudwatch provides a metric exporter for the OpenTelemetry collector.
Index ¶
- Constants
- Variables
- func BuildDimensions(tagMap map[string]string) []types.Dimension
- func GetUniqueRollupList(inputLists [][]string) [][]string
- func NewFactory() exporter.Factory
- type Aggregator
- type CloudWatch
- func (c *CloudWatch) BuildMetricDatum(metric *aggregationDatum) (types.Entity, []types.MetricDatum)
- func (c *CloudWatch) Capabilities() consumer.Capabilities
- func (c *CloudWatch) Close() error
- func (c *CloudWatch) Connect() error
- func (c *CloudWatch) ConsumeMetrics(_ context.Context, metrics pmetric.Metrics) error
- func (c *CloudWatch) Description() string
- func (c *CloudWatch) IsDropping(metricName string) bool
- func (c *CloudWatch) ProcessRollup(rawDimensions []types.Dimension) [][]types.Dimension
- func (c *CloudWatch) SampleConfig() string
- func (c *CloudWatch) Shutdown(context.Context) error
- func (c *CloudWatch) Start(ctx context.Context, host component.Host) error
- func (c *CloudWatch) Write([]telegraf.Metric) error
- func (c *CloudWatch) WriteToCloudWatch(req interface{})
- type Config
- type MetricDatumBatch
- type PutMetricDataAPI
Constants ¶
const (
MaxDimensions = 30
)
Variables ¶
var (
TypeStr, _ = component.NewType("awscloudwatch")
)
Functions ¶
func BuildDimensions ¶
BuildDimensions converts the given map of strings to a list of dimensions. CloudWatch supports up to 30 dimensions per metric. So keep up to the first 30 alphabetically. This always includes the "host" tag if it exists. See https://github.com/aws/amazon-cloudwatch-agent/issues/398
func GetUniqueRollupList ¶
GetUniqueRollupList filters out duplicate dimensions within the sets and filters duplicate sets.
func NewFactory ¶ added in v1.300025.0
Types ¶
type Aggregator ¶
type Aggregator interface {
AddMetric(m *aggregationDatum)
}
func NewAggregator ¶
func NewAggregator(metricChan chan<- *aggregationDatum, shutdownChan <-chan struct{}, wg *sync.WaitGroup) Aggregator
type CloudWatch ¶
type CloudWatch struct {
// contains filtered or unexported fields
}
func (*CloudWatch) BuildMetricDatum ¶
func (c *CloudWatch) BuildMetricDatum(metric *aggregationDatum) (types.Entity, []types.MetricDatum)
BuildMetricDatum may just return the datum as-is. Or it might expand it into many datums due to dimension aggregation. There may also be more datums due to resize() on a distribution.
func (*CloudWatch) Capabilities ¶ added in v1.300025.0
func (c *CloudWatch) Capabilities() consumer.Capabilities
func (*CloudWatch) Close ¶
func (c *CloudWatch) Close() error
func (*CloudWatch) Connect ¶
func (c *CloudWatch) Connect() error
func (*CloudWatch) ConsumeMetrics ¶ added in v1.300025.0
ConsumeMetrics queues metrics to be published to CW. The actual publishing will occur in a long running goroutine. This method can block when publishing is backed up.
func (*CloudWatch) Description ¶
func (c *CloudWatch) Description() string
func (*CloudWatch) IsDropping ¶ added in v1.247350.0
func (c *CloudWatch) IsDropping(metricName string) bool
func (*CloudWatch) ProcessRollup ¶
func (c *CloudWatch) ProcessRollup(rawDimensions []types.Dimension) [][]types.Dimension
ProcessRollup creates the dimension sets based on the dimensions available in the original metric.
func (*CloudWatch) SampleConfig ¶
func (c *CloudWatch) SampleConfig() string
func (*CloudWatch) Shutdown ¶ added in v1.300025.0
func (c *CloudWatch) Shutdown(context.Context) error
func (*CloudWatch) WriteToCloudWatch ¶
func (c *CloudWatch) WriteToCloudWatch(req interface{})
type Config ¶ added in v1.300025.0
type Config struct {
Region string `mapstructure:"region"`
EndpointOverride string `mapstructure:"endpoint_override,omitempty"`
AccessKey string `mapstructure:"access_key,omitempty"`
SecretKey string `mapstructure:"secret_key,omitempty"`
RoleARN string `mapstructure:"role_arn,omitempty"`
Profile string `mapstructure:"profile,omitempty"`
Token string `mapstructure:"token,omitempty"`
ForceFlushInterval time.Duration `mapstructure:"force_flush_interval"`
MaxDatumsPerCall int `mapstructure:"max_datums_per_call"`
MaxValuesPerDatum int `mapstructure:"max_values_per_datum"`
RollupDimensions [][]string `mapstructure:"rollup_dimensions,omitempty"`
DropOriginalConfigs map[string]bool `mapstructure:"drop_original_metrics,omitempty"`
Namespace string `mapstructure:"namespace"`
// ResourceToTelemetrySettings is the option for converting resource
// attributes to telemetry attributes.
// "Enabled" - A boolean field to enable/disable this option. Default is `false`.
// If enabled, all the resource attributes will be converted to metric labels by default.
ResourceToTelemetrySettings resourcetotelemetry.Settings `mapstructure:"resource_to_telemetry_conversion"`
// MiddlewareID is an ID for an extension that can be used to configure the AWS client.
MiddlewareID *component.ID `mapstructure:"middleware,omitempty"`
// MaxRetryCount is the number of retries on PutMetricData failure. Defaults to 5.
MaxRetryCount int `mapstructure:"max_retry_count,omitempty"`
// BackoffRetryBase is the base duration for exponential backoff on retries. Defaults to 200ms.
BackoffRetryBase time.Duration `mapstructure:"backoff_retry_base,omitempty"`
// MaxConcurrentPublishers is the number of concurrent workers making PMD calls. Defaults to 10.
MaxConcurrentPublishers int `mapstructure:"max_concurrent_publishers,omitempty"`
// DowngradeErrors suppresses PutMetricData failure logs: E! and W! are downgraded to I! level.
DowngradeErrors bool `mapstructure:"downgrade_errors,omitempty"`
}
Config represent a configuration for the CloudWatch metrics exporter.
type MetricDatumBatch ¶
type PutMetricDataAPI ¶ added in v1.300074.0
type PutMetricDataAPI interface {
PutMetricData(ctx context.Context, params *cloudwatch.PutMetricDataInput, optFns ...func(*cloudwatch.Options)) (*cloudwatch.PutMetricDataOutput, error)
}