Prometheus exporters in Grafana Agent

209 views
Skip to first unread message

Elliott Balsley

unread,
Jan 11, 2024, 4:09:18 AM1/11/24
to Prometheus Users
I noticed Grafana Agent flow mode has many of the popular Prometheus exporters built in.

Unfortunately, these blocks require that you hard code the list of targets in the config.river file, so there is no way to dynamically connect it to a discovery block. Adding targets would require rewriting the config file and restarting the service.

I’m curious if anyone else has found a good use for these embedded exporters?

I’m currently running Prometheus embedded in the agent, receiving the map of targets from HTTP discovery with some relabeling (multi-target exporter pattern), and scraping a separate instance of snmp-exporter.


Ben Kochie

unread,
Jan 11, 2024, 4:14:33 AM1/11/24
to Elliott Balsley, Prometheus Users
The Grafana agent isn't really meant for complex/large setups. If you have a large/dynamic target list you're probably better off just running normal Prometheus and exporters.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CALajkdhS9Pk3LAHzDCUz4xDeosjtOY0yRKnLhrkFckY9WVMvnQ%40mail.gmail.com.

Elliott Balsley

unread,
Jan 18, 2024, 4:13:31 AM1/18/24
to Prometheus Users
Thanks for sharing that perspective. I hadn’t heard that before but I tend to agree. I also prefer Prometheus debugging webpage on port 9090 over the more limited info agent shows on 12345.

On the other hand, agent has remote.s3 which is a nice way to discover targets securely, instead of http_sd.

Robert Fratto

unread,
Jan 18, 2024, 9:09:45 AM1/18/24
to Prometheus Users
Hi, as the creator of Grafana Agent I wanted to share my perspective.

One of Grafana Labs' original motivations for creating Grafana Agent was to allow large-scale users to send their Prometheus metrics to a distributed database without needing them to operate Prometheus themselves. To do that, we decided to re-use as much as Prometheus as possible and maintain the same use cases for collecting and forwarding metrics.

In terms of our SNMP support, the lack of overlap with Prometheus is a bug: given Prometheus can collect SNMP metrics with a dynamic target set, so it should be possible to do the same in Grafana Agent. I've opened a bug report on our issue tracker and we'll address this issue alongside any other similar issues for our other embedded multi-target exporters.

A temporary workaround in the meantime would be to run snmp_exporter separately and scrape it with a dynamic set of discovered targets just as you would in Prometheus.

If you have any more questions specific to Grafana Agent in the future, feel free to reach out to us on the Grafana slack where we can see and respond more quickly

Robert Fratto

unread,
Jan 18, 2024, 9:23:52 AM1/18/24
to Prometheus Users
> large-scale users

Just to clarify the amount of scale, the largest scale user I'm personally aware of has over 100,000 instances of Grafana Agent sending many, many millions of metrics in total.
Reply all
Reply to author
Forward
0 new messages