|
| 1 | +# Migration Guide from 0.28 to 0.29 |
| 2 | + |
| 3 | +OpenTelemetry Rust 0.29 introduces a few breaking changes. This guide aims to |
| 4 | +facilitate a smooth migration for common use cases involving the |
| 5 | +`opentelemetry`, `opentelemetry_sdk`, `opentelemetry-otlp`, and |
| 6 | +`opentelemetry-appender-tracing` crates. For a comprehensive list of changes, |
| 7 | +please refer to the detailed changelog for each crate. This document covers only |
| 8 | +the most common scenarios. Note that changes that only affect custom |
| 9 | +exporter/processor authors are not mentioned in this doc. |
| 10 | + |
| 11 | +OpenTelemetry Metrics API and Log-Bridge API were declared stable in 0.28, and have |
| 12 | +no breaking changes. |
| 13 | + |
| 14 | +## Baggage Changes |
| 15 | + |
| 16 | +The Baggage API has been redesigned to align with the OpenTelemetry |
| 17 | +specification. While the core API for interacting with Baggage remains the same, |
| 18 | +the accepted data types have changed. Baggage Keys now only allow strings (ASCII |
| 19 | +printable characters), and Baggage values are restricted to strings. |
| 20 | + |
| 21 | +For detailed changes, see the [changelog](../opentelemetry/CHANGELOG.md). With |
| 22 | +version 0.29, the Baggage API has reached "Release Candidate" status, meaning |
| 23 | +further breaking changes will be highly restricted. |
| 24 | + |
| 25 | +## Appender-Tracing Changes |
| 26 | + |
| 27 | +The `opentelemetry-appender-tracing` crate, which bridges `tracing` events to |
| 28 | +OpenTelemetry logs, has been updated to properly map `tracing` data types to the |
| 29 | +OpenTelemetry model. As of version 0.29, this crate is considered "Stable," and |
| 30 | +no further breaking changes will be made without a major version bump. |
| 31 | + |
| 32 | +## Configuration via Environment Variables |
| 33 | + |
| 34 | +The 0.29 release aligns OpenTelemetry Rust with the rest of the OpenTelemetry |
| 35 | +ecosystem by treating any code-based configuration as final (i.e., it cannot be |
| 36 | +overridden by environment variables). This policy was partially true before but |
| 37 | +is now applied consistently. If you prefer to configure your application via |
| 38 | +environment variables, avoid configuring it programmatically. |
| 39 | + |
| 40 | +## Discontinuing Dedicated Prometheus Exporter |
| 41 | + |
| 42 | +The `opentelemetry-prometheus` crate will be discontinued with the 0.29 release. |
| 43 | +Active development on this crate ceased a few months ago. Given that Prometheus |
| 44 | +now natively supports OTLP, and considering that the OpenTelemetry Rust project |
| 45 | +is still working towards a 1.0 release, we need to focus on essential components |
| 46 | +to maintain scope and ensure timely delivery. |
| 47 | + |
| 48 | +Prometheus interoperability remains a key goal for OpenTelemetry. However, the |
| 49 | +current `opentelemetry-prometheus` crate requires a major rewrite to eliminate |
| 50 | +dependencies on unmaintained crates. We may reintroduce a dedicated Prometheus |
| 51 | +exporter in the future once these issues are resolved. |
| 52 | + |
| 53 | +### Migration Guide |
| 54 | + |
| 55 | +For those using Prometheus as a backend, you can integrate with Prometheus using |
| 56 | +the following methods: |
| 57 | + |
| 58 | +1. Use the OTLP Exporter to push metrics directly to Prometheus. |
| 59 | +2. If you require a pull (scrape) model, push metrics to an OpenTelemetry |
| 60 | + Collector using the OTLP Exporter, and configure Prometheus to scrape the |
| 61 | + OpenTelemetry Collector. |
| 62 | + |
| 63 | +These alternatives ensure continued Prometheus integration while allowing us to |
| 64 | +focus on achieving a stable 1.0 release for OpenTelemetry Rust. |
| 65 | + |
| 66 | +## Next Release |
| 67 | + |
| 68 | +In the [next |
| 69 | +release](https://github.com/open-telemetry/opentelemetry-rust/milestone/21), we |
| 70 | +expect to stabilize the Metrics SDK and resolve the long-standing question of |
| 71 | +`tokio-tracing` vs. `opentelemetry tracing`, which is a prerequisite before |
| 72 | +stabilizing Distributed Tracing. Additionally, `Context` is also expected to be |
| 73 | +enhanced with the ability to suppress telemetry-induced-telemetry. |
| 74 | + |
| 75 | +## Instrumentation Libraries |
| 76 | + |
| 77 | +Unlike other OpenTelemetry language implementations, OpenTelemetry Rust historically did not |
| 78 | +maintain any instrumentations directly. This has recently changed with a |
| 79 | +[contribution](https://github.com/open-telemetry/opentelemetry-rust-contrib/pull/202) |
| 80 | +from one of the founding members of the OpenTelemetry Rust project to the |
| 81 | +contrib repository, providing an instrumentation library for |
| 82 | +[`actix-web`](https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/actix-web-opentelemetry). |
| 83 | +We expect that this instrumentation will serve as a reference implementation demonstrating best practices for |
| 84 | +creating OpenTelemetry instrumentations in Rust. |
| 85 | + |
| 86 | +We welcome additional contributions of instrumentation libraries to the contrib repository. |
| 87 | + |
| 88 | +## Thanks |
| 89 | + |
| 90 | +Thank you to everyone who contributed to this milestone. Please share your feedback |
| 91 | +through GitHub issues or join the discussion in the OTel-Rust Slack channel |
| 92 | +[here](https://cloud-native.slack.com/archives/C03GDP0H023). |
0 commit comments