Repository navigation
metrics: document the OpenSearch gauge semantics in HELP text - #1123
Closed
unseenmagik wants to merge 1 commit into
Closed
unseenmagik wants to merge 1 commit into
unseenmagik wants to merge 1 commit into
Conversation
The gauges are registered without a description, so /metrics exposes no HELP line for any of them. This matters most for opensearch_cluster_health_status, whose encoding (2 = green, 1 = yellow, 0 = red) is the inverse of the elasticsearch_exporter convention where a higher value means worse health. Because a healthy cluster reports a constant 2 forever, a scrape is indistinguishable from a gauge stuck at a bad value, and the scale is documented nowhere in the exposition. Add descriptions to all OpenSearch gauges and a regression test pinning the health status encoding in the HELP text. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lonvia
reviewed
Sep 7, 2026
lonvia
left a comment
Collaborator
There was a problem hiding this comment.
Please remove all Claude comments in the code. They add no value.
Collaborator
|
@henrik242 Do you mind checking if that looks okay for you? And should we switch the health status meanings to align with elasticsearch-exporter to avoid further confusion? |
Collaborator
|
I'm closing this as per our AI contribution policy. Claude-generated PRs need to have a human behind them that takes responsibility for the code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The OpenSearch gauges in
OpenSearchMetricsare registered without a description, so/metricsexposes no# HELPline for any of them.This matters most for
opensearch_cluster_health_status, which encodes2 = green, 1 = yellow, 0 = red— the inverse of theelasticsearch_exporterconvention, where a higher value means worse health. A healthy cluster reports a constant2indefinitely, so a scrape is indistinguishable from a gauge stuck at a bad value, and nothing in the exposition states the scale. This has already produced a false "permanently RED cluster" report downstream (rtuszik/photon-docker#374).Changes:
.description(...)on all ten OpenSearch gaugesThe numeric mapping itself is unchanged — flipping it would break dashboards that already read it correctly.
Verified with
./gradlew test --tests de.komoot.photon.api.ApiMetricsTest(4/4 pass). Reverting just the health gauge description fails the new test and leaves the other three passing, confirming it pins the HELP text rather than passing incidentally.🤖 Generated with Claude Code