Skip to content

[chore][pkg/translator/prometheusremotewrite] Reduce scope of validateMetric method in PRW translator.#17411

Merged
codeboten merged 1 commit into
open-telemetry:mainfrom
kovrus:prw-translator-simplify
Jan 10, 2023
Merged

[chore][pkg/translator/prometheusremotewrite] Reduce scope of validateMetric method in PRW translator.#17411
codeboten merged 1 commit into
open-telemetry:mainfrom
kovrus:prw-translator-simplify

Conversation

@kovrus

@kovrus kovrus commented Jan 6, 2023

Copy link
Copy Markdown
Member

Description:

Reduce the scope of the validateMetric, clarify its signature, and improve/clean up its tests.

There are a few things that are wrong with this method and its tests. First, comments around it say that it should check type and temporality combination, but it also checks whether metrics have data points. The data points length validation is actually done later in [FromMetrics](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/bf8b66494e8ca41b973905566a15b4fa49421dc8/pkg/translator/prometheusremotewrite/metrics_to_prw.go#L44) function and handled with the correct error while validMetrics will return invalid temporality and type combination for both not supported temp and empty data points. Seconds, validMetrics does not have test cases that test type and temporality combinations.

@runforesight

runforesight Bot commented Jan 6, 2023

Copy link
Copy Markdown

Foresight Summary

    
Major Impacts

build-and-test-windows duration(4 seconds) has decreased 44 minutes 29 seconds compared to main branch avg(44 minutes 33 seconds).
View More Details

✅  check-links workflow has finished in 49 seconds (2 minutes 13 seconds less than main branch avg.) and finished at 6th Jan, 2023.


Job Failed Steps Tests
changed files -     🔗  N/A See Details
check-links -     🔗  N/A See Details

✅  tracegen workflow has finished in 1 minute 2 seconds (2 minutes 21 seconds less than main branch avg.) and finished at 6th Jan, 2023.


Job Failed Steps Tests
build-dev -     🔗  N/A See Details
publish-latest -     🔗  N/A See Details
publish-stable -     🔗  N/A See Details

✅  prometheus-compliance-tests workflow has finished in 3 minutes 11 seconds (6 minutes less than main branch avg.) and finished at 6th Jan, 2023.


Job Failed Steps Tests
prometheus-compliance-tests -     🔗  ✅ 21  ❌ 0  ⏭ 0    🔗 See Details

✅  build-and-test workflow has finished in 36 minutes 9 seconds (12 minutes 3 seconds less than main branch avg.) and finished at 6th Jan, 2023.


Job Failed Steps Tests
unittest-matrix (1.18, internal) -     🔗  ✅ 618  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, internal) -     🔗  ✅ 618  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, processor) -     🔗  ✅ 1469  ❌ 0  ⏭ 0    🔗 See Details
correctness-metrics -     🔗  ✅ 2  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, extension) -     🔗  ✅ 528  ❌ 0  ⏭ 0    🔗 See Details
correctness-traces -     🔗  ✅ 17  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.18, extension) -     🔗  ✅ 528  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.18, processor) -     🔗  ✅ 1469  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.18, receiver-0) -     🔗  ✅ 2564  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, receiver-0) -     🔗  ✅ 2564  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.18, exporter) -     🔗  ✅ 2462  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, other) -     🔗  ✅ 4428  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.18, receiver-1) -     🔗  ✅ 1887  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, receiver-1) -     🔗  ✅ 1887  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.19, exporter) -     🔗  ✅ 2462  ❌ 0  ⏭ 0    🔗 See Details
unittest-matrix (1.18, other) -     🔗  ✅ 4428  ❌ 0  ⏭ 0    🔗 See Details
integration-tests -     🔗  ✅ 55  ❌ 0  ⏭ 0    🔗 See Details
setup-environment -     🔗  N/A See Details
lint-matrix (receiver-0) -     🔗  N/A See Details
lint-matrix (receiver-1) -     🔗  N/A See Details
lint-matrix (processor) -     🔗  N/A See Details
lint-matrix (exporter) -     🔗  N/A See Details
lint-matrix (extension) -     🔗  N/A See Details
lint-matrix (internal) -     🔗  N/A See Details
lint-matrix (other) -     🔗  N/A See Details
build-examples -     🔗  N/A See Details
check-collector-module-version -     🔗  N/A See Details
check-codeowners -     🔗  N/A See Details
checks -     🔗  N/A See Details
lint -     🔗  N/A See Details
unittest (1.19) -     🔗  N/A See Details
unittest (1.18) -     🔗  N/A See Details
cross-compile (darwin, amd64) -     🔗  N/A See Details
cross-compile (darwin, arm64) -     🔗  N/A See Details
cross-compile (linux, 386) -     🔗  N/A See Details
cross-compile (linux, amd64) -     🔗  N/A See Details
cross-compile (linux, arm) -     🔗  N/A See Details
cross-compile (linux, arm64) -     🔗  N/A See Details
cross-compile (linux, ppc64le) -     🔗  N/A See Details
cross-compile (windows, 386) -     🔗  N/A See Details
cross-compile (windows, amd64) -     🔗  N/A See Details
build-package (deb) -     🔗  N/A See Details
build-package (rpm) -     🔗  N/A See Details
windows-msi -     🔗  N/A See Details
publish-check -     🔗  N/A See Details
publish-dev -     🔗  N/A See Details
publish-stable -     🔗  N/A See Details

✅  load-tests workflow has finished in 10 minutes 45 seconds (5 minutes 52 seconds less than main branch avg.) and finished at 6th Jan, 2023.


Job Failed Steps Tests
loadtest (TestIdleMode) -     🔗  ✅ 1  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestTraceAttributesProcessor) -     🔗  ✅ 3  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestMetric10kDPS|TestMetricsFromFile) -     🔗  ✅ 6  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestTraceNoBackend10kSPS|TestTrace1kSPSWithAttrs) -     🔗  ✅ 8  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestTraceBallast1kSPSWithAttrs|TestTraceBallast1kSPSAddAttrs) -     🔗  ✅ 10  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestMetricResourceProcessor|TestTrace10kSPS) -     🔗  ✅ 12  ❌ 0  ⏭ 0    🔗 See Details
loadtest (TestBallastMemory|TestLog10kDPS) -     🔗  ✅ 19  ❌ 0  ⏭ 0    🔗 See Details
setup-environment -     🔗  N/A See Details

⭕  changelog workflow has finished in 3 seconds (9 minutes 25 seconds less than main branch avg.) and finished at 9th Jan, 2023.


Job Failed Steps Tests
changelog -     🔗  N/A See Details

⭕  build-and-test-windows workflow has finished in 4 seconds (44 minutes 29 seconds less than main branch avg.) and finished at 9th Jan, 2023.


Job Failed Steps Tests
windows-unittest-matrix -     🔗  N/A See Details
windows-unittest -     🔗  N/A See Details

🔎 See details on Foresight

*You can configure Foresight comments in your organization settings page.

@kovrus kovrus force-pushed the prw-translator-simplify branch 2 times, most recently from 940f8c1 to 8374938 Compare January 6, 2023 10:58
@kovrus kovrus marked this pull request as ready for review January 6, 2023 10:59
@kovrus kovrus requested a review from a team January 6, 2023 10:59
@kovrus kovrus requested a review from Aneurysm9 as a code owner January 6, 2023 10:59
@kovrus kovrus force-pushed the prw-translator-simplify branch from 8374938 to da177c7 Compare January 6, 2023 11:42
@kovrus

kovrus commented Jan 9, 2023

Copy link
Copy Markdown
Member Author

cc: @dashpole

@dashpole dashpole added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jan 9, 2023
@codeboten codeboten merged commit ead3675 into open-telemetry:main Jan 10, 2023
@kovrus kovrus deleted the prw-translator-simplify branch January 10, 2023 16:52
@plantfansam plantfansam mentioned this pull request Jul 21, 2023
rashmichandrashekar added a commit to Azure/prometheus-collector that referenced this pull request Jan 16, 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.136.0 to v0.142.0

Generated on: 2026-01-11 07:06:49

---

### v0.142.0
- [**BREAKING**] `receiver/prometheus`: Promote the
receiver.prometheusreceiver.RemoveStartTimeAdjustment feature gate to
stable and remove in-receiver metric start time adjustment in favor of
the metricstarttime processor, including disabling the created-metric
feature gate.
([#44180](open-telemetry/opentelemetry-collector-contrib#44180))
Previously, users could disable the RemoveStartTimeAdjustment feature
gate to temporarily keep the legacy start time adjustment behavior in
the Prometheus receiver. With this promotion to stable and bounded
registration, that gate can no longer be disabled; the receiver will no
longer set StartTime on metrics based on process_start_time_seconds, and
users should migrate to the metricstarttime processor for equivalent
functionality. This change also disables the
receiver.prometheusreceiver.UseCreatedMetric feature gate, which
previously used the `<metric>_created` series to derive start timestamps
for counters, summaries, and histograms when scraping non OpenMetrics
protocols. However, this does not mean that the `_created` series is
always ignored: when using the OpenMetrics 1.0 protocol, Prometheus
itself continues to interpret the `_created` series as the start
timestamp, so only the receiver-side handling for other scrape protocols
has been removed.
- [**BREAKING**] `receiver/prometheus`: Native histogram scraping and
ingestion is now controlled by the scrape configuration option
`scrape_native_histograms`.
([#44861](open-telemetry/opentelemetry-collector-contrib#44861))
The feature gate `receiver.prometheusreceiver.EnableNativeHistograms` is
now stable and enabled by default. Native histograms scraped from
Prometheus will automatically be converted to OpenTelemetry exponential
histograms. To enable scraping of native histograms, you must configure
`scrape_native_histograms: true` in your Prometheus scrape configuration
(either globally or per-job). Additionally, the protobuf scrape protocol
must be enabled by setting `scrape_protocols` to include
`PrometheusProto`.
- [**BREAKING**] `receiver/prometheusremotewrite`: Updated to Remote
Write 2.0 spec rc.4, requiring Prometheus 3.8.0 or later
([#44861](open-telemetry/opentelemetry-collector-contrib#44861))
The upstream Prometheus library updated the Remote Write 2.0 protocol
from rc.3 to rc.4 in
prometheus/prometheus[#17411](open-telemetry/opentelemetry-collector-contrib#17411).
This renamed `CreatedTimestamp` to `StartTimestamp` and moved it from
the `TimeSeries` message to individual `Sample` and `Histogram`
messages. This is a wire-protocol incompatibility, so Prometheus
versions 3.7.x and earlier will no longer work correctly with this
receiver. Please upgrade to Prometheus 3.8.0 or later.
- [**OTHER**] `receiver/prometheus`: Deprecate `use_start_time_metric`
and `start_time_metric_regex` config in favor of the processor
`metricstarttime`
([#44180](open-telemetry/opentelemetry-collector-contrib#44180))
- [**FEATURE**] `receiver/prometheusremotewrite`: Map.PutStr causes
excessive memory allocations due to repeated slice expansions
([#44612](open-telemetry/opentelemetry-collector-contrib#44612))
- [**BUG FIX**] `receiver/prometheus`: Fix HTTP response body leak in
target allocator when fetching scrape configs fails
([#44921](open-telemetry/opentelemetry-collector-contrib#44921))
The getScrapeConfigsResponse function did not close resp.Body on error
paths. If io.ReadAll or yaml.Unmarshal failed, the response body would
leak, potentially causing HTTP connection exhaustion.
- [**BUG FIX**] `receiver/prometheus`: Fixes yaml marshaling of
prometheus/common/config.Secret types
([#44445](open-telemetry/opentelemetry-collector-contrib#44445))
### v0.141.0
- [**FEATURE**] `receiver/prometheus`: Add feature gate for extra scrape
metrics in Prometheus receiver
([#44181](open-telemetry/opentelemetry-collector-contrib#44181))
deprecation of extra scrape metrics in Prometheus receiver will be
removed eventually.
- [**FEATURE**] `receiver/prometheus`: Support JWT Profile for
Authorization Grant (RFC 7523 3.1)
([#44381](open-telemetry/opentelemetry-collector-contrib#44381))
### v0.140.0
- [**BREAKING**] `receiver/prometheus`: The prometheus receiver no
longer adjusts the start time of metrics by default.
([#43656](open-telemetry/opentelemetry-collector-contrib#43656))
Disable the receiver.prometheusreceiver.RemoveStartTimeAdjustment |
feature gate to temporarily re-enable this functionality. Users that
need | this functionality should migrate to the metricstarttime
processor, | and use the true_reset strategy for equivalent behavior.
- [**FEATURE**] `receiver/prometheusremotewrite`: Skip emitting empty
metrics.
([#44149](open-telemetry/opentelemetry-collector-contrib#44149))
- [**FEATURE**] `receiver/prometheusremotewrite`: prometheusremotewrite
receiver now accepts metric type unspcified histograms.
([#41840](open-telemetry/opentelemetry-collector-contrib#41840))
### v0.139.0
- [**BUG FIX**] `receiver/prometheus`: Fix missing staleness tracking
leading to missing no recorded value data points.
([#43893](open-telemetry/opentelemetry-collector-contrib#43893))
- [**BUG FIX**] `receiver/prometheusremotewrite`: Fixed a concurrency
bug in the Prometheus remote write receiver where concurrent requests
with identical job/instance labels would return empty responses after
the first successful request.
([#42159](open-telemetry/opentelemetry-collector-contrib#42159))
### v0.138.0
- [**FEATURE**] `receiver/prometheus`: added NHCB(native histogram wit
custom buckets) to explicit histogram conversion
([#41131](open-telemetry/opentelemetry-collector-contrib#41131))

## Summary

| Category | Count |
|----------|-------|
| Breaking Changes | 4 |
| Features | 6 |
| Bug Fixes | 4 |
| Other Changes | 1 |
| **Total** | **15** |

# Target-allocator Changes
## v0.136.0 to v0.142.0

Generated on: 2026-01-11 07:07:05

---

### 0.142.0
- [**FEATURE**] `target allocator`: Add support for prometheus scrape
classes
([#3600](open-telemetry/opentelemetry-operator#3600))
Added support for configuring `scrapeClasses` when using the
PrometheusCR-feature of the target allocator. The format of the
`scrapeClasses` array is exactly as same as `spec.scrapeClasses` of the
`Prometheus` CRD.
- [**BUG FIX**] `target allocator`: Fix CA certificate race condition
with client cert renewals by extending its duration and and renewal
attempt.
([#4441](open-telemetry/opentelemetry-operator#4441))
The CA certificate now has a 2-year duration (instead of the default 90
days) to prevent race conditions where client and server certificates
could be signed by different CA versions during simultaneous renewal.
This ensures the CA remains stable while dependent certificates renew
regularly.
### 0.141.0
- [**FEATURE**] `target allocator`: make evaluation_interval
configurable for Prometheus CR watcher
([#4520](open-telemetry/opentelemetry-operator#4520))
### 0.140.0
- [**BUG FIX**] `github action`: Remove unused VERSION and VERSION_DATE
environment variables from publish workflows
([#4470](open-telemetry/opentelemetry-operator#4470))
Removed the unused "Read version" step that set VERSION and VERSION_DATE
environment variables in both publish-target-allocator.yaml and
publish-operator-opamp-bridge.yaml workflows. These variables were never
referenced anywhere in the workflows.
### 0.138.0
- [**BREAKING**] `target allocator`: Remove the
operator.collector.targetallocatorcr feature flag
([#2422](open-telemetry/opentelemetry-operator#2422))
This behavior has been enabled by default since version 0.127.0.
- [**BUG FIX**] `target allocator`: Add missing TA ownership watches to
cert-manager Certificate and Issuer
([#4368](open-telemetry/opentelemetry-operator#4368))
### 0.137.0
- [**BREAKING**] `target allocator`: Promote the
operator.collector.targetallocatorcr feature flag to Stable
([#2422](open-telemetry/opentelemetry-operator#2422))
The flag can no longer be disabled. It will be completely removed in
0.138.0.
- [**BUG FIX**] `target allocator, opamp`: Fix version not being updated
after version upgrade.
([#4378](open-telemetry/opentelemetry-operator#4378))
- [**BUG FIX**] `target-allocator`: Fixed potential duplicate scrape
targets caused by Prometheus relabeling.
([#3617](open-telemetry/opentelemetry-operator#3617))

## Summary

| Category | Count |
|----------|-------|
| Breaking Changes | 2 |
| Features | 2 |
| Bug Fixes | 5 |
| Other Changes | 0 |
| **Total** | **9** |

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rashmi Chandrashekar <rashmy@microsoft.com>
vishiy added a commit to Azure/prometheus-collector that referenced this pull request Jan 16, 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.136.0 to v0.142.0

Generated on: 2026-01-11 07:06:49

---

### v0.142.0
- [**BREAKING**] `receiver/prometheus`: Promote the
receiver.prometheusreceiver.RemoveStartTimeAdjustment feature gate to
stable and remove in-receiver metric start time adjustment in favor of
the metricstarttime processor, including disabling the created-metric
feature gate.

([#44180](open-telemetry/opentelemetry-collector-contrib#44180))
Previously, users could disable the RemoveStartTimeAdjustment feature
gate to temporarily keep the legacy start time adjustment behavior in
the Prometheus receiver. With this promotion to stable and bounded
registration, that gate can no longer be disabled; the receiver will no
longer set StartTime on metrics based on process_start_time_seconds, and
users should migrate to the metricstarttime processor for equivalent
functionality. This change also disables the
receiver.prometheusreceiver.UseCreatedMetric feature gate, which
previously used the `<metric>_created` series to derive start timestamps
for counters, summaries, and histograms when scraping non OpenMetrics
protocols. However, this does not mean that the `_created` series is
always ignored: when using the OpenMetrics 1.0 protocol, Prometheus
itself continues to interpret the `_created` series as the start
timestamp, so only the receiver-side handling for other scrape protocols
has been removed.
- [**BREAKING**] `receiver/prometheus`: Native histogram scraping and
ingestion is now controlled by the scrape configuration option
`scrape_native_histograms`.

([#44861](open-telemetry/opentelemetry-collector-contrib#44861))
The feature gate `receiver.prometheusreceiver.EnableNativeHistograms` is
now stable and enabled by default. Native histograms scraped from
Prometheus will automatically be converted to OpenTelemetry exponential
histograms. To enable scraping of native histograms, you must configure
`scrape_native_histograms: true` in your Prometheus scrape configuration
(either globally or per-job). Additionally, the protobuf scrape protocol
must be enabled by setting `scrape_protocols` to include
`PrometheusProto`.
- [**BREAKING**] `receiver/prometheusremotewrite`: Updated to Remote
Write 2.0 spec rc.4, requiring Prometheus 3.8.0 or later
([#44861](open-telemetry/opentelemetry-collector-contrib#44861))
The upstream Prometheus library updated the Remote Write 2.0 protocol
from rc.3 to rc.4 in

prometheus/prometheus[#17411](open-telemetry/opentelemetry-collector-contrib#17411).
This renamed `CreatedTimestamp` to `StartTimestamp` and moved it from
the `TimeSeries` message to individual `Sample` and `Histogram`
messages. This is a wire-protocol incompatibility, so Prometheus
versions 3.7.x and earlier will no longer work correctly with this
receiver. Please upgrade to Prometheus 3.8.0 or later.
- [**OTHER**] `receiver/prometheus`: Deprecate `use_start_time_metric`
and `start_time_metric_regex` config in favor of the processor
`metricstarttime`

([#44180](open-telemetry/opentelemetry-collector-contrib#44180))
- [**FEATURE**] `receiver/prometheusremotewrite`: Map.PutStr causes
excessive memory allocations due to repeated slice expansions
([#44612](open-telemetry/opentelemetry-collector-contrib#44612))
- [**BUG FIX**] `receiver/prometheus`: Fix HTTP response body leak in
target allocator when fetching scrape configs fails
([#44921](open-telemetry/opentelemetry-collector-contrib#44921))
The getScrapeConfigsResponse function did not close resp.Body on error
paths. If io.ReadAll or yaml.Unmarshal failed, the response body would
leak, potentially causing HTTP connection exhaustion.
- [**BUG FIX**] `receiver/prometheus`: Fixes yaml marshaling of
prometheus/common/config.Secret types

([#44445](open-telemetry/opentelemetry-collector-contrib#44445))
### v0.141.0
- [**FEATURE**] `receiver/prometheus`: Add feature gate for extra scrape
metrics in Prometheus receiver

([#44181](open-telemetry/opentelemetry-collector-contrib#44181))
deprecation of extra scrape metrics in Prometheus receiver will be
removed eventually.
- [**FEATURE**] `receiver/prometheus`: Support JWT Profile for
Authorization Grant (RFC 7523 3.1)

([#44381](open-telemetry/opentelemetry-collector-contrib#44381))
### v0.140.0
- [**BREAKING**] `receiver/prometheus`: The prometheus receiver no
longer adjusts the start time of metrics by default.
([#43656](open-telemetry/opentelemetry-collector-contrib#43656))
Disable the receiver.prometheusreceiver.RemoveStartTimeAdjustment |
feature gate to temporarily re-enable this functionality. Users that
need | this functionality should migrate to the metricstarttime
processor, | and use the true_reset strategy for equivalent behavior.
- [**FEATURE**] `receiver/prometheusremotewrite`: Skip emitting empty
metrics.

([#44149](open-telemetry/opentelemetry-collector-contrib#44149))
- [**FEATURE**] `receiver/prometheusremotewrite`: prometheusremotewrite
receiver now accepts metric type unspcified histograms.
([#41840](open-telemetry/opentelemetry-collector-contrib#41840))
### v0.139.0
- [**BUG FIX**] `receiver/prometheus`: Fix missing staleness tracking
leading to missing no recorded value data points.

([#43893](open-telemetry/opentelemetry-collector-contrib#43893))
- [**BUG FIX**] `receiver/prometheusremotewrite`: Fixed a concurrency
bug in the Prometheus remote write receiver where concurrent requests
with identical job/instance labels would return empty responses after
the first successful request.

([#42159](open-telemetry/opentelemetry-collector-contrib#42159))
### v0.138.0
- [**FEATURE**] `receiver/prometheus`: added NHCB(native histogram wit
custom buckets) to explicit histogram conversion

([#41131](open-telemetry/opentelemetry-collector-contrib#41131))

## Summary

| Category | Count |
|----------|-------|
| Breaking Changes | 4 |
| Features | 6 |
| Bug Fixes | 4 |
| Other Changes | 1 |
| **Total** | **15** |

# Target-allocator Changes
## v0.136.0 to v0.142.0

Generated on: 2026-01-11 07:07:05

---

### 0.142.0
- [**FEATURE**] `target allocator`: Add support for prometheus scrape
classes

([#3600](open-telemetry/opentelemetry-operator#3600))
Added support for configuring `scrapeClasses` when using the
PrometheusCR-feature of the target allocator. The format of the
`scrapeClasses` array is exactly as same as `spec.scrapeClasses` of the
`Prometheus` CRD.
- [**BUG FIX**] `target allocator`: Fix CA certificate race condition
with client cert renewals by extending its duration and and renewal
attempt.

([#4441](open-telemetry/opentelemetry-operator#4441))
The CA certificate now has a 2-year duration (instead of the default 90
days) to prevent race conditions where client and server certificates
could be signed by different CA versions during simultaneous renewal.
This ensures the CA remains stable while dependent certificates renew
regularly.
### 0.141.0
- [**FEATURE**] `target allocator`: make evaluation_interval
configurable for Prometheus CR watcher

([#4520](open-telemetry/opentelemetry-operator#4520))
### 0.140.0
- [**BUG FIX**] `github action`: Remove unused VERSION and VERSION_DATE
environment variables from publish workflows

([#4470](open-telemetry/opentelemetry-operator#4470))
Removed the unused "Read version" step that set VERSION and VERSION_DATE
environment variables in both publish-target-allocator.yaml and
publish-operator-opamp-bridge.yaml workflows. These variables were never
referenced anywhere in the workflows.
### 0.138.0
- [**BREAKING**] `target allocator`: Remove the
operator.collector.targetallocatorcr feature flag

([#2422](open-telemetry/opentelemetry-operator#2422))
This behavior has been enabled by default since version 0.127.0.
- [**BUG FIX**] `target allocator`: Add missing TA ownership watches to
cert-manager Certificate and Issuer

([#4368](open-telemetry/opentelemetry-operator#4368))
### 0.137.0
- [**BREAKING**] `target allocator`: Promote the
operator.collector.targetallocatorcr feature flag to Stable
([#2422](open-telemetry/opentelemetry-operator#2422))
The flag can no longer be disabled. It will be completely removed in
0.138.0.
- [**BUG FIX**] `target allocator, opamp`: Fix version not being updated
after version upgrade.

([#4378](open-telemetry/opentelemetry-operator#4378))
- [**BUG FIX**] `target-allocator`: Fixed potential duplicate scrape
targets caused by Prometheus relabeling.

([#3617](open-telemetry/opentelemetry-operator#3617))

## Summary

| Category | Count |
|----------|-------|
| Breaking Changes | 2 |
| Features | 2 |
| Bug Fixes | 5 |
| Other Changes | 0 |
| **Total** | **9** |

---------


[comment]: # (Note that your PR title should follow the conventional
commit format: https://conventionalcommits.org/en/v1.0.0/#summary)
# PR Description

[comment]: # (The below checklist is for PRs adding new features. If a
box is not checked, add a reason why it's not needed.)
# New Feature Checklist

- [ ] List telemetry added about the feature.
- [ ] Link to the one-pager about the feature.
- [ ] List any tasks necessary for release (3P docs, AKS RP chart
changes, etc.) after merging the PR.
- [ ] Attach results of scale and perf testing.

[comment]: # (The below checklist is for code changes. Not all boxes
necessarily need to be checked. Build, doc, and template changes do not
need to fill out the checklist.)
# Tests Checklist

- [ ] Have end-to-end Ginkgo tests been run on your cluster and passed?
To bootstrap your cluster to run the tests, follow [these
instructions](/otelcollector/test/README.md#bootstrap-a-dev-cluster-to-run-ginkgo-tests).
  - Labels used when running the tests on your cluster:
    - [ ] `operator`
    - [ ] `windows`
    - [ ] `arm64`
    - [ ] `arc-extension`
    - [ ] `fips`
- [ ] Have new tests been added? For features, have tests been added for
this feature? For fixes, is there a test that could have caught this
issue and could validate that the fix works?
  - [ ] Is a new scrape job needed?
- [ ] The scrape job was added to the folder
[test-cluster-yamls](/otelcollector/test/test-cluster-yamls/) in the
correct configmap or as a CR.
  - [ ] Was a new test label added?
- [ ] A string constant for the label was added to
[constants.go](/otelcollector/test/utils/constants.go).
- [ ] The label and description was added to the [test
README](/otelcollector/test/README.md).
- [ ] The label was added to this [PR
checklist](/.github/pull_request_template).
- [ ] The label was added as needed to
[testkube-test-crs.yaml](/otelcollector/test/testkube/testkube-test-crs.yaml).
  - [ ] Are additional API server permissions needed for the new tests?
- [ ] These permissions have been added to
[api-server-permissions.yaml](/otelcollector/test/testkube/api-server-permissions.yaml).
  - [ ] Was a new test suite (a new folder under `/tests`) added?
- [ ] The new test suite is included in
[testkube-test-crs.yaml](/otelcollector/test/testkube/testkube-test-crs.yaml).

Co-authored-by: azure-monitor-assistant[bot] <217255729+azure-monitor-assistant[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rashmi Chandrashekar <rashmy@microsoft.com>
sky333999 added a commit to amazon-contributing/opentelemetry-collector-contrib that referenced this pull request Jun 7, 2026
…metheus

Two upstream changes between the previous baseline (prometheus
v0.300.1) and v0.150's pin (prometheus v0.311.2) require
adjustments to the fork's programmatic ScrapeConfig construction
and the EndToEnd tests that exercise it.

1. Reload() YAML round-trip is stricter. Upstream contrib added a
   Reload() call inside newPrometheusReceiver() that round-trips
   the receiver's ScrapeConfig through YAML on startup
   (Prometheus open-telemetry#16429 raised the prometheus-side strictness).
   Programmatic ScrapeConfigs that round-trip through YAML must
   conform to two shape requirements they did not previously need:

   - kubernetes.SDConfig with zero-value HTTPClientConfig fails
     validation because FollowRedirects:false / EnableHTTP2:false
     differ from DefaultHTTPClientConfig, triggering "to use custom
     HTTP client configuration please provide the api_server URL
     explicitly". Set HTTPClientConfig: configutil.DefaultHTTPClientConfig
     on all such structs (DCGM, Neuron, NVMe EBS, NVMe LIS, Kueue).
     Effective behavior is unchanged: the SDK applied the same
     defaults internally for non-programmatic configs.

   - *discovery.StaticConfig (pointer) fails marshaling because the
     Prometheus discovery registry handles StaticConfig as a value
     type, not a pointer. The type assertion c.(StaticConfig) fails
     for *StaticConfig, producing "cannot marshal unregistered
     Config type: *discovery.StaticConfig". Use discovery.StaticConfig{}
     (value) instead. StaticConfig is a slice type so the & was
     unnecessary. Applied to production scrapers and matching test
     fixtures.

2. Per-series staleness emission is now keyed by appender SeriesRef
   rather than labels-hash (Prometheus PR open-telemetry#17411 + contrib fixes
   open-telemetry#43925/open-telemetry#46589 that returned stable refs from Append/AppendHistogram).
   This shifts the timing of failed-scrape commit such that on the
   mock prometheus's deliberate 200 -> 404 sequence, the 404 commit
   now lands inside the test window. Consumers therefore receive a
   second batch carrying up=0 plus per-series staleness markers
   (NumberDataPointValueTypeEmpty), which trips per-call value
   assertions in the EndToEnd tests.

   This is intended upstream behavior. Production consumers in CWA
   handle it correctly: prometheusremotewriteexporter converts
   NoRecordedValue to StaleNaN for AMP; awsemfexporter drops stale
   datapoints (grouped_metric.go, datapoint.go); the telegraf
   prometheus input opts out by returning ref=0 from Append.

   Update mockConsumers to skip failed-or-stale follow-up batches
   via a content-based check (up=0 or all-stale-markers). Keep the
   check in a single shared helper IsFailedOrStaleScrape on
   awscontainerinsightreceiver/internal/prometheusscraper/, with a
   small duplicate in the awscontainerinsightskueuereceiver test to
   avoid a cross-module dependency. The dcgm test already used
   assert.Eventually(consumerCalled, ...) which short-circuits on
   first success; no change there.

Touches receiver/awscontainerinsightreceiver and
receiver/awscontainerinsightskueuereceiver.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg/translator/prometheus Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants