Documentation ¶
Index ¶
- func BuildDimensions(mTags map[string]string) []*cloudwatch.Dimension
- func BuildMetricDatum(point telegraf.Metric) []*cloudwatch.MetricDatum
- func PartitionDatums(size int, datums []*cloudwatch.MetricDatum) [][]*cloudwatch.MetricDatum
- type CloudWatch
- func (c *CloudWatch) Close() error
- func (c *CloudWatch) Connect() error
- func (c *CloudWatch) Description() string
- func (c *CloudWatch) SampleConfig() string
- func (c *CloudWatch) Write(metrics []telegraf.Metric) error
- func (c *CloudWatch) WriteSinglePoint(point telegraf.Metric) error
- func (c *CloudWatch) WriteToCloudWatch(datums []*cloudwatch.MetricDatum) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDimensions ¶
func BuildDimensions(mTags map[string]string) []*cloudwatch.Dimension
Make a list of Dimensions by using a Point's tags. CloudWatch supports up to 10 dimensions per metric so we only keep up to the first 10 alphabetically. This always includes the "host" tag if it exists.
func BuildMetricDatum ¶
func BuildMetricDatum(point telegraf.Metric) []*cloudwatch.MetricDatum
Make a MetricDatum for each field in a Point. Only fields with values that can be converted to float64 are supported. Non-supported fields are skipped.
func PartitionDatums ¶
func PartitionDatums(size int, datums []*cloudwatch.MetricDatum) [][]*cloudwatch.MetricDatum
Partition the MetricDatums into smaller slices of a max size so that are under the limit for the AWS API calls.
Types ¶
type CloudWatch ¶
type CloudWatch struct { Region string `toml:"region"` AccessKey string `toml:"access_key"` SecretKey string `toml:"secret_key"` RoleARN string `toml:"role_arn"` Profile string `toml:"profile"` Filename string `toml:"shared_credential_file"` Token string `toml:"token"` Namespace string `toml:"namespace"` // CloudWatch Metrics Namespace // contains filtered or unexported fields }
func (*CloudWatch) Close ¶
func (c *CloudWatch) Close() error
func (*CloudWatch) Connect ¶
func (c *CloudWatch) Connect() error
func (*CloudWatch) Description ¶
func (c *CloudWatch) Description() string
func (*CloudWatch) SampleConfig ¶
func (c *CloudWatch) SampleConfig() string
func (*CloudWatch) WriteSinglePoint ¶
func (c *CloudWatch) WriteSinglePoint(point telegraf.Metric) error
Write data for a single point. A point can have many fields and one field is equal to one MetricDatum. There is a limit on how many MetricDatums a request can have so we process one Point at a time.
func (*CloudWatch) WriteToCloudWatch ¶
func (c *CloudWatch) WriteToCloudWatch(datums []*cloudwatch.MetricDatum) error