Exporters are HTTP servers that expose metrics. They can translate Prometheus queries into domain-specific queries. They then turn the results into Prometheus metrics.
There are hundreds of known exporters, most of them coming from the community. A few exporters are maintained by the Prometheus team.
node_exporter
The node exporter enables basic monitoring of linux machines (and other unix like systems).
- Download the node_exporter 1.2.2.
Extract it
$ tar xvf Downloads/node_exporter-1.2.2.linux-amd64.tar.gz
List the files
$ ls node_exporter-1.2.2.linux-amd64
Launch the node_exporter
$ cd node_exporter-1.2.2.linux-amd64 $ ./node_exporter
Open your browser at http://127.0.0.1:9100
Add your node_exporter and your neighbors to prometheus.
collectors
The Node Exporter has multiple collectors, some of them disabled by default.
Exercise
- Enable the systemd collector
textfile collector
Exercise
Move the metrics created before (company name, random number..) on port 5678 to be collected by the node exporter.
Do you see use cases for this feature?
Dashboards
Exercise
Create two dashboards: a dashboard that will show the network bandwidth of a server by interface, and a dashboard that will show the disk space available per disk.
Tip
You can use{job="node_exporter"}
in prometheus to see the metrics, or you
can directly open the /metrics of the node_exporter in your browser.JMX exporter
The JMX exporter is useful to monitor Java applications. It can be loaded as a “side car” (Java agent), in the same JVM’s as the applications.
- Download Jenkins
- Download the JMX exporter 0.16.1.
- Run Jenkins with the JMX exporter and add it to Prometheus
solution
Click to reveal.config.yml
Click to reveal.exercise
- Create a dashboard with:
- JVM version
- Uptime
- Threads
- Heap Size
- Memory Pool size
Grok exporter
- Download grok exporter 0.2.8
Extract it
$ unzip Downloads/grok_exporter-0.2.8.linux-amd64.zip
List the files
$ ls grok_exporter-0.2.8.linux-amd64
Create a simple job in Jenkins
Re run Jenkins to output to a file (add
&> jenkins.log
)
exercise
- Create a job with name “test” and command “sleep 10”
- Run the job and look for “INFO: test #2 main build action completed: SUCCESS” in the logs
- Create a counter and a gauge for those:
job_last_build_number
andjob_build_total
. The name of the job should be a label, and for thejob_build_total
the status should too be a label.
solution
Click to reveal.Blackbox exporter
- Download the blackbox_exporter 0.19.0.
Extract it
$ tar xvf Downloads/blackbox_exporter-0.19.0.linux-amd64.tar.gz
List the files
$ ls blackbox_exporter-0.19.0.linux-amd64
Launch the blackbox_exporter
$ cd blackbox_exporter-0.19.0.linux-amd64 $ ./blackbox_exporter
Open your browser at http://127.0.0.1:9115
Add your blackbox_exporter and your neighbors to prometheus
Exercise
- Monitor the Inuits website (DNS + HTTP) using the blackbox exporter
- Check with prometheus blackbox exporter when the SSL certificate will expire in days
- Create a dashboard with the detailed time it takes to get the OSMC website.