[Prototype] log: Events support literally following spec#6017
Closed
pellared wants to merge 7 commits intoopen-telemetry:mainfrom
Closed
[Prototype] log: Events support literally following spec#6017pellared wants to merge 7 commits intoopen-telemetry:mainfrom
pellared wants to merge 7 commits intoopen-telemetry:mainfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6017 +/- ##
=======================================
- Coverage 82.1% 81.9% -0.3%
=======================================
Files 273 274 +1
Lines 23643 23756 +113
=======================================
+ Hits 19431 19475 +44
- Misses 3867 3936 +69
Partials 345 345 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This prototype is doing everything to be compliant with https://github.com/open-telemetry/opentelemetry-specification/blob/50027a1036746dce293ee0a8592639f131fc1fb8/specification/logs/api.md#emit-an-event.
It adds
EmitEventandEnabledEventmethods toLoggerinterface.These changes are BREAKING from Go stability perspective. Adding methods to interfaces is defined as not backwards-compatible. See: https://go.dev/doc/go1compat. Even though that we have comments saying that it can happen, we know that our users are unhappy each time it occurs.
It requires a lot of code while it still misses a lot of tests, benchmarks, docs etc.
Doing everything would required more than 1k LOC. Probably it would be around 2k LOC.
Basically it makes a new API surface and requires a lot of boilerplate.
It also adds complexity to
logtest.For me, adding more methods to
Loggeris a design smell. Interfaces should consist of minimal API surface necessary to do the job.Moreover, the experimental
FilterProcessoris not able to access event name for sake of filtering in itsEnabledmethod. Should theFilterProcessoracceptEnabledEventParametersinstead? This would feel wrong.There is nothing in the design which forces instrumentation devs to use
EmitEventoverEmit(orEnabledEventoverEnabled). There are only comments.See second prototype: #6018.