open-telemetry / opentelemetry-go-contrib

Collection of extensions for OpenTelemetry-Go.
https://opentelemetry.io/
Apache License 2.0
1.15k stars 544 forks source link

Add skeleton for zerolog bridge #5782

Closed AkhigbeEromo closed 2 months ago

AkhigbeEromo commented 3 months ago

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

Part of https://github.com/open-telemetry/opentelemetry-go-contrib/issues/5405

AkhigbeEromo commented 3 months ago

Hello @MrAlias, hope this is okay for a start

AkhigbeEromo commented 3 months ago

Also, do i need to make a changelog for each of the PRs concerning the zerolog bridge

AkhigbeEromo commented 3 months ago

Thank you @dmathieu, I know what to do now.

I will split up and send in another PR

dmathieu commented 2 months ago

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[bot] commented 2 months ago

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 [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/5782/graphs/tree.svg?width=650&height=150&src=pr&token=P6F3W9WA7Q&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://app.codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/5782?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ```diff @@ 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](https://app.codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/5782?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [bridges/otelzerolog/hook.go](https://app.codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/5782?src=pr&el=tree&filepath=bridges%2Fotelzerolog%2Fhook.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-YnJpZGdlcy9vdGVsemVyb2xvZy9ob29rLmdv) | `97.1% <97.1%> (ø)` | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-go-contrib/pull/5782/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)
AkhigbeEromo commented 2 months ago

I have done it @dmathieu Is there any other changes you will like me to add?

dmathieu commented 2 months ago

There are still lint issues that need fixing.

pellared commented 2 months ago

What about CODEOWNERS? Who will maintain the new bridge?

More: https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CONTRIBUTING.md#code-owners

iancharters commented 2 months ago

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.

pellared commented 2 months ago

@iancharters, the module is not released. It is your own responsibility to use pseudo versions of in-development modules.