prometheus / prometheus/node_exporter

Error when reading same metrics from multiple files, one with and one without a HELP entry

Open
#3,052 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
13.8k
Forks
2.7k
Avg merge
1d 23h
Merged PRs (30d)
8

Description

Host operating system: output of uname -a

Linux master 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 7 09:00:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

node_exporter version: output of node_exporter --version
node_exporter, version 1.8.0 (branch: master, revision: cf0dffe8dce4985132440290d3278373f70f8493)
  build user:       frederic@master
  build date:       20240509-09:40:57
  go version:       go1.22.2
  platform:         linux/amd64
  tags:             unknown
node_exporter command line flags

/usr/local/bin/node_exporter --collector.textfile.directory=/var/metrics/node_exporter

node_exporter log output

* [from Gatherer #2] collected metric my_metric gauge:{value:1} has help \"Metric read from /var/metrics/node_exporter/data1.prom, /var/metrics/node_exporter/data2.prom\" but should have \"my custom help text\"

Are you running node_exporter in Docker?

no

What did you do that produced an error?

Create 2 prom files in collector.textfile.directory containing metrics with the same name and different labels.
One prom file contains a corresponding HELP entry, the other does NOT contain one.

What did you expect to see?

all metrics from both files + the one HELP entry in the output (maybe additionally with "Metric read from <files>")

What did you see instead?

only the metrics with the help entry
the metrics from the file without the help entry were omitted in the output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the textfile collector configured through --collector.textfile.directory and reproduce the case using data1.prom and data2.prom, with matching metric names, different labels, and only one HELP entry. Trace how the collector combines those files and verify that the output retains metrics from both files while preserving the available HELP text.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, prometheus
Domain
observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.