opentelemetry-go-contrib
opentelemetry-go-contrib copied to clipboard
Add open telemetry severity hook integration for zerolog
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
configstruct to handle configuration options. - Implemented
Optioninterface and related functions (WithVersion,WithSchemaURL,WithLoggerProvider). - Created
NewSeverityHookfunction to initialize aSeverityHook. - Defined
SeverityHookstruct to perform the logging bridge functionality.
Part of https://github.com/open-telemetry/opentelemetry-go-contrib/issues/5405
Hello @MrAlias, hope this is okay for a start
Also, do i need to make a changelog for each of the PRs concerning the zerolog bridge
Thank you @dmathieu, I know what to do now.
I will split up and send in another PR
You will need to add this module to the versions.yaml file, in the excluded-modules section.
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/versions.yaml#L91
Codecov Report
Attention: Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.
Project coverage is 64.7%. Comparing base (
e2d29ee) to head (ecd5abf).
Additional details and impacted files
@@ Coverage Diff @@
## main #5782 +/- ##
=====================================
Coverage 64.6% 64.7%
=====================================
Files 201 202 +1
Lines 12594 12629 +35
=====================================
+ Hits 8143 8175 +32
- Misses 4215 4217 +2
- Partials 236 237 +1
| Files | Coverage Δ | |
|---|---|---|
| bridges/otelzerolog/hook.go | 97.1% <97.1%> (ø) |
I have done it @dmathieu Is there any other changes you will like me to add?
There are still lint issues that need fixing.
What about CODEOWNERS? Who will maintain the new bridge?
More: https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CONTRIBUTING.md#code-owners
Why was this merged as an unfinished implementation? I had the misfortune of coming across this today and attempting to wire it up. Wasted a significant portion of my day until I got so frustrated that I vendored my dependencies and started poking at the underlying libraries, realizing that Run is just a TODO comment.
@iancharters, the module is not released. It is your own responsibility to use pseudo versions of in-development modules.