prometheus-community / yet-another-cloudwatch-exporter

Prometheus exporter for AWS CloudWatch - Discovers services through AWS tags, gets CloudWatch metrics data and provides them as Prometheus metrics with AWS tags as labels
Apache License 2.0
983 stars 335 forks source link

[FEATURE] Add support of CloudWatchSynthetics in discovery mode #1519

Open bawk3 opened 2 months ago

bawk3 commented 2 months ago

Is there an existing issue for this?

Feature description

I would like to have ability to export metrics of my CW Canaries. For now I can do it in static mode. If I try to configure in discovery mode then I get error {"caller":"main.go:67","err":"Couldn't read /tmp/config.yml: Discovery job [0]: Service is not in known list!: CloudWatchSynthetics","level":"error","msg":"Error running yace","ts":"2024-08-30T13:11:04.404326176Z","version":"v0.61.2"}

What might the configuration look like?

discovery:
  exportedTagsOnMetrics:
    CloudWatch:
      - Name
  jobs:
    - type: "CloudWatchSynthetics"
      regions:
        - "eu-central-1"  # Specify the AWS region where your Canary is running
      metrics:
        - namespace: "CloudWatchSynthetics"
          name: "Duration"
          dimensions:
            - "CanaryName"
            -  "StepName"
          statistics:
            - "Average"

Anything else?

No response

wanieldilson commented 1 month ago

@bawk3 how are you dealing with CloudWatchSynthetics right now? Custom namespace?

bawk3 commented 1 month ago

Hi @wanieldilson For now using static config and specify manually each Canary and step like this

apiVersion: v1alpha1
static:
  - namespace: CloudWatchSynthetics
    name: Canary1Step1
    regions:
      - eu-central-1
    dimensions:
      - name: "CanaryName"
        value: "canary1"
      - name: "StepName"
        value: "step1"
    metrics:
      - name: Duration
        statistics:
        - Average
        period: 60
        length: 86400
        delay: 300
  - namespace: CloudWatchSynthetics
    name: Canary1Step2
    regions:
      - eu-central-1
    dimensions:
      - name: "CanaryName"
        value: "canary1"
      - name: "StepName"
        value: "step2"
    metrics:
      - name: Duration
        statistics:
        - Average
        period: 60
        length: 86400
        delay: 300
  - namespace: CloudWatchSynthetics
    name: Canary2Step1
    regions:
      - eu-central-1
      - us-east-1
    dimensions:
      - name: "CanaryName"
        value: "Canary2"
      - name: "StepName"
        value: "step1"
    metrics:
      - name: Duration
        statistics:
        - Average
        period: 60
        length: 86400
        delay: 300

Would like to have possibility not to edit config after adding new canary or step.