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

Add logr log bridge #5192

Closed
2 of 5 tasks
pellared opened this issue Mar 1, 2024 · 4 comments · Fixed by #6386
Closed
2 of 5 tasks

Add logr log bridge #5192

pellared opened this issue Mar 1, 2024 · 4 comments · Fixed by #6386
Assignees
Labels
bridge: logr Related to the logr bridge enhancement New feature or request
Milestone

Comments

@pellared
Copy link
Member

pellared commented Mar 1, 2024

Add logr.LogSink log bridge.

Prototype implementation: https://github.com/pellared/opentelemetry-go/blob/147762ffb5c4394417b3f973274cc570723db79b/log/internal/logr.go

TODO:

@scorpionknifes
Copy link
Member

Keen to pick this one up

@pellared
Copy link
Member Author

pellared commented Apr 3, 2024

@pellared
Copy link
Member Author

@scorpionknifes, I added "TODO" steps to the issue description

pellared added a commit that referenced this issue Sep 12, 2024
This PR is the skeleton for otellogr package, which provides a LogSink
to bridge the logging capabilities for Logr with OpenTelemetry

Part of #5192

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
pellared pushed a commit that referenced this issue Sep 24, 2024
This PR implements a few methods for otellogr package
- Info
- WithName
- WithValues

Out of scope
- Enabled
- Init
- Error
- Level

Part of
#5192
@pellared pellared added the bridge: logr Related to the logr bridge label Oct 3, 2024
pellared added a commit that referenced this issue Oct 28, 2024
This PR implements a few methods for otellogr package
- Configurable LevelSeverity
- Enabled

Part of
#5192

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
dmathieu added a commit that referenced this issue Nov 14, 2024
Implements remaining methods and adds to the changelog

Part of
#5192

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
pellared pushed a commit that referenced this issue Nov 26, 2024
Add benchmarks (similar to otelslog)
Part of
#5192

Benchmark results:
```
goos: linux
goarch: amd64
pkg: go.opentelemetry.io/contrib/bridges/otellogr
cpu: Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
BenchmarkLogSink/Info-16                 6114177               186.4 ns/op           160 B/op          1 allocs/op
BenchmarkLogSink/Error-16                6649935               245.2 ns/op           160 B/op          1 allocs/op
BenchmarkLogSink/WithValues-16           3949730               295.6 ns/op           448 B/op          3 allocs/op
BenchmarkLogSink/WithName-16             6813362               172.0 ns/op           133 B/op          2 allocs/op
BenchmarkLogSink/WithName.WithValues-16                  2420191               606.4 ns/op           581 B/op          5 allocs/op
BenchmarkLogSink/(WithName.WithValues).Info-16          12601381                97.32 ns/op            0 B/op          0 allocs/op
PASS
ok      go.opentelemetry.io/contrib/bridges/otellogr    24.125s
```
@pellared
Copy link
Member Author

pellared commented Nov 26, 2024

@scorpionknifes, I think that at the point we can add otellogr to published modules.

I find it safer to track #5357 (comment) as a separate issue. We can even postpone its resolution until we get community feedback if it actually needed.

@pellared pellared moved this from Ready to In progress in Go: Logs (Post-GA) Nov 26, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Go: Logs (Post-GA) Dec 2, 2024
@MrAlias MrAlias added this to the v1.33.0 milestone Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridge: logr Related to the logr bridge enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants