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

Update prometheus to v0.50.1 and remove enable_protobuf_negotiation #30934

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

dashpole
Copy link
Contributor

@dashpole dashpole commented Jan 31, 2024

Fixes #30883

Prometheus PR we need to adapt to: prometheus/prometheus#12738
The configuration option we were using to enable protobuf has been removed, so this PR removes the enable_protobuf_negotiation configuration on the prometheus receiver. In its place, the prometheus server now has a config option, scrape_protocols, which specifies which protocols it uses, including protobuf. Use config.global.scrape_protocols = [ PrometheusProto, OpenMetricsText1.0.0, OpenMetricsText0.0.1, PrometheusText0.0.4 ] to enable protobuf scraping instead of using our option.

Prometheus PR we need to adapt to: prometheus/prometheus#12958
We now need to pass a prometheus.Registerer to the scrape manager to collect metrics about scrapes. This PR disables the collection of these scrape metrics from the prometheus server. We did not use the default registry, so we were previously collecting these metrics and never exposing them. This PR passes a no-op registerer to prevent using memory to store those metrics. In the future, we can consider using the prometheus -> OTel bridge to export these with the self-observability pipeline.

tomasmota pushed a commit to tomasmota/opentelemetry-collector that referenced this pull request Mar 14, 2024
Long story, but i'm working on updating the prometheus dependency:
open-telemetry/opentelemetry-collector-contrib#30934

As part of that update, we need to adapt to a change that makes the
prometheus servers' self-observability metrics independent. See
prometheus/prometheus#13507 and
prometheus/prometheus#13610

One way to adapt to this change is by adding a label to each receivers'
metrics to differentiate one Prometheus receiver from another. I've
tried taking that approach in
open-telemetry/opentelemetry-collector-contrib#30934,
but the current issue is that the NoOp components all have the same
name, which causes the self-observability metrics to collide.

I can work around this in the prometheus receiver's own tests, but I
can't work around the issue in the `generated_component_test.go` tests,
since those are generated.

This PR makes the ID returned by `NewNopCreateSettings` unique by giving
it a unique name.

**Link to tracking Issue:**

Part of
open-telemetry/opentelemetry-collector-contrib#30883

cc @Aneurysm9

---------

Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
@dashpole dashpole force-pushed the update_prometheus branch 2 times, most recently from bfec640 to a5be091 Compare March 18, 2024 16:47
@dashpole dashpole marked this pull request as ready for review March 18, 2024 17:32
@dashpole
Copy link
Contributor Author

@Aneurysm9 I think this is finally ready

@dmitryax
Copy link
Member

@dashpole please rebase

@dashpole dashpole changed the title Update prometheus to v0.50.0 and remove enable_protobuf_negotiation Update prometheus to v0.50.1 and remove enable_protobuf_negotiation Mar 22, 2024
@dashpole dashpole force-pushed the update_prometheus branch 2 times, most recently from 7bb9797 to 568d301 Compare March 22, 2024 20:41
@dashpole
Copy link
Contributor Author

@dmitryax rebased

@dmitryax
Copy link
Member

@dashpole looks like, make gotidy is still needed

@dashpole dashpole force-pushed the update_prometheus branch from 568d301 to 366d46a Compare March 23, 2024 00:00
@dashpole
Copy link
Contributor Author

make gotidy didn't do anything. make genotelcontribcol seems to have made some changes.

@dashpole
Copy link
Contributor Author

@dmitryax passing now

@dashpole dashpole added ready to merge Code review completed; ready to merge by maintainers and removed ready to merge Code review completed; ready to merge by maintainers labels Mar 25, 2024
@dashpole dashpole force-pushed the update_prometheus branch from f6254ce to 1a83876 Compare March 25, 2024 18:51
@dashpole dashpole added the ready to merge Code review completed; ready to merge by maintainers label Mar 25, 2024
@dmitryax dmitryax merged commit d64038b into open-telemetry:main Mar 25, 2024
147 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 25, 2024
ptodev added a commit to grafana/opentelemetry-collector-contrib that referenced this pull request Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[receiver/prometheus] update github.com/prometheus/prometheus to v0.49.1 breaks build
5 participants