-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[confighttp, configgrpc] Replace host parameter by map of extensions #14190
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
[confighttp, configgrpc] Replace host parameter by map of extensions #14190
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (76.66%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #14190 +/- ##
==========================================
- Coverage 92.15% 92.09% -0.06%
==========================================
Files 667 667
Lines 41446 41453 +7
==========================================
- Hits 38194 38178 -16
- Misses 2215 2229 +14
- Partials 1037 1046 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This new error message should hopefully make it clearer to users that, rather than their authentication/middleware extension mysteriously not being found despite being configured, this is likely because a component took a shortcut and passed However, this relies on two assumptions:
|
That does not seem like a concern to me: if we want to add disabling middlewares as a use case later we can do it in a backwards compatible way if we start by returning an error now
I think that's fine, I feel like relying on that behavior seems like not something we should guarantee |
To be clear, the only implication that "supporting disabling middlewares/authentication" would have is in the wording of the error (instead of saying "it's a bug in the calling component" we would explain that "middlewares and authentication are not available in this component") |
Right, well that would also be backwards compatible (in general I would argue error -> is a backwards compatible change) |
|
I'm okay calling it a bug in the error message, as of right now there are no components that would want to intentionally disable middlewares. The only change I would suggest would be to encourage the user to report the bug, but I don't have any ideas right now that aren't overly wordy. |
Co-authored-by: Pablo Baeyens <[email protected]>
|
Based on the discussion in the maintainer meeting, I updated the
and the error message wording to:
|
CodSpeed Performance ReportMerging #14190 will not alter performanceComparing
|
73f090c
#### Description Follow up to open-telemetry/opentelemetry-collector#14190, which introduced an API breaking change: instead of passing a `host component.Host` to `configgrpc` and `confighttp`'s `ToClient` / `ToServer` methods, components should instead pass the result of `host.GetComponents()`. Tests that don't make use of authentication or middleware extensions, as well as custom component hosts which don't support extensions (such as the OpAMP supervisor), can simply pass nil instead of using a no-op host. Replacing `host` by `host.GetComponents()` is fairly straightforward, as long as you don't pass in a `nil` host, which unfortunately a lot of tests do, so I had to fix that as well. This will be merged into the update-otel PR at #44581.
Description
Alternative to #14162, where we make the map of extensions a mandatory positional parameter to replace
hostinstead of an option.Link to tracking issue
Fixes #13640
Testing
Existing tests make extensive use of the modified functions
Documentation
Added line in ToServer/ToClient(Conn) documentation describing the intended use of the extensions parameter.