Skip to content

[FEATURE] discover VPC tags of AWS/EC2 metrics with Per-VPC-Metrics dimension #1847

Description

@liam-howe-maersk

Is there an existing issue for this?

  • I have searched the existing issues

Feature description

The AWS/EC2 namespace contains metrics scoped to VPCs rather than EC2 instances, such as NetworkAddressUsage, which uses the Per-VPC-Metrics dimension (e.g. Per-VPC-Metrics=vpc-0abc123ef).

yet-another-cloudwatch-exporter only discovers ec2:instance resources for AWS/EC2 jobs. When CloudWatch returned a metric with a Per-VPC-Metrics dimension, the associator found no matching resource and emitted the metric as a global metric with name="global" and empty tag labels.

We would like for tags that are attached to the VPC to be surfaced in the resulting metrics, similar to how tags on EC2 instances are surfaced on EC2 related metrics. This helps us to meet prometheus labelling requirements enforced by the observability platform.

What might the configuration look like?

apiVersion: v1alpha1
sts-region: eu-central-1
nilToZero: true
discovery:
  exportedTagsOnMetrics:
    AWS/EC2:
      - my-tag
  jobs:
    - type: AWS/EC2
      regions:
        - eu-central-1
      metrics:
        - name: NetworkAddressUsage
          statistics: [Average]
      period: 60
      length: 600

Anything else?

I have already opened a PR with our suggested change in it

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions