Skip to content

Fix target_info metric name in PrometheusHttpServerBuilder javadoc#8628

Draft
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/prometheus-target-info-javadoc-name
Draft

Fix target_info metric name in PrometheusHttpServerBuilder javadoc#8628
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:docs/prometheus-target-info-javadoc-name

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

No issue: trivial javadoc typo, submitting directly.

Description

  • PrometheusHttpServerBuilder.setTargetInfoMetricEnabled documents the metric as otel_target_info, but the exported name is target_info.
  • Otel2PrometheusConverter.makeTargetInfo() hardcodes MetricMetadata.builder().name("target"), which the Prometheus client exposes as target_info; no code path adds an otel_ prefix.
  • PrometheusMetricReaderBuilder.setTargetInfoMetricEnabled, which this method delegates to, already documents it as target_info.
  • The name matches the Prometheus compatibility spec, which defines target_info.
  • Introduced in Prom exporter update #7934, which added this method.

Testing done

  • Docs-only, test-exempt: no test added — existing tests already assert target_info output.
  • ./gradlew :exporters:prometheus:check — 202 tests + 1 testJpms test passed.
  • No apidiff or CHANGELOG entry: exporters/prometheus is alpha (not tracked by japicmp) and nothing user-facing changes.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.60%. Comparing base (b86f040) to head (8ec933d).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8628   +/-   ##
=========================================
  Coverage     91.60%   91.60%           
  Complexity    10343    10343           
=========================================
  Files          1013     1013           
  Lines         27352    27352           
  Branches       3215     3215           
=========================================
  Hits          25057    25057           
  Misses         1567     1567           
  Partials        728      728           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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