Skip to content

fix: pass node label value to OverlayBD_Alive metric render#401

Merged
liulanzheng merged 1 commit into
containerd:mainfrom
SriHarsha001:fix/alive-metric-malformed-output
May 17, 2026
Merged

fix: pass node label value to OverlayBD_Alive metric render#401
liulanzheng merged 1 commit into
containerd:mainfrom
SriHarsha001:fix/alive-metric-malformed-output

Conversation

@SriHarsha001
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
The OverlayBD_Alive metric produces malformed Prometheus exposition format output, causing Prometheus-compatible scrapers (e.g. vmagent) to fail parsing the /metrics endpoint. In src/exporter_handler.h, alive.render(1) is called without providing a string argument for the {node} label placeholder. The template renderer places the metric value and timestamp where the node label value should be, producing:
OverlayBD_Alive{node="1.000000 1778265650342
instead of:
OverlayBD_Alive{node=""} 1.000000 1778265650342

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes # This fix stores the machine hostname in ExposeRender and passes it to alive.render(1, node_name.c_str()), producing valid Prometheus output.

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test? No existing tests for the metrics exporter; this is a one-line bug fix to an existing render call.
  • Does this change require a documentation update? No.
  • Does this introduce breaking changes that would require an announcement or bumping the major version? No. The metric was previously unparseable; this makes it valid.
  • Do all new files have an appropriate license header? No new files; only an existing file was modified.

@liulanzheng liulanzheng merged commit 740e632 into containerd:main May 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants