awscloudwatchmetricsreceiver

package module
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

README

CloudWatch Metrics Receiver

Status
Stability development: metrics
Distributions []
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*"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a factory for awscloudwatchmetrics receiver.

Types

type Config

type Config struct {
	Region       string         `mapstructure:"region"`
	Profile      string         `mapstructure:"profile"`
	IMDSEndpoint string         `mapstructure:"imds_endpoint"`
	PollInterval time.Duration  `mapstructure:"poll_interval"`
	Metrics      *MetricsConfig `mapstructure:"metrics"`
}

Config is the overall config structure for the awscloudwatchmetricsreceiver

func (*Config) Validate

func (cfg *Config) Validate() error

type MetricDimensionsConfig

type MetricDimensionsConfig struct {
	Name  string `mapstructure:"Name"`
	Value string `mapstructure:"Value"`
}

MetricDimensionConfig is the configuration for the metric dimensions

type MetricsConfig

type MetricsConfig struct {
	Names []*NamedConfig `mapstructure:"named"`
}

MetricsConfig is the configuration for the metrics part of the receiver added this so we could expand to other inputs such as autodiscover

type NamedConfig

type NamedConfig struct {
	Namespace      string                   `mapstructure:"namespace"`
	MetricName     string                   `mapstructure:"metric_name"`
	Period         time.Duration            `mapstructure:"period"`
	AwsAggregation string                   `mapstructure:"aws_aggregation"`
	Dimensions     []MetricDimensionsConfig `mapstructure:"dimensions"`
}

NamesConfig is the configuration for the metric namespace and metric names https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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