Fix Data Node byte metrics reported in GiB instead of bytes#26732
Open
patrickmann wants to merge 2 commits into
Open
Fix Data Node byte metrics reported in GiB instead of bytes#26732patrickmann wants to merge 2 commits into
patrickmann wants to merge 2 commits into
Conversation
The metric-registry gauges served by /rest/metrics/multiple (e.g. opensearch.os.mem.total_in_bytes) were populated from values already converted to GiB/MiB for the metrics index dashboards, so byte metrics were reported in GiB while their names still said "_in_bytes". The cluster configuration page then rendered those values as bytes, showing wrong figures. Split the two data paths: the collector now returns raw OpenSearch values, the unit conversion is applied only when building the metrics index document (dashboards unchanged), and the registry gauges expose the raw byte values so their "_in_bytes" names stay accurate. Closes #25532 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #25532
Description
The Data Node metrics served by
POST /api/datanodes/<host>/rest/metrics/multiplereported memory, heap, and disk values in GiB even though the metric names end in_in_bytes.Root cause: one
NodeStatMetricsenum feeds two consumers. The byte metrics carry abytesToGb/bytesToMbconversion intended for thegl-datanode-metricsindex and its dashboards.MetricsCollectorreused those already converted values to populate the metric-registry gauges behind the endpoint, so byte gauges returned GiB.Fix: split the two paths.
NodeMetricsCollectornow returns the raw OpenSearch values. The GiB/MiB conversion is applied only when building the metrics index document, so the dashboards are unchanged. The registry gauges expose the raw byte values.How Tested
POST /api/datanodes/<host>/rest/metrics/multiplewith{"metrics":["opensearch.os.mem.total_in_bytes","opensearch.jvm.mem.heap_max_in_bytes","opensearch.fs.total.total_in_bytes"]}and confirm the values are byte scale (billions), then open the cluster configuration page and verify Memory, JVM, and Storage columns show correct GB/MiB figures.Types of changes
Checklist: