Skip to content

fix(receiver/prometheusremotewrite): count target_info samples in PRW response stats#47108

Merged
songy23 merged 4 commits into
open-telemetry:mainfrom
Naman-B-Parlecha:namanparlecha/PRW-sample-count-fix
Mar 30, 2026
Merged

fix(receiver/prometheusremotewrite): count target_info samples in PRW response stats#47108
songy23 merged 4 commits into
open-telemetry:mainfrom
Naman-B-Parlecha:namanparlecha/PRW-sample-count-fix

Conversation

@Naman-B-Parlecha
Copy link
Copy Markdown
Contributor

@Naman-B-Parlecha Naman-B-Parlecha commented Mar 22, 2026

Description

"we got 2xx status code from the Receiver yet statistics indicate some data was not written"

This is due to target_info not being counted in samples leading to miss match count as mentioned in the commet

Link to tracking issue

Fixes #45150

Testing

Added Sub-Test in TestTranslateV2 with

  • service with only target_info metric to verify stats are counted when target_info
  • Verified exising test service with target_info metric passes

… 2.0 response stats

Signed-off-by: Naman-B-Parlecha <naman.parlecha@finalroundai.com>
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Mar 22, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@github-actions
Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

Comment thread receiver/prometheusremotewritereceiver/receiver.go Outdated
Co-authored-by: David Ashpole <dashpole@google.com>
Copy link
Copy Markdown
Member

@krajorama krajorama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@ArthurSens ArthurSens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a BUGFIX changelog entry? After that, it should be ready to merge :)

Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
@Naman-B-Parlecha
Copy link
Copy Markdown
Contributor Author

@ArthurSens Done :)
Thanks!!

@ArthurSens ArthurSens added the ready to merge Code review completed; ready to merge by maintainers label Mar 30, 2026
Comment thread .chloggen/47108.yaml Outdated
Co-authored-by: Yang Song <songy23@users.noreply.github.com>
@songy23 songy23 merged commit 4bfe6a7 into open-telemetry:main Mar 30, 2026
191 checks passed
@otelbot
Copy link
Copy Markdown
Contributor

otelbot Bot commented Mar 30, 2026

Thank you for your contribution @Naman-B-Parlecha! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. If you are getting started contributing, you can also join the CNCF Slack channel #opentelemetry-new-contributors to ask for guidance and get help.

rashmichandrashekar added a commit to Azure/prometheus-collector that referenced this pull request May 6, 2026
This PR upgrades the otelcollector to the latest version available for
the opentelemetry-collector and opentelemetry-operator.

It was automatically generated by the GitHub Actions workflow.

The summary of the OSS changelog is below:
# Prometheusreceiver Changes
## v0.148.0 to v0.150.0

Generated on: 2026-04-28 07:50:17

---

### v0.149.0
- [**BREAKING**] `receiver/prometheus`: Remove the deprecated
`report_extra_scrape_metrics` receiver configuration option and obsolete
extra scrape metric feature gates.
([#44181](open-telemetry/opentelemetry-collector-contrib#44181))
`report_extra_scrape_metrics` is no longer accepted in
`prometheusreceiver` configuration. Control extra scrape metrics through
the PromConfig.ScrapeConfigs.ExtraScrapeMetrics setting instead.
- [**FEATURE**] `receiver/prometheus`: Add support for reading
instrumentation scope attributes from `otel_scope_<attribute-name>`
labels while feature-gating deprecation of `otel_scope_info`.
([#41502](open-telemetry/opentelemetry-collector-contrib#41502))
Scope attributes are always extracted from `otel_scope_<attribute-name>`
labels on metrics. The
`receiver.prometheusreceiver.IgnoreScopeInfoMetric` feature gate (alpha,
disabled by default) controls only whether the legacy `otel_scope_info`
metric is ignored for scope attribute extraction. When the gate is
disabled, both mechanisms coexist to support migration. See the
specification change for motivation:
open-telemetry/opentelemetry-specification#4505
- [**BUG FIX**] `receiver/prometheus_remote_write`: Count target_info
samples in PRW response stats
([#47108](open-telemetry/opentelemetry-collector-contrib#47108))

## Summary

| Category | Count |
|----------|-------|
| Breaking Changes | 1 |
| Features | 1 |
| Bug Fixes | 1 |
| Other Changes | 0 |
| **Total** | **3** |

# Target-allocator Changes
## v0.148.0 to v0.150.0

Generated on: 2026-04-28 07:50:39

---

### 0.149.0
- [**BUG FIX**] `auto-instrumentation, opamp, target allocator`: Fix Env
slice aliasing in Apache HTTPD, Nginx, OpAMP Bridge, and Target
Allocator container builders when the spec slice has spare backing-array
capacity
([#4954](open-telemetry/opentelemetry-operator#4954))

## Summary

| Category | Count |
|----------|-------|
| Breaking Changes | 0 |
| Features | 0 |
| Bug Fixes | 1 |
| Other Changes | 0 |
| **Total** | **1** |

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Grace Wehner <gracewehner@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Rashmi Chandrashekar <rashmy@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time contributor PRs made by new contributors ready to merge Code review completed; ready to merge by maintainers receiver/prometheusremotewrite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/prometheusremotewrite] - returning failedSampleCount to Prometheus when sending unmatched target_info

6 participants