How to write/develop you own custom exporters

28 views
Skip to first unread message

Satya Prakash

unread,
Sep 21, 2020, 12:58:42 AM9/21/20
to Prometheus Users
Dear All,

Request you to help me for developing custom exporters.
 1. Any reference link?
 2. Any tutorial (freely available on web)?
 3. Step by step verified documents, will also be fine.

I want to write custom  exporters like 
a. node_exporter (where I can update whenever team need some different monitoring values),
 b. publish application monitoring results, it can be like an output file reading and storing values in tsdb.
c. monitoring any custom sql script results.

I look forward to hearing from you as soon as possible.

sayf.eddi...@gmail.com

unread,
Sep 21, 2020, 2:25:06 AM9/21/20
to Prometheus Users
Hello,
1- start by reading the guidelines and best practices from Prometheus website https://prometheus.io/docs/instrumenting/writing_exporters/
Then check the Python prometheus_client (used to write exporters) which is the best entry-level tool you can use
2- Before you start writing an exporter always check if there is one doing the same (don't reinvent the wheel), for example, your b) point, if you want to export metrics from a file there are mtail and grok_exporter.
3- ephemeral jobs (like running an SQL script) cannot monitored directly by Prometheus, you need to check https://prometheus.io/docs/practices/pushing/ and the tool https://github.com/prometheus/pushgateway

Brian Candler

unread,
Sep 21, 2020, 3:40:41 AM9/21/20
to Prometheus Users
Also don't forget the node_exporter textfile collector: you can simply write prometheus metrics into a file, either from a one-time script or a regular cronjob.
Reply all
Reply to author
Forward
0 new messages