Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/prometheus] Add fallback_scrape_protocol during config validation #38018

Conversation

ArthurSens
Copy link
Member

@ArthurSens ArthurSens commented Feb 18, 2025

Description

During the release process, we noticed a breaking change in the Prometheus receiver caused by #36873.

In that PR, I tried adding a fallback scrape protocol by default everytime the PrometheusReceiver was built, but it turned out that config validation happened even before the component was created. And the collector fails startup with invalid configuration

This PR moves the addition of scrape protocol to the validation step.

Link to tracking issue

Fixes #37902

Testing

Documentation

@ArthurSens ArthurSens requested review from dashpole, a team, mx-psi and songy23 as code owners February 18, 2025 14:28
// to avoid introducing a breaking change.
for _, sc := range scrapeConfigs {
if sc.ScrapeFallbackProtocol == "" {
sc.ScrapeFallbackProtocol = promconfig.PrometheusText0_0_4
Copy link
Member Author

Choose a reason for hiding this comment

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

I've also noticed that my choice of default scrape protocol was wrong 🤦 The previous default is Prometheus 0.0.4

@jpkrohling jpkrohling added the release:blocker The issue must be resolved before cutting the next release label Feb 18, 2025
@dashpole
Copy link
Contributor

nice. we can also revert your change to prometheus/common after this, right?

@ArthurSens
Copy link
Member Author

nice. we can also revert your change to prometheus/common after this, right?

yes!

@jpkrohling
Copy link
Member

Given that this bug has made into a release (not a binary release though), I think this deserves its own changelog entry.

@mx-psi
Copy link
Member

mx-psi commented Feb 18, 2025

Please make sure we follow https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/release.md#bugfix-release-procedure if we are doing a bugfix release for this!

Signed-off-by: Arthur Silva Sens <[email protected]>
(cherry picked from commit 8cac6a9)
Signed-off-by: Arthur Silva Sens <[email protected]>
(cherry picked from commit c404a88)
Signed-off-by: Arthur Silva Sens <[email protected]>
(cherry picked from commit 6f00b38)
@ArthurSens ArthurSens force-pushed the prom-defaultfallbackprotocol branch from 6f00b38 to a199703 Compare February 18, 2025 16:57
@ArthurSens ArthurSens changed the base branch from main to release/0.120.x February 18, 2025 16:57
@ArthurSens
Copy link
Member Author

ArthurSens commented Feb 18, 2025

Please make sure we follow https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/release.md#bugfix-release-procedure if we are doing a bugfix release for this!

Thanks for pointing that out. Base branch changed and commits rebased

@songy23
Copy link
Member

songy23 commented Feb 18, 2025

I think we want this PR to be merged to mainline first, then do a cherry-pick to the release branch, no?

@ArthurSens
Copy link
Member Author

From the documented process, I understood that we create a PR to the release branch as the first step. Third step is to merge the release branch back to main 🤔

@songy23
Copy link
Member

songy23 commented Feb 18, 2025

Got it, now I remember - thanks for the pointers

@songy23 songy23 requested a review from jpkrohling February 18, 2025 18:07
@jpkrohling jpkrohling merged commit 259c3a2 into open-telemetry:release/0.120.x Feb 19, 2025
162 of 163 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 19, 2025
ArthurSens added a commit to ArthurSens/opentelemetry-collector-contrib that referenced this pull request Feb 20, 2025
…dation (open-telemetry#38018)

During the release process, we noticed a breaking change in the
Prometheus receiver caused by
open-telemetry#36873.

In that PR, I tried adding a fallback scrape protocol by default
everytime the PrometheusReceiver was built, but it turned out that
config validation happened even before the component was created. And
the collector fails startup with invalid configuration

This PR moves the addition of scrape protocol to the validation step.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
Fixes open-telemetry#37902

<!--Describe what testing was performed and which tests were added.-->

<!--Describe the documentation added.-->

<!--Please delete paragraphs that you did not use before submitting.-->
@ArthurSens ArthurSens deleted the prom-defaultfallbackprotocol branch February 25, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/datadog Datadog components receiver/prometheus Prometheus receiver release:blocker The issue must be resolved before cutting the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[receiver/prometheus] Investigate if we can relax usage of fallback_scrape_protocol
5 participants