-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Spike] sdk/log: Add Logger.Enabled and EnabledParameters #5816
base: main
Are you sure you want to change the base?
Conversation
… interfaced type (open-telemetry#5692)" This reverts commit 002c0a4.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5816 +/- ##
=======================================
- Coverage 84.5% 84.4% -0.1%
=======================================
Files 272 272
Lines 22776 22803 +27
=======================================
+ Hits 19255 19260 +5
- Misses 3178 3199 +21
- Partials 343 344 +1 |
It seems like this was the main motivation to make this change. I do not think it is a good one. It is not adding any value, it is only adding another layer of translation. I do not think we should make this change. |
|
There is no justification provided to motivate this. It is computing these values and making the translation without having any evidence that is is desired. Our only use-case right now is the |
This indicates the API is not appropriately designed if this is desired. Should it be structured similar to the |
I pretty sure that there are going to be users that would want to filter out logs by logger name (instrumentatoon scope name). I will do a PR in the spec on Monday to validate my opinion with others. |
This mechanism is already defined in the specification: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#loggerconfig I don't anticipate adding a second way to configure this is going to be desired there, but that is just my opinion. |
Alternate design proposal: #5820 |
Upon reflection, this alternate design proposal is not needed. The existing API passes There is no need to add another type to introduce immutability given this is already the case. |
Gotcha. I feel that it is better to start with a smaller set of parameters. Of course this may change in future.
Having a separate type in SDK gives the flexibility to decouple the However, indeed it is better to discuss the specification before making further changes in the SDK to not go back and forth with the implementation. For now, the experimental design is usable. @MrAlias, thanks for your feedback and research 🙏 Let me know if my plan to make a proposal in the spec first is a good idea. |
Fixes #5810
Remarks
Initially, I thought about keeping the feature
go.opentelemetry.io/otel/sdk/log/internal/x
.However, I started to think if we should bring it back
go.opentelemetry.io/otel/sdk
as:Enabled
for all processors forces them to think how it should be handled (main reason). I feel that it is also more aligned with other interfaces in the SDK where usually we ask users to implement all possible methods.EnabledParameters
would have to be defined ingo.opentelemetry.io/otel/sdk/log/internal/x
. Making it stable (moving toEnabledParameters
would be a breaking change for people using the experimental feature which may be frustrating for them.I am open to other suggestions.