Remove Global Error handler.#2260
Conversation
…elemetry-rust into remove-global-error-handler
cijothomas
left a comment
There was a problem hiding this comment.
Given this is breaking change, we need to add it to changelog. and also show a migration guide for anyone who were relying on this previously.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2260 +/- ##
=====================================
Coverage 79.4% 79.5%
=====================================
Files 121 121
Lines 20981 20960 -21
=====================================
- Hits 16673 16671 -2
+ Misses 4308 4289 -19 ☔ View full report in Codecov by Sentry. |
Done/ |
Co-authored-by: Cijo Thomas <cithomas@microsoft.com>
Co-authored-by: Cijo Thomas <cithomas@microsoft.com>
cijothomas
left a comment
There was a problem hiding this comment.
LGTM.
I'll try our self-diagnostics with few scenarios later and make suggestions, if any. (I am a customer of the internal logs !!)
upstream change made this functionality tricky open-telemetry/opentelemetry-rust#2697 open-telemetry/opentelemetry-rust#2260
upstream change made this functionality tricky open-telemetry/opentelemetry-rust#2697 open-telemetry/opentelemetry-rust#2260
|
Hi, We just migrated from opentelemetry-otlp 0.25 and found out about this change. The |
Yes, we just started with tracing, and more improvements are needed, including providing a different feature-flag, that'd fire callbacks instead of using Can you submit a new issue with some more details on the proposal, or can send a draft PR to support this? |
|
Thanks, I've just opened #2992 where I also explained another minor issue related to |
0.28 introduces a large number of significant breaking changes that we need to address all at once: open-telemetry/opentelemetry-rust#2260 set_error_handler is removed open-telemetry/opentelemetry-rust#2227 .init() becomes .build() on metrics builders. .try_init() is no longer needed (also becomes .build()) open-telemetry/opentelemetry-rust#2575 Metric exporters are created via .builder() now open-telemetry/opentelemetry-rust#2597 Metrics exporter can be added in commonly used configuration (which works for us) using .with_periodic_exporter open-telemetry/opentelemetry-rust#2221 Logger creation API changed * noop removed from public API It's added back in a future version but that will require tonic update. open-telemetry/opentelemetry-rust#2210 AsyncInstruments are no longer allowed to call `observe` outside of a callback, because this usage was incorrect. For some reason, we were using ObservableGauge in oak_private_memory; possibly because regular gauge wasn't available. So we add support for sync gauages here and use that. 0.29 introduces a few breaking changes as well: open-telemetry/opentelemetry-rust#2790 * Exporter builders now return a different error type For full details see: https://github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-sdk/CHANGELOG.md Change-Id: I3d7ff01858fde0f39307c2a64c354b7468b5b909
Fixes #2175
Needs #2259 #2257 #2256 to be merged first.
Changes
global::set_error_handlerandglobal::handle_error, as theglobal_handle_errorusage inside the opentelemetry crates has already been replaced withglobal::otel_info,otel_warn,otel_debugandotel_errorMigration Guide:
This guide explains how to migrate from
global::set_error_handlerto a new setup withotel_*macros and Tokio tracing. If your application previously usedglobal::set_error_handler, remove it as part of this migration. If not, this configuration ensures errors previously going toeprintln!are now handled through structured tracing.Step 1: Remove set_error_handler (if used)
If your code currently sets a custom error handler using global::set_error_handler, remove this line and any associated custom handler function.
Step 2: Internal OpenTelemetry Logs Filter and Layer:
Set up a layer to handle OpenTelemetry internal logs and stop them from propagating to tracing bridge/appender.
Step 3: Register Layers in the Tracing Registry
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial, user-facing changes