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 error handler to replace global otel error handler #1233

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

RebeccaMahany
Copy link
Contributor

The default global otel error handler prints all logs to stderr, which a) messes up our log formatting and b) is not desirable since it doesn't account for log level. This PR adds a small error handler to ensure that otel errors are logged with our usual logger, at the appropriate level.

From:

2023/06/21 13:29:16 traces export: context deadline exceeded: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:4317: connect: connection refused"

To:

{"caller":"error_handler.go:22","component":"trace_exporter","err":"traces export: context deadline exceeded: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 127.0.0.1:4317: connect: connection refused\"","msg":"tracing error","session_pid":67708,"severity":"debug","ts":"2023-06-23T15:15:44.558797Z"}

@RebeccaMahany RebeccaMahany merged commit 3e55385 into kolide:main Jun 23, 2023
@RebeccaMahany RebeccaMahany deleted the becca/error-handler-otel branch June 23, 2023 15:51
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