-
Notifications
You must be signed in to change notification settings - Fork 588
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
Logging bridge for Zap #5279
Logging bridge for Zap #5279
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5279 +/- ##
=======================================
- Coverage 62.3% 62.1% -0.3%
=======================================
Files 189 190 +1
Lines 11575 11673 +98
=======================================
+ Hits 7221 7256 +35
- Misses 4145 4205 +60
- Partials 209 212 +3
|
Add catalog-info.yaml config file
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.
Good start
This module will need to be added to the project |
Part of open-telemetry#5191 and open-telemetry#5586 Pre-work open-telemetry#5279 --------- Co-authored-by: Tyler Yahn <[email protected]>
Part of #5191 Pre-work #5279 This PR implements `uInt` methods `objectEncoder` --------- Co-authored-by: Robert Pająk <[email protected]>
Part of open-telemetry#5191 Pre-work open-telemetry#5279 This PR implements `uInt` methods `objectEncoder` --------- Co-authored-by: Robert Pająk <[email protected]>
Part of open-telemetry#5191 Pre-work open-telemetry#5279 This PR adds skeleton for arrayEncoder
Part of #5191 Pre-work #5279 This PR partially implements `Write` method Co-authored-by: Robert Pająk <[email protected]>
Part of #5191 Pre-work #5279 --------- Co-authored-by: Tyler Yahn <[email protected]>
Part of #5191 Pre-work #5279 This PR implements `With` method --------- Co-authored-by: Robert Pająk <[email protected]>
Part of #5191 Pre-work #5279 --------- Co-authored-by: Robert Pająk <[email protected]>
Part of #5191 Pre-work #5279 --------- Co-authored-by: Robert Pająk <[email protected]>
Part of #5191 Pre-work #5279 The approach is to use linked list to open a namespace and keep track of it. `calculate` method iterates to the most nested namespace and appends data in reverse order. --------- Co-authored-by: Robert Pająk <[email protected]>
Part of #5191 Pre-work #5279 ``` goos: linux goarch: amd64 pkg: go.opentelemetry.io/contrib/bridges/otelzap cpu: 12th Gen Intel(R) Core(TM) i5-1245U BenchmarkCoreWrite/10_fields-12 1000000 1116 ns/op 978 B/op 13 allocs/op BenchmarkCoreWrite/20_fields-12 407290 2615 ns/op 2180 B/op 22 allocs/op BenchmarkCoreWrite/Namespace-12 725268 1671 ns/op 1760 B/op 16 allocs/op BenchmarkCoreWrite/With10_fields-12 4964038 260.2 ns/op 208 B/op 1 allocs/op BenchmarkCoreWrite/With20_fields-12 2004085 628.7 ns/op 640 B/op 1 allocs/op BenchmarkCoreWrite/WithNamespace-12 100000000 16.95 ns/op 0 B/op 0 allocs/op PASS ok go.opentelemetry.io/contrib/bridges/otelzap 8.619s ``` --------- Co-authored-by: Robert Pająk <[email protected]>
Part of #5191 Pre-work #5279 --------- Co-authored-by: Robert Pająk <[email protected]>
Part of #5191
Some Notes:
Basic Structure - Zapcore implements
-
Check
- determines whether the supplied Entry should be logged-
Write
-
Enabled
-
Sync
- we don't use buffer to write - so no code here-
With
- returns a child core with provided contextThis also implements
zapcore.ObjectEncoder
andzapcore.ArrayEncoder
which decides how we would encode provided fields to log attrs - (the user can also pass their custom encoder)Some Notes about type mapping:
AddReflected
method which converts the field to JSON