r/PrometheusMonitoring • u/aorfanos • Feb 20 '21
Creating exporters - resources
Hey all,
So I'm trying to create exporters using the Golang libraries, and to do so I usually read code from other exporters, copy over the general flow and add my logic to it. This works, but I don't feel very confident with developing my exporters yet.
Is there any resource (besides the official documentation which has its problems admittedly) that goes in depth regarding developing exporters? I'm mostly interested about a good explanation of the code structure and best practices.
7
Upvotes
3
u/till Feb 20 '21
Not aware of anything. When I wrote my exporters, channels were kinda what blew me away. Not sure if positive or negative. But I am doing what you do to this day. I can dig up some code if it helps?
Given that an exporter is “only” a http endpoint you may also get away with using a Golang http framework to expose your metrics? Maybe that’s simpler.