Node_exporter: Error when metric is presented in two different prom files

Created on 1 Mar 2017  路  5Comments  路  Source: prometheus/node_exporter

* gathered metric family node_service_state_last_run_exit_code has help "Metric read from /var/lib/node_exporter/node_service_node_exporter_last_exit_code2.prom" but should have "Metric read from /var/lib/node_exporter/node_service_node_exporter_last_exit_code.prom"

To reproduce just clone any prom and change labels in a new file.

Most helpful comment

I found solution. This error rise in registy.ro. If tries to found HELP comment for metric, and if does not find, use file name. But for equal metric in different files help text will be different. So, you can add equal HELP comment line for every metric.
For example:

first.prom

# HELP mymetric mymetric_help_text mymetric{source="source",target="target"} 1 1490257498360

second.prom

# HELP mymetric mymetric_help_text mymetric{source="source",target="target"} 112323 1490257498360

All 5 comments

I found solution. This error rise in registy.ro. If tries to found HELP comment for metric, and if does not find, use file name. But for equal metric in different files help text will be different. So, you can add equal HELP comment line for every metric.
For example:

first.prom

# HELP mymetric mymetric_help_text mymetric{source="source",target="target"} 1 1490257498360

second.prom

# HELP mymetric mymetric_help_text mymetric{source="source",target="target"} 112323 1490257498360

Thanks @borsden, good point!

Hi,

I ran into this, and thought I'd clarify the current state of node_exporter when the same "helpless" metric (same name, different labels, no "# HELP") is present in multiple input files:

  • You get a benign-looking error message about the different (generated) HELPs.
  • The metric is parsed only from one file, no matter the different labels.
  • The workaround is to add an explicit # HELP to the metrics in all files (same in all files).

Adding # HELP gets rid of the error message and allows the metrics to be parsed too.
This is with the binary download node_exporter-0.14.0.linux-amd64.

having the same metric in multiple files is officially not supported.

For the record, the same error can occur for wmi-exporter.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mInrOz picture mInrOz  路  5Comments

mhansen picture mhansen  路  4Comments

Blasterdick picture Blasterdick  路  3Comments

Justin417 picture Justin417  路  3Comments

prologic picture prologic  路  4Comments