|
95 | 95 |
|
96 | 96 | - Bump msrv to 1.75.0.
|
97 | 97 |
|
98 |
| - |
99 | 98 | - *Breaking* : [#2314](https://github.com/open-telemetry/opentelemetry-rust/pull/2314)
|
100 | 99 | - The LogRecord struct has been updated:
|
101 | 100 | - All fields are now pub(crate) instead of pub.
|
|
105 | 104 | - Upgrade the tracing crate used for internal logging to version 0.1.40 or later. This is necessary because the internal logging macros utilize the name field as
|
106 | 105 | metadata, a feature introduced in version 0.1.40. [#2418](https://github.com/open-telemetry/opentelemetry-rust/pull/2418)
|
107 | 106 |
|
| 107 | +- **Breaking** [#2436](https://github.com/open-telemetry/opentelemetry-rust/pull/2436) |
| 108 | + |
| 109 | + `BatchLogProcessor` no longer requires an async runtime by default. Instead, a dedicated |
| 110 | + background thread is created to do the batch processing and exporting. |
| 111 | + |
| 112 | + For users who prefer the previous behavior of relying on a specific |
| 113 | + `Runtime`, they can do so by enabling the feature flag |
| 114 | + **`experimental_logs_batch_log_processor_with_async_runtime`**. |
| 115 | + |
| 116 | + 1. *Default Implementation, requires no async runtime* (**Recommended**) The |
| 117 | + new default implementation does not require a runtime argument. Replace the |
| 118 | + builder method accordingly: |
| 119 | + - *Before:* |
| 120 | + ```rust |
| 121 | + let logger_provider = LoggerProvider::builder() |
| 122 | + .with_log_processor(BatchLogProcessor::builder(exporter, runtime::Tokio).build()) |
| 123 | + .build(); |
| 124 | + ``` |
| 125 | + |
| 126 | + - *After:* |
| 127 | + ```rust |
| 128 | + let logger_provider = LoggerProvider::builder() |
| 129 | + .with_log_processor(BatchLogProcessor::builder(exporter).build()) |
| 130 | + .build(); |
| 131 | + ``` |
| 132 | + |
| 133 | + 2. *Async Runtime Support* |
| 134 | + If your application cannot spin up new threads or you prefer using async |
| 135 | + runtimes, enable the |
| 136 | + "experimental_logs_batch_log_processor_with_async_runtime" feature flag and |
| 137 | + adjust code as below. |
| 138 | + |
| 139 | + - *Before:* |
| 140 | + ```rust |
| 141 | + let logger_provider = LoggerProvider::builder() |
| 142 | + .with_log_processor(BatchLogProcessor::builder(exporter, runtime::Tokio).build()) |
| 143 | + .build(); |
| 144 | + ``` |
| 145 | + |
| 146 | + - *After:* |
| 147 | + ```rust |
| 148 | + let logger_provider = LoggerProvider::builder() |
| 149 | + .with_log_processor(BatchLogProcessorWithAsyncRuntime::builder(exporter, runtime::Tokio).build()) |
| 150 | + .build(); |
| 151 | + ``` |
| 152 | + |
| 153 | + *Requirements:* |
| 154 | + - Enable the feature flag: |
| 155 | + `experimental_logs_batch_log_processor_with_async_runtime`. |
| 156 | + - Continue enabling one of the async runtime feature flags: `rt-tokio`, |
| 157 | + `rt-tokio-current-thread`, or `rt-async-std`. |
| 158 | + |
108 | 159 | ## 0.27.1
|
109 | 160 |
|
110 | 161 | Released 2024-Nov-27
|
|
0 commit comments