Proposal: node-exporter: Custom label annotations

356 views
Skip to first unread message

oliver.pe...@gmail.com

unread,
Jun 10, 2021, 11:26:16 AM6/10/21
to Prometheus Developers
Hi everyone,

I'm using node-exporter on network-centric devices (routers, switches, etc) and would like to have an option add certain annotations to certain metrics that belong to network interfaces.

This would be meta-data indicating things like:
- name of remote device
- name of remove interface
- role of remote device
- location of remote device
- customer id
- etc. pp.

I've been using that concept in the bird-exporter (https://github.com/czerwonk/bird_exporter), the streaming-telemetry-exporter (https://github.com/exaring/openconfig-streaming-telemetry-exporter) and a few prorietary ones for a few years now and it has proven to be very useful when it comes to aggregating metrics or placing the right silences into alertmanager when it comes to maintenance work.

I've implemented a PoC that matches a netdev's name and adds a list of labels to the netdev's metric. The configuration is stored in a yaml file like this:
netdev:
  - name: "wlp0s20f3"
    labels:
      type: "lan"
      role: "internal"
  - name: "wg0"
    labels:
      type: "wifi"
      role: "untrusted"

This could also be extended to cover block devices as well.

Opinions?

Kind Regards
takt


Reply all
Reply to author
Forward
0 new messages