Skip to content

Conversation

@JorTurFer
Copy link
Contributor

@JorTurFer JorTurFer commented Nov 18, 2025

Description

Prometheus common pkg supports JWT Profile for Oauth (RFC7523 3.1) since latest version (v0.67.3). This PR bumps the dependency and also update the custom yaml parser to handle that now there are more than 1 commonconfig.Secret and one or more it can be empty.

Testing

I've tested this using the kong integration test, just updating the file with the values required to invoke the new code from prometheus common pkg and checked that I can get a valid token from the oauth server that requires this grant-type

image image

I don't know if this requires some extra test (maybe some unit/integration) as this really comes as feature of prometheus dep and it's already tested there

@JorTurFer JorTurFer requested review from a team, ArthurSens and dashpole as code owners November 18, 2025 22:08
@github-actions github-actions bot added the first-time contributor PRs made by new contributors label Nov 18, 2025
@github-actions
Copy link
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!

@github-actions github-actions bot added the receiver/prometheus Prometheus receiver label Nov 18, 2025
@JorTurFer JorTurFer changed the title chore: bump prometheus common dep to support RFC7523 3.1 [chore]: bump prometheus common dep to support RFC7523 3.1 Nov 18, 2025
@JorTurFer
Copy link
Contributor Author

Tomorrow I'll check the unit tests to solve them. I think that after latest changes testing I have broken them

@JorTurFer
Copy link
Contributor Author

Could you trigger again tests please? I've found the issue and I've fixed it. Current config.Secret values can be empty but the marshaler required them. When it tried to unmashal the value for client_secret, it was perfectly able before the dep upgrade because oauth2.client_secret was the only secret inside that section, as now there is another secret, we have to allow empty values or the process fails.

Instead of allowing *config.Secret (my first option) as custom marshaler config, we just need to omit empty values (changing the custom marshaller breaks the "magic" to not corrupt the value with <secret>)

@JorTurFer JorTurFer marked this pull request as draft November 20, 2025 06:59
@JorTurFer
Copy link
Contributor Author

I've found that there is a problem with the omit empty for common.Secret types, I'm working on it and I'll mark PR ready for review again when it's ready

@JorTurFer JorTurFer force-pushed the bump-prometheus branch 2 times, most recently from e213bfe to 5f8e057 Compare November 21, 2025 17:16
@JorTurFer JorTurFer marked this pull request as ready for review November 21, 2025 17:17
@JorTurFer
Copy link
Contributor Author

JorTurFer commented Nov 21, 2025

This automated PR updated the pkg to 0.67.3 which technically adds the support, but the version 0.67.3 didn't work for otel collector because a marshal problem that happened with common.Secret type.
common v0.67.4 solves the problem and I have added a test to verify the marshal to ensure that it works, PTAL

Does it make sense to create a changelog record to notify that this support has been added as as enhancement? This comes just from bumping deps but maybe it's relevant for someone

@ArthurSens
Copy link
Member

Thanks! I wouldn't call this "chore" though, since it adds a feature. Could you add a changelog entry?

@JorTurFer
Copy link
Contributor Author

Thanks! I wouldn't call this "chore" though, since it adds a feature. Could you add a changelog entry?

Sure, I'm going to review the CI and add the changelog. Thanks!

@JorTurFer
Copy link
Contributor Author

JorTurFer commented Nov 24, 2025

I get errors about pending go mod tidy in multiple places that I've not touched. I guess that it's because there is something ensuring the same version in all the components. Is it expected that I update all at once?

Reading https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md I have it clear now, sorry because I should have read it before :(

Signed-off-by: Jorge Turrado <[email protected]>
@JorTurFer JorTurFer requested a review from atoulme as a code owner November 24, 2025 13:35
@JorTurFer
Copy link
Contributor Author

@ArthurSens could you trigger again the CI?

@JorTurFer
Copy link
Contributor Author

lol, when I've consolidated dependencies make gotidyit has added so many people as reviewers, sorry 😢

Copy link
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.

LGTM!

No worries about pinging several people, the codebase of this repository is organized like this and bumping a widely used dependency will always ping this many people 😅

@ArthurSens ArthurSens added the ready to merge Code review completed; ready to merge by maintainers label Nov 24, 2025
@mx-psi mx-psi merged commit e413613 into open-telemetry:main Nov 24, 2025
205 checks passed
@github-actions github-actions bot added this to the next release milestone Nov 24, 2025
@otelbot
Copy link
Contributor

otelbot bot commented Nov 24, 2025

Thank you for your contribution @JorTurFer! 🎉 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.

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.

5 participants