Skip to content

Extract shared Prometheus metric utilities for output consistency #6830

Merged
kkondaka merged 3 commits into
opensearch-project:mainfrom
srikanthpadakanti:prometheus-shared-event-builder
May 11, 2026
Merged

Extract shared Prometheus metric utilities for output consistency #6830
kkondaka merged 3 commits into
opensearch-project:mainfrom
srikanthpadakanti:prometheus-shared-event-builder

Conversation

@srikanthpadakanti
Copy link
Copy Markdown
Collaborator

Description

  • Extracts duplicated utility methods (extractServiceName, stripCounterSuffix, parseLeValue, parseQuantileValue) into shared PrometheusMetricUtils
  • Replaces inline string literals with shared AGGREGATION_TEMPORALITY_CUMULATIVE constant
  • Adds PrometheusOutputConsistencyTest — feeds same metric through both parsers, asserts identical output
  • Adds coverage for PrometheusScrapeConfig.isTargetUrlSchemeValid() and decimal timestamp parsing

Issues Resolved

Resolves #6766
#6766

Context

Per #6766, @dlvenable asked for common code to ensure output consistency between remote write and scrape parsers.

Check List

  • [ X ] New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
  • [ X ] New functionality has javadoc added
  • [ X ] Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…-parser consistency test

Signed-off-by: Srikanth Padakanti <srikanth_padakanti@apple.com>
@kkondaka kkondaka merged commit 889146a into opensearch-project:main May 11, 2026
66 of 72 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.

Discuss: Separate prometheus_scrape source vs combined prometheus source

3 participants