-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[OTLPHTTP Exporter] OAuth2 Client Credentials Authorization support for Exporters using HTTP Clients #2464
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2464 +/- ##
==========================================
- Coverage 92.06% 91.68% -0.39%
==========================================
Files 313 313
Lines 15439 15344 -95
==========================================
- Hits 14214 14068 -146
- Misses 817 870 +53
+ Partials 408 406 -2
Continue to review full report at Codecov.
|
Note: I understand that we are chasing GA. But since OTLPHTTP exporter features is present in the roadmap, for the sake of feature completeness, I am putting up this PR. If it is bit late please let me know, happy to move the PR to draft and will resubmit it when it is a good time. 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have two places with related code:
- https://github.com/open-telemetry/opentelemetry-collector/tree/main/config/configauth
- https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configgrpc/bearer_token.go
This second seems to be closely related to this but won't perform token refreshes. They should really be made consistent among each other, either by having this here only taking care of sending the token that was previously configured, or by making that one to refresh tokens (and possibly use the same configuration as this here). The use case that the gRPC one covers is for Kubernetes deployments, where a token file is available locally in a file.
Thank you @jpkrohling. Agreed, let me refresh this PR after making the modules consistent. I will move I was only planning to add OAuth2 for HTTP Clients but will add for grpc too. Thanks for looking into this! |
Hi @jpkrohling couple of thoughts here.
So as I understand we are looking into two completely different ways for authorization.
This is the flow the PR is aiming to support and so IMHO there is a validity in both the flows and the support should be kept as it is. Kindly let me know if I have misunderstood your suggestion completely or assumed something wrong. Notes:
Thanks for the review |
Your assessment is correct, there's one aspect that is missing from the current bearer token auth though: I originally proposed reading the token from a file, like the ones Kubernetes injects into pods. When those tokens are changed, the collector would reload them. Reading values from files were deemed as a feature that the collector should support more generically, so, I removed this from the original PR. In that case, the OAuth dance would be done by an external process, and the current token to be used would be made ready to the collector. I'll take another look at your PR soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice! As a follow-up PR, we might want to create a doc somewhere with the auth information for both receivers and exporters.
Co-authored-by: Juraci Paixão Kröhling <juraci.github@kroehling.de>
Co-authored-by: Juraci Paixão Kröhling <juraci.github@kroehling.de>
Co-authored-by: Juraci Paixão Kröhling <juraci.github@kroehling.de>
Co-authored-by: Juraci Paixão Kröhling <juraci.github@kroehling.de>
Co-authored-by: Juraci Paixão Kröhling <juraci.github@kroehling.de>
Co-authored-by: Juraci Paixão Kröhling <juraci.github@kroehling.de>
Thanks for all the suggestions @jpkrohling - I will add the warnings suggestions and refresh the PR and will open issues to document the auth receivers and exporters |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
@jpkrohling Think the PR is auto closed despite it is a draft. Shall I reissue a fresh PR after #2603 - I do not know how to reopen this one :( |
@tigrannajaryan, @bogdandrutu please reopen this one, as this was closed despite being in draft mode. |
Github doesn't let me reopen, no idea why. |
It says that there is already an open PR from the same branch |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Hello @bogdandrutu @jpkrohling Is there any chance we could get this thing reviewed now that @jpkrohling's #2603 is almost done. This PR is sort of independent to the work going on there but still belongs to Auth bucket we are tracking - This PR is to expose OAuth2 configuration for clients (oltp http exporter) authentication to OAuth2 servers. This is different from 2603 which handles server (receiver) side Auth. I believe @gramidt is also looking for this something like this PR but on gRPC side #2500. If we can get this through in upcoming release, we can start messaging OT collector to our customers (internal and external) - Thank you! |
Should this follow the same pattern as the server-side mechanism, where the clients would determine what to do based on a config option and performed by an extension? |
…ations of STL may crash. (open-telemetry#2464)
Description:
Example
Link to tracking Issue:
#2785
Testing: : Added unit tests/functional tests.
Documentation: Added README for the config