-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fix logging when we fail to export metrics to hcp #20514
Conversation
Just a callout for future reviewers, or anyone looking back at this PR: it's a global level logger, this would override the logging for any other future code using the OTEL library since the logger is set here. Ideally, we can scope our logger down to metrics if the metrics SDK permits , but not sure if that's currently possible💯. Will leave @jjti to do this digging and make the right call here. LGTM. |
@jjti, a backport is missing for this PR [20514] for versions [1.17] please perform the backport manually and add the following snippet to your backport PR description:
|
3 similar comments
@jjti, a backport is missing for this PR [20514] for versions [1.17] please perform the backport manually and add the following snippet to your backport PR description:
|
@jjti, a backport is missing for this PR [20514] for versions [1.17] please perform the backport manually and add the following snippet to your backport PR description:
|
@jjti, a backport is missing for this PR [20514] for versions [1.17] please perform the backport manually and add the following snippet to your backport PR description:
|
Description
Testing 1.18.x I noticed some stderr log lines w/o the normal hclog formatting:
Here in OTEL there's a
GlobalHandler
that defaults to logging to stderr: https://github.com/open-telemetry/opentelemetry-go/blob/main/internal/global/handler.go#L96The OTEL PeriodicReader calls that here whenever
otelExporter.Export
fails: https://github.com/open-telemetry/opentelemetry-go/blob/e3eb3f7538e790a853c3ce210cf48123ddd5ca20/sdk/metric/periodic_reader.go#L181This change here is to override the default global error handler with one that logs to the hclog.Logger instead
Testing & Reproduction steps
Links
PR Checklist