Skip to content

Comments

Fix prometheus metrics text exporter rendering#378

Merged
liulanzheng merged 1 commit intocontainerd:mainfrom
runloopai:adam/fix-text-metrics
Aug 29, 2025
Merged

Fix prometheus metrics text exporter rendering#378
liulanzheng merged 1 commit intocontainerd:mainfrom
runloopai:adam/fix-text-metrics

Conversation

@adam-rl
Copy link
Contributor

@adam-rl adam-rl commented Aug 18, 2025

What this PR does / why we need it: Iterate through all text chunks that need to be emitted as part of the metric text label section before rendering the value and timestamp.

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

Before this change:

# HELP OverlayBD_Alive
# TYPE OverlayBD_Alive gauge
OverlayBD_Alive{node="1.000000 1755544318414

# HELP OverlayBD_Read_Throughtput Bytes / sec
# TYPE OverlayBD_Read_Throughtput gauge
OverlayBD_Read_Throughtput{node="pread",type="0.000000 1755544318414
OverlayBD_Read_Throughtput{node="download",type="0.000000 1755544318414

# HELP OverlayBD_QPS
# TYPE OverlayBD_QPS gauge
OverlayBD_QPS{node="pread",type="0.000000 1755544318414
OverlayBD_QPS{node="download",type="0.000000 1755544318414

# HELP OverlayBD_MaxLatency us
# TYPE OverlayBD_MaxLatency gauge
OverlayBD_MaxLatency{node="pread",type="0.000000 1755544318414
OverlayBD_MaxLatency{node="download",type="0.000000 1755544318414

# HELP OverlayBD_Count Bytes
# TYPE OverlayBD_Count gauge
OverlayBD_Count{node="pread",type="0.000000 1755544318414
OverlayBD_Count{node="download",type="0.000000 1755544318414

After this change:

# HELP OverlayBD_Alive
# TYPE OverlayBD_Alive gauge
OverlayBD_Alive{node=""}  1.000000 1755548877123

# HELP OverlayBD_Read_Throughtput Bytes / sec
# TYPE OverlayBD_Read_Throughtput gauge
OverlayBD_Read_Throughtput{node="pread",type="",mode=""}  0.000000 1755548877123
OverlayBD_Read_Throughtput{node="download",type="",mode=""}  0.000000 1755548877123

# HELP OverlayBD_QPS
# TYPE OverlayBD_QPS gauge
OverlayBD_QPS{node="pread",type="",mode=""}  0.000000 1755548877123
OverlayBD_QPS{node="download",type="",mode=""}  0.000000 1755548877123

# HELP OverlayBD_MaxLatency us
# TYPE OverlayBD_MaxLatency gauge
OverlayBD_MaxLatency{node="pread",type="",mode=""}  0.000000 1755548877123
OverlayBD_MaxLatency{node="download",type="",mode=""}  0.000000 1755548877123

# HELP OverlayBD_Count Bytes
# TYPE OverlayBD_Count gauge
OverlayBD_Count{node="pread",type=""}  0.000000 1755548877123
OverlayBD_Count{node="download",type=""}  0.000000 1755548877123

Iterate through all text chunks that need to be emitted as
part of the metric text label section before rendering the
value and timestamp.
@liulanzheng liulanzheng merged commit bcd84a9 into containerd:main Aug 29, 2025
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