Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to automatically use all labels as dimensions for Prometheus #282

Draft
wants to merge 1 commit into
base: aws-cwa-dev
Choose a base branch
from

Conversation

TravisStark
Copy link

@TravisStark TravisStark commented Feb 26, 2025

Description

Currently, in the event the application exposes a new label, the customer must explicitly include the new label in "dimensions" and update configuration to make that new label available in CloudWatch Metrics.

This change allows customers to leave dimensions off of metric_declaration and receive all available dimensions.

Current

    {
      "logs": {
        "credentials": {
          "role_arn": "arn..."
        },
        "metrics_collected": {
          "prometheus": {
            "prometheus_config_path": "/etc/prometheusconfig/prometheus.yaml",
            "emf_processor": {
              "metric_declaration": [
                {
                  "source_labels": [
                    "job"
                  ],
                  "label_matcher": "(kubernetes-apiservers|rdi-metric-exporter|kube-state-metrics)",
                  "dimensions": [
                    [
                      "ClusterName",
                      "Service"
                    ]
                  ],
                  "metric_selectors": [
                    ".*"
                  ]
                }
              ]
            }
          }
        },
        "force_flush_interval": 5
      }
    }

New

    {
      "logs": {
        "credentials": {
          "role_arn": "arn:aws:iam::939706305709:role/AWSCloudWatchRoleToBeAssumed"
        },
        "metrics_collected": {
          "prometheus": {
            "prometheus_config_path": "/etc/prometheusconfig/prometheus.yaml",
            "emf_processor": {
              "metric_declaration": [
                {
                  "source_labels": [
                    "job"
                  ],
                  "label_matcher": "(kubernetes-apiservers|rdi-metric-exporter|kube-state-metrics)",
                  "metric_selectors": [
                    ".*"
                  ]
                }
              ]
            }
          }
        },
        "force_flush_interval": 5
      }
    }

Link to tracking issue

Fixes

Testing

Documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant