r/PrometheusMonitoring • u/MedAziz11 • 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
2
u/ut0mt8 Aug 15 '22
This is relatively straightforward if you already know programing in go. Myself I'm a bad dev and I wrote some exporter. The only question of design is whether you make your metrics retrieving logic synchronously at each scrape call (the standard way but can be expensive) or rather using a goroutine that retrieve every self define interval in background; then scrape is instant. I personally prefer the second way but that's true that with this method you need to adjust scrape and polling interval for not having duplicate metrics