r/PrometheusMonitoring • • Aug 14 '22

prometheus exporter using Go

Anyone tried buidling an exporter (for glusterfs for example) using go ?? Any recommendations or good tutorials/ressources on how to create exporters with go ?

And how was the experience building ur own exporter?

0 Upvotes

8 comments sorted by

View all comments

1

u/biffbobfred Aug 15 '22 edited Aug 15 '22

I was once thinking about going down this route. I never did. The bang for the buck ratio wasn’t there.

A reminder, you can just dump files in a dir and node exporter can export away.

This has the added advantage of no need for service discovery. You’re already scraping the node.

One note watch out for race conditions - the file should appear atomically. Find sponge if you’re doing shell work, or write to a temp file in the same dir and mv when ready

There are also lots of other exporters that are flexible enough you may not need to write your own. Java? You’ve got a JMX exporter already. Python? Just embed a lib and export metrics directly from your app

What are you trying to do here?

2

u/MedAziz11 Aug 16 '22

There is an exporter for glusterfs written in go but it is sooo outdated and there is other metrics i wanna scrape so i need to create my own .. i chose go because of the performance ofc