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 zerolog log bridge #5405

Closed
scorpionknifes opened this issue Apr 20, 2024 · 5 comments · Fixed by #5930
Closed

Add zerolog log bridge #5405

scorpionknifes opened this issue Apr 20, 2024 · 5 comments · Fixed by #5930
Assignees
Labels
bridge: zerolog Related to the zerolog bridge enhancement New feature or request
Milestone

Comments

@scorpionknifes
Copy link
Member

Add zerolog.Hook log bridge.

Another pretty popular log library, keen to work on this if we keen on this suggestion

@scorpionknifes scorpionknifes added the enhancement New feature or request label Apr 20, 2024
@scorpionknifes scorpionknifes changed the title Add zerologr log bridge Add zerolog log bridge Apr 21, 2024
@AkhigbeEromo
Copy link
Contributor

Hello @scorpionknifes , Can i work on this?

@domino14
Copy link

How's the progress on this @AkhigbeEromo ? Did you decide to take this on?

@AkhigbeEromo
Copy link
Contributor

Yes I did @domino14
Currently still working on it
Waiting for more reviews so I can make changes

dmathieu added a commit that referenced this issue Jul 11, 2024
This PR introduces the `otelzerolog` package, which provides a
`SeverityHook` to bridge the logging capabilities of Zerolog with
OpenTelemetry. The following key features are included:

## Changes

- Added `config` struct to handle configuration options.
- Implemented `Option` interface and related functions (`WithVersion`,
`WithSchemaURL`, `WithLoggerProvider`).
- Created `NewSeverityHook` function to initialize a `SeverityHook`.
- Defined `SeverityHook` struct to perform the logging bridge
functionality.

Part of
#5405

---------

Co-authored-by: Damien Mathieu <[email protected]>
Co-authored-by: Robert Pająk <[email protected]>
dmathieu added a commit that referenced this issue Jul 15, 2024
Added @dmathieu and @AkhigbeEromo as codeowners for the zerolog bridge
part of #5405

---------

Co-authored-by: Tyler Yahn <[email protected]>
Co-authored-by: Damien Mathieu <[email protected]>
MrAlias added a commit that referenced this issue Jul 17, 2024
part of #5405 
Implemented the run method and wrote tests for it

---------

Co-authored-by: Damien Mathieu <[email protected]>
Co-authored-by: Robert Pająk <[email protected]>
Co-authored-by: Tyler Yahn <[email protected]>
This was referenced Jul 17, 2024
dmathieu pushed a commit that referenced this issue Jul 19, 2024
part of #5405
Added benchmark for zerolog
The result I got for the benchmark:

```
goos: darwin
goarch: amd64
pkg: go.opentelemetry.io/contrib/bridges/otelzerolog
cpu: Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
BenchmarkHookRun-4   	  697216	      2059 ns/op	    1773 B/op	       0 allocs/op
PASS
ok  	go.opentelemetry.io/contrib/bridges/otelzerolog	3.110s
```
@dmathieu dmathieu linked a pull request Jul 22, 2024 that will close this issue
pellared added a commit that referenced this issue Jul 22, 2024
@pellared pellared modified the milestone: v1.29.0 Jul 22, 2024
@pellared pellared added the bridge: zerolog Related to the zerolog bridge label Jul 22, 2024
@pellared
Copy link
Member

pellared commented Aug 8, 2024

The zerolog bridge has been not published.
Root cause: rs/zerolog#493
More: #5969

luca-filipponi pushed a commit to luca-filipponi/opentelemetry-go-contrib that referenced this issue Aug 9, 2024
Added @dmathieu and @AkhigbeEromo as codeowners for the zerolog bridge
part of open-telemetry#5405

---------

Co-authored-by: Tyler Yahn <[email protected]>
Co-authored-by: Damien Mathieu <[email protected]>
luca-filipponi pushed a commit to luca-filipponi/opentelemetry-go-contrib that referenced this issue Aug 9, 2024
part of open-telemetry#5405 
Implemented the run method and wrote tests for it

---------

Co-authored-by: Damien Mathieu <[email protected]>
Co-authored-by: Robert Pająk <[email protected]>
Co-authored-by: Tyler Yahn <[email protected]>
luca-filipponi pushed a commit to luca-filipponi/opentelemetry-go-contrib that referenced this issue Aug 9, 2024
part of open-telemetry#5405
Added benchmark for zerolog
The result I got for the benchmark:

```
goos: darwin
goarch: amd64
pkg: go.opentelemetry.io/contrib/bridges/otelzerolog
cpu: Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
BenchmarkHookRun-4   	  697216	      2059 ns/op	    1773 B/op	       0 allocs/op
PASS
ok  	go.opentelemetry.io/contrib/bridges/otelzerolog	3.110s
```
luca-filipponi pushed a commit to luca-filipponi/opentelemetry-go-contrib that referenced this issue Aug 9, 2024
MrAlias added a commit that referenced this issue Aug 23, 2024
This release is the last to support [Go 1.21]. The next release will
require at least [Go 1.22].

### Added

- Add the `WithSpanAttributes` and `WithMetricAttributes` methods to set
custom attributes to the stats handler in
`go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc`.
(#5133)
- The `go.opentelemetry.io/contrib/bridges/otelzap` module. This module
provides an OpenTelemetry logging bridge for `go.uber.org/zap`. (#5191)
- Support for the `OTEL_HTTP_CLIENT_COMPATIBILITY_MODE=http/dup`
environment variable in
`go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` to emit
attributes for both the v1.20.0 and v1.26.0 semantic conventions.
(#5401)
- The `go.opentelemetry.io/contrib/bridges/otelzerolog` module. This
module provides an OpenTelemetry logging bridge for
`github.com/rs/zerolog`. (#5405)
- Add `WithGinFilter` filter parameter in
`go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin`
to allow filtering requests with `*gin.Context`. (#5743)
- Support for stdoutlog exporter in
`go.opentelemetry.io/contrib/config`. (#5850)
- Add macOS ARM64 platform to the compatibility testing suite. (#5868)
- Add new runtime metrics to
`go.opentelemetry.io/contrib/instrumentation/runtime`, which are still
disabled by default. (#5870)
- Add the `WithMetricsAttributesFn` option to allow setting dynamic,
per-request metric attributes in
`go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp`. (#5876)
- The `go.opentelemetry.io/contrib/config` package supports configuring
`with_resource_constant_labels` for the prometheus exporter. (#5890)
- Support [Go 1.23]. (#6017)

### Removed

- The deprecated `go.opentelemetry.io/contrib/processors/baggagecopy`
package is removed. (#5853)

### Fixed

- Race condition when reading the HTTP body and writing the response in
`go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp`. (#5916)

[Go 1.23]: https://go.dev/doc/go1.23
[Go 1.22]: https://go.dev/doc/go1.22
[Go 1.21]: https://go.dev/doc/go1.21
@pellared pellared closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridge: zerolog Related to the zerolog bridge enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants