Grafana Alloy + IAM role

  • What Grafana version and what operating system are you using? - Grafana 11 running on EKS

  • What are you trying to achieve? Assign IAM role to grafana alloy agent (aiming the scrapping of cloudwatch metrics)

  • How are you trying to achieve it? - so far I’ve added the extraConfig: metrics, using the component prometheus.exporter.cloudwatch and already created the IAM role, following this doc: prometheus.exporter.cloudwatch | Grafana Alloy documentation

The idea is to use grafana alloy to scrape cloudwatch metrics, the problem is that I’m kinda stuck with this AWS SDK auth step, is there some kind of pod annotation that could do this “magically”? I could not find any instruction on how to config the aunthetication itself.
Thanks.
Btw: I’m using this helm chart k8s-monitoring-helm/charts/k8s-monitoring at main · grafana/k8s-monitoring-helm · GitHub

Generally: you need to assign IAM role to used K8S service account:

Hey there, thanks for the help, I’m going to create one and attach the policy to see how it goes. Luckily there’s a serviceAccount option set for grafana alloy. I’ll let you know