Exporters

Expose metrics for Prometheus

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).

  1. Download the node_exporter 1.2.2.
  2. Extract it

    $ tar xvf Downloads/node_exporter-1.2.2.linux-amd64.tar.gz
    
  3. List the files

    $ ls node_exporter-1.2.2.linux-amd64
    
  4. Launch the node_exporter

    $ cd node_exporter-1.2.2.linux-amd64
    $ ./node_exporter
    
  5. Open your browser at http://127.0.0.1:9100

  6. Add your node_exporter and your neighbors to prometheus.

collectors

The Node Exporter has multiple collectors, some of them disabled by default.

Exercise

  1. 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.

  1. Download Jenkins
  2. Download the JMX exporter 0.16.1.
  3. Run Jenkins with the JMX exporter and add it to Prometheus

solution

Click to reveal.

config.yml

Click to reveal.

exercise

  1. Create a dashboard with:
    • JVM version
    • Uptime
    • Threads
    • Heap Size
    • Memory Pool size

Grok exporter

  1. Download grok exporter 0.2.8
  2. Extract it

    $ unzip Downloads/grok_exporter-0.2.8.linux-amd64.zip
    
  3. List the files

    $ ls grok_exporter-0.2.8.linux-amd64
    
  4. Create a simple job in Jenkins

  5. Re run Jenkins to output to a file (add &> jenkins.log)

exercise

solution

Click to reveal.

Blackbox exporter

  1. Download the blackbox_exporter 0.19.0.
  2. Extract it

    $ tar xvf Downloads/blackbox_exporter-0.19.0.linux-amd64.tar.gz
    
  3. List the files

    $ ls blackbox_exporter-0.19.0.linux-amd64
    
  4. Launch the blackbox_exporter

    $ cd blackbox_exporter-0.19.0.linux-amd64
    $ ./blackbox_exporter
    
  5. Open your browser at http://127.0.0.1:9115

  6. Add your blackbox_exporter and your neighbors to prometheus

Exercise