Skip to content

feat(dist): check Prometheus metrics text in release validation - #579

Open
scy7796 wants to merge 2 commits into
apache:masterfrom
scy7796:release-smoke-metrics
Open

scy7796 wants to merge 2 commits into
apache:masterfrom
scy7796:release-smoke-metrics

Conversation

@scy7796

@scy7796 scy7796 commented Nov 30, 2026 •

Copy link
Copy Markdown

Purpose of the PR

validate-release.sh now scrapes /metrics and /metrics/statistics on each started Server and fails on a repeated # TYPE family, a metric name outside [a-zA-Z_:][a-zA-Z0-9_:]*, or an unquoted label value. apache/hugegraph#3344 fixed the names and apache/hugegraph#3348 fixed the other two.

The repeated families only appear after ServerReporter's first report, 60 s after the Server starts, so a scrape right after startup passes on an affected build. The new metrics step therefore waits up to 180 s for /metrics/gauges to become non-empty; it returns the reporter's last report and is empty before the first one. It also requires a request sample such as metrics_gauges_GET{name=...} in /metrics/statistics. hugegraph_info{version="..."} is quoted even on affected builds, so on its own it would let the label check pass.

Local runs (Windows, JDK 17, RocksDB, Server started with java directly, about 65 s per run):

Server Result
official 1.7.0 binary package (SHA-512 checked) 3/3 fail
master f60b628 3/3 pass
master with MetricsAPI/MetricsUtil from d90946df (parent of #3348) 3/3 fail

In one saved scrape from each failing setup, /metrics had 215 (1.7.0) and 257 (d90946df) repeated # TYPE families, and /metrics/statistics had 5 request samples with an unquoted name value. No invalid metric name showed up, so only the unit test covers the name check. On master I also edited two copies of the live pages, one with a # TYPE line duplicated and one with the label quotes removed, and the check flagged both.

This is an endpoint check, not a full-package run: I have not run the whole validate-release.sh flow, and its workflow only runs for release-* branches. Normally the step waits at most one 60 s report period, less if the Server has been up longer; the poll limit is 180 s. Unit tests cover the parser and the wait (python3 -m unittest discover -s dist/tests).

After ServerReporter's first report, scrape /metrics and /metrics/statistics
and fail on a repeated # TYPE family, an invalid metric name or an unquoted
label value (apache/hugegraph#3344, apache/hugegraph#3348).
@scy7796

scy7796 commented Dec 1, 2026

Copy link
Copy Markdown
Author

Ran the full source-prevalidation flow on Linux in my fork's Actions (server f60b628, toolchain 2080729): https://github.com/scy7796/hugegraph-doc/actions/runs/46547299175

The metrics step passed on both the source-built server and the binary package. It added 42 s and 44 s, mostly waiting for the first metrics report. The run also needed two workflow fixes for the current Toolchain, which are in #580.

This branch has not been deployed

No deployments
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.

1 participant