nerdswords / 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
889 stars 311 forks source link

What should I add in config to get metrics with tags #1403

Open Preeti011987 opened 1 month ago

Preeti011987 commented 1 month ago

I have used config from 1 of the examples provided but I want something like:

Info helper with tags

aws_elb_info{name="arn:aws:elasticloadbalancing:eu-west-1:472724724:loadbalancer/a815b16g3417211e7738a02fcc13bbf9",tag_KubernetesCluster="production-19",tag_Name="",tag_kubernetes_io_cluster_production_19="owned",tag_kubernetes_io_service_name="nginx-ingress/private-ext",region="eu-west-1"} 0 aws_ec2_info{name="arn:aws:ec2:eu-west-1:472724724:instance/i-someid",tag_Name="jenkins"} 0

in metrics. What shall I add in config.yaml to get something like tag_kubernetes/tag_name. I did try options given in document such as custom_ta, search_tag, exportedtagonmetrics But here I have to provide the tags, I want it to fetch tags automatically from AWS resource. Is this possible?

Preeti011987 commented 1 month ago

I did try to add "Action": "rds:ListTagsForResource", also in AWS IAM role. But still not getting tag as labels

kgeckhart commented 1 month ago

Are you asking how to add static data yourself? The Tags YACE pulls are straight from your AWS resources and it doesn't offer control over it. You can use prometheus relabeling to normalize inconsistent tags but it's all based on what your resources have.