Daniel Jaglowski 40b485f08a Update core for v0.90.0 release (#29539) 1 год назад
..
internal 849a0ec806 [chore][receiver/awscloudwatchmetrics] use generated status header (#22822) 1 год назад
Makefile 9a9ffcd00c [receiver/awscloudwatchmetricsreceiver] Add new receiver (#19429) 1 год назад
README.md 4982f49841 [chore] update examples to use debugexporter (#26715) 1 год назад
config.go e136bfdee5 [chore] Migrate all `aws` receviers to use errors.Join (#25185) 1 год назад
config_test.go 9a9ffcd00c [receiver/awscloudwatchmetricsreceiver] Add new receiver (#19429) 1 год назад
docs.go 849a0ec806 [chore][receiver/awscloudwatchmetrics] use generated status header (#22822) 1 год назад
factory.go 849a0ec806 [chore][receiver/awscloudwatchmetrics] use generated status header (#22822) 1 год назад
factory_test.go 849a0ec806 [chore][receiver/awscloudwatchmetrics] use generated status header (#22822) 1 год назад
go.mod 40b485f08a Update core for v0.90.0 release (#29539) 1 год назад
go.sum 40b485f08a Update core for v0.90.0 release (#29539) 1 год назад
metadata.yaml 62c7b5363d Remove @kovrus from code owners and approvers. (#24565) 1 год назад
receiver.go 5a78abf871 [chore][receiver/awscloudwatchmetrics] addressing lint issues (#22857) 1 год назад
receiver_test.go 9a9ffcd00c [receiver/awscloudwatchmetricsreceiver] Add new receiver (#19429) 1 год назад

README.md

CloudWatch Metrics Receiver

Status
Stability development: metrics
Distributions contrib
Issues Open issues Closed issues
Code Owners @jpkrohling

Receives Cloudwatch metrics from AWS Cloudwatch via the AWS SDK for Cloudwatch Logs

Getting Started

This receiver uses the AWS SDK as mode of authentication, which includes Profile and IMDS authentication for EC2 instances.

Configuration

Top Level Parameters

Parameter Notes type Description
region required string The AWS recognized region string
profile optional string The AWS profile used to authenticate, if none is specified the default is chosen from the list of profiles
IMDSEndpoint optional string The IMDS endpoint to authenticate to AWS
poll_interval default=1m duration The duration waiting in between requests
metrics optional Metrics Configuration for metrics ingestion of this receiver

Metrics Parameters

Parameter Notes type Description
named required See Named Parameters Configuration for Named Metrics, by default no metrics are collected

Named Parameters

Parameter Notes type Description
namespace required string AWS Metric namespace, all AWS namespaces are prefixed with AWS, eg: AWS/EC2 for EC2 metrics
metric_name required string AWS metric name
period default=5m duration Aggregation period
aws_aggregation default=sum string type of AWS aggregation, eg: sum, min, max, average
dimensions optional see Dimensions Parameters Configuration for metric dimensions

Dimension Parameters

Parameter Notes type Description
name required string Dimensions name, can't start with a colon
value required string Dimension value

Named Example

awscloudwatchmetrics:
  region: us-east-1
  poll_interval: 1m
  metrics:
    named:
      - namespace: "AWS/EC2"
        metric_name: "CPUUtilization"
        period: "5m"
        aws_aggregation: "Sum"
        dimensions:
          - Name: "InstanceId"
            Value: "i-1234567890abcdef0"
      - namespace: "AWS/S3"
        metric_name: "BucketSizeBytes"
        period: "5m"
        aws_aggregation: "p99"
        dimensions:
          - Name: "BucketName"
            Value: "OpenTelemetry"
          - Name: "StorageType"
            Value: "StandardStorage"

Sample Configs

receivers:
  awscloudwatchmetrics:
    region: eu-west-1
    poll_interval: 10m
    metrics:
      named:
        - namespace: "AWS/EC2"
          metric_name: "CPUUtilization"
          period: "5m"
          aws_aggregation: "Sum"
          dimensions:
            - Name: "InstanceId"
              Value: "i-035e091c31292427a"

processors:

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    metrics:
      receivers: [awscloudwatchmetrics]
      processors: []
      exporters: [debug]

AWS Costs

This receiver uses the GetMetricData API call, this call is not in the AWS free tier. Please refer to Amazon's pricing for further information about expected costs.

Troubleshooting / Debugging

My metrics are intermittent / not receing any metrics

Try a bigger poll_interval. CloudWatch returns no data if the period of the metric, by default for AWS supplied metrics, it's 300 seconds (5 minutes). Try out a period of 600 seconds and a poll interval of 600 seconds.

Help, I'm getting IAM permission denied

Make sure your IAM role/user has the required permissions:

"cloudwatch:GetMetricData",
"cloudwatch:GetMetricStatistics",
"cloudwatch:ListMetrics"

The following IAM permissions are required for transit gateways to work:

"ec2:DescribeTags",
"ec2:DescribeInstances",
"ec2:DescribeRegions",
"ec2:DescribeTransitGateway*"