Skip to content
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

[WIP] slog handler #5195

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6ca9499
[WIP] Initial slog handler
MrAlias Mar 1, 2024
5c87e5c
Add benchmarks
MrAlias Mar 2, 2024
a1ef4ba
Fix BenchmarkHandler
MrAlias Mar 5, 2024
e7cf39d
Use noop LoggerProvider in bench
MrAlias Mar 6, 2024
bcbc27b
Flatten convertLevel
MrAlias Mar 6, 2024
78152cc
Update bench of Handle only using WithGroup.WithAttrs
MrAlias Mar 7, 2024
582b806
Zero alloc Handle when holding attr and group
MrAlias Mar 7, 2024
b6d70f6
Add the kvBuffer type
MrAlias Mar 8, 2024
2dca61f
Add kvBuffer KeyValue and flatten convertAttr
MrAlias Mar 11, 2024
7dbf476
Remove TODO
MrAlias Mar 11, 2024
c84abb5
Simplify testing loggerProvider
MrAlias Mar 11, 2024
3a7c1db
Copy slogtest testing harness and expand
MrAlias Mar 11, 2024
b9f412a
Add test for value conversion
MrAlias Mar 11, 2024
c5767c6
Remove unused code from group.KeyValue
MrAlias Mar 11, 2024
4494e44
Remove unneeded kvBuffer.Clone
MrAlias Mar 11, 2024
6af7f4b
Remove empty check from WithAttrs and WithGroup
MrAlias Mar 11, 2024
abd29c2
Ensure isolation of WithAttr
MrAlias Mar 11, 2024
be01506
Run slogtest.TestHandler instead of copying
MrAlias Mar 11, 2024
fa6eefd
Remove value2Str
MrAlias Mar 11, 2024
0c5ce80
Comment source of code copied from slogtest.
MrAlias Mar 11, 2024
6340c3c
Comment code
MrAlias Mar 11, 2024
2b77982
Fix lint
MrAlias Mar 11, 2024
cebb87f
Expand group comment
MrAlias Mar 11, 2024
2e13353
Add concurrency test
MrAlias Mar 12, 2024
9ce4320
Return string attr for unrecognized kind
MrAlias Mar 12, 2024
08e1bfd
Document nil lp to New
MrAlias Mar 12, 2024
3084e0d
Use default noop for nil in New within tests
MrAlias Mar 12, 2024
5652789
Add link to inspiration for buffer size limit
MrAlias Mar 12, 2024
20f6c0e
Update bridges/sloghandler/handler_test.go
MrAlias Mar 12, 2024
40b9b00
Use pkg name from source as scope by default
MrAlias Mar 12, 2024
4bc7625
Accept a Logger instead of a LoggerProvider
MrAlias Mar 14, 2024
6b4c3c3
Apply feedback: accept a LoggerProvider
MrAlias Mar 14, 2024
5fe15aa
Add Version func
MrAlias Mar 14, 2024
20ce015
Merge branch 'main' into sloghandler
MrAlias Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ updates:
schedule:
interval: weekly
day: sunday
- package-ecosystem: gomod
directory: /bridges/sloghandler
labels:
- dependencies
- go
- Skip Changelog
schedule:
interval: weekly
day: sunday
- package-ecosystem: gomod
directory: /config
labels:
Expand Down
20 changes: 20 additions & 0 deletions bridges/sloghandler/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module go.opentelemetry.io/contrib/bridges/sloghandler

go 1.21

require (
github.com/stretchr/testify v1.8.4
go.opentelemetry.io/otel/log v0.0.1-alpha
go.opentelemetry.io/otel/sdk v1.24.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
27 changes: 27 additions & 0 deletions bridges/sloghandler/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
go.opentelemetry.io/otel/log v0.0.1-alpha h1:Gy4SxFnkHv2wmmzv//sblb4/PoCYVtuZbdFY/XamvHM=
go.opentelemetry.io/otel/log v0.0.1-alpha/go.mod h1:fg1zxLfxAyzlCLyULJTWXUbFVYyOwQZD/DgtGm7VvgA=
go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading
Loading