Skip to content

Replace otel logrus bridge with official contrib package - #224

Merged
mschewe merged 1 commit into
masterfrom
replace-logrus-bridge
Sep 24, 2026
Merged

mschewe merged 1 commit into
masterfrom
replace-logrus-bridge

Conversation

@mschewe

@mschewe mschewe commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

The dependency uptrace/opentelemetry-go-extra hasn't had a release for two years.
There is an official contrib package (go.opentelemetry.io/contrib/bridges/otellogrus) that is still actively maintained and kept in sync with the rest of the OTEL ecosystem.

Many of our services broke after updating all dependencies (go get -u -t ./...), because it pulled in go.opentelemetry.io/otel/log v0.22.0. Version v0.21.0 introduced a breaking change to the attributes interface, which the uptrace package never adopted, leaving it incompatible with any otel/log version from v0.21.0 and newer.

This PR replaces the uptrace bridge with the official contrib package to fix the build and avoid running into this again on future dependency updates.

@mschewe
mschewe requested a review from a team as a code owner September 23, 2026 14:35
@mschewe mschewe changed the title replace unmaintained otel logrus bridge with official contrib package Replace otel logrus bridge with official contrib package Sep 23, 2026
@mschewe

mschewe commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

btw. I think we are not using this anywhere. Maybe we should get rid of this feature entirely.

@tnicolaisen-snabble

Copy link
Copy Markdown
Contributor

This is a great find and change. Thanks!

btw. I think we are not using this anywhere. Maybe we should get rid of this feature entirely.

We use this to hook into the context logging in every application. Without it, our logs wouldn't have trace/span in them. It gets called in the init block of the logging package.

@tnicolaisen-snabble

Copy link
Copy Markdown
Contributor

Can you test it by setting up a go workspace with f.ex. checkout+go-logging (your local copy), and see if the checkout logs include trace/span logs as expected?

@mschewe

mschewe commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Can you test it by setting up a go workspace with f.ex. checkout+go-logging (your local copy), and see if the checkout logs include trace/span logs as expected?

I have tested it locally and traces/spans still show up.

@mschewe
mschewe merged commit 65644b8 into master Sep 24, 2026
1 check passed
@mschewe
mschewe deleted the replace-logrus-bridge branch September 24, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants