prometheus / collectd_exporter

A server that accepts collectd stats via HTTP POST and exports them via HTTP for Prometheus consumption
Apache License 2.0
258 stars 72 forks source link

Metrics has different names that with write_prometheus #153

Open jcarnat opened 9 months ago

jcarnat commented 9 months ago

Hello,

I'm starting to use Prometheus and come from collectd/InfluxDB. I'm keeping collectd but get rid of InfluxDB to store data using Prometheus. On systems where this is available, I use the collectd write_prometheus plugin. But on FreeBSD 14, the default collectd package does not provide this plugin ; but they provide the collectd_exporter package.

Using both tools, I noticed differences in metrics' name. This leads to issues in Grafana/PromQL dashboard/requests.

With collectd_prometheus (on FreeBSD), I get:

With write_prometheus (on Illumos and OpenBSD), those have different names:

Is this expected / know? Is there a way to have the same metrics names with both tools?

Thank you.

Z10N0110 commented 3 months ago

This is because the collectd's network plugin that send data to collectd_exporter via binary protocol, which support multiple values for the same timestamp at once. various plugins will use this feature, like interface, load, disk, etc. In general, when a remote collectd instance receive the binary protocol data, it can understand those values original means by the types.db provided via TypesDB in collectd.conf file, for this exporter here, it requires you specific it through the cmd-flag --collectd.typesdb-file.

You could just save the raw types.db content to file for exporter usage, see types.db.