5858 ** ` experimental_metrics_periodicreader_with_async_runtime ` ** .
5959
6060 Migration Guide:
61-
62- 1 . * Default Implementation, requires no async runtime* (** Recommended** ) The
61+ 1 . * Default Implementation, requires no async runtime* (** Recommended** ) The
6362 new default implementation does not require a runtime argument. Replace the
6463 builder method accordingly:
65- - * Before:*
64+ - * Before:*
6665 ``` rust
6766 let reader = opentelemetry_sdk :: metrics :: PeriodicReader :: builder (exporter , runtime :: Tokio ). build ();
6867 ```
7170 let reader = opentelemetry_sdk :: metrics :: PeriodicReader :: builder (exporter ). build ();
7271 ```
7372
73+ The new PeriodicReader can be used with OTLP Exporter , and supports
74+ following exporter features :
75+ - `grpc - tonic `: This requires `MeterProvider ` to be created within a tokio
76+ runtime .
77+ - `reqwest - blocking - client `: Works with a regular `main ` or `tokio :: main `.
78+
79+ In other words , other clients like `reqwest ` and `hyper ` are not supported .
80+
7481 2 . * Async Runtime Support *
7582 If your application cannot spin up new threads or you prefer using async
7683 runtimes , enable the
7784 " experimental_metrics_periodicreader_with_async_runtime" feature flag and
7885 adjust code as below .
7986
8087 - * Before : *
88+
8189 ```rust
8290 let reader = opentelemetry_sdk :: metrics :: PeriodicReader :: builder (exporter , runtime :: Tokio ). build ();
8391 ```
8492
8593 - * After : *
94+
8695 ```rust
8796 let reader = opentelemetry_sdk :: metrics :: periodic_reader_with_async_runtime :: PeriodicReader :: builder (exporter , runtime :: Tokio ). build ();
88- ```
97+ ```
8998
9099 * Requirements : *
91100 - Enable the feature flag :
104113 - Getter methods have been introduced to access field values .
105114 This change impacts custom exporter and processor developers by requiring updates to code that directly accessed LogRecord fields . They must now use the provided getter methods (e. g. , `log_record. event_name()` instead of `log_record. event_name`).
106115
107- - 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
116+ - 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
108117metadata, a feature introduced in version 0. 1. 40. [#2418](https: // github.com/open-telemetry/opentelemetry-rust/pull/2418)
109118
110- - * * Breaking ** [#2436](https: // github.com/open-telemetry/opentelemetry-rust/pull/2436)
111-
119+ - * Breaking * - `BatchLogProcessor ` Updates [#2436](https: // github.com/open-telemetry/opentelemetry-rust/pull/2436)
112120 `BatchLogProcessor ` no longer requires an async runtime by default. Instead , a dedicated
113121 background thread is created to do the batch processing and exporting.
114122
@@ -120,33 +128,45 @@ metadata, a feature introduced in version 0.1.40. [#2418](https://github.com/ope
120128 new default implementation does not require a runtime argument. Replace the
121129 builder method accordingly:
122130 - * Before : *
131+
123132 ```rust
124133 let logger_provider = LoggerProvider :: builder()
125134 . with_log_processor(BatchLogProcessor :: builder(exporter, runtime :: Tokio ). build())
126135 . build();
127136 ```
128137
129138 - * After : *
139+
130140 ```rust
131141 let logger_provider = LoggerProvider :: builder ()
132142 . with_log_processor (BatchLogProcessor :: builder (exporter ). build ())
133143 . build ();
134144 ```
135145
146+ The new BatchLogProcessor can be used with OTLP Exporter , and supports
147+ following exporter features :
148+ - `grpc - tonic `: This requires `MeterProvider ` to be created within a tokio
149+ runtime .
150+ - `reqwest - blocking - client `: Works with a regular `main ` or `tokio :: main `.
151+
152+ In other words , other clients like `reqwest ` and `hyper ` are not supported .
153+
136154 2 . * Async Runtime Support *
137155 If your application cannot spin up new threads or you prefer using async
138156 runtimes , enable the
139157 " experimental_logs_batch_log_processor_with_async_runtime" feature flag and
140158 adjust code as below .
141159
142160 - * Before : *
161+
143162 ```rust
144163 let logger_provider = LoggerProvider :: builder ()
145164 . with_log_processor (BatchLogProcessor :: builder (exporter , runtime :: Tokio ). build ())
146165 . build ();
147166 ```
148167
149168 - * After : *
169+
150170 ```rust
151171 let logger_provider = LoggerProvider :: builder ()
152172 . with_log_processor (log_processor_with_async_runtime :: BatchLogProcessor :: builder (exporter , runtime :: Tokio ). build ())
@@ -159,7 +179,7 @@ metadata, a feature introduced in version 0.1.40. [#2418](https://github.com/ope
159179 - Continue enabling one of the async runtime feature flags : `rt - tokio `,
160180 `rt - tokio - current - thread `, or `rt - async - std `.
161181
162- - * * Breaking ** [# 2456 ](https : // github.com/open-telemetry/opentelemetry-rust/pull/2456)
182+ - * Breaking * - ` BatchSpanProcessor ` Updates [# 2435 ](https : // github.com/open-telemetry/opentelemetry-rust/pull/2456)
163183
164184 `BatchSpanProcessor ` no longer requires an async runtime by default . Instead , a dedicated
165185 background thread is created to do the batch processing and exporting .
@@ -172,33 +192,45 @@ metadata, a feature introduced in version 0.1.40. [#2418](https://github.com/ope
172192 new default implementation does not require a runtime argument . Replace the
173193 builder method accordingly :
174194 - * Before : *
195+
175196 ```rust
176197 let tracer_provider = TracerProvider :: builder ()
177198 . with_span_processor (BatchSpanProcessor :: builder (exporter , runtime :: Tokio ). build ())
178199 . build ();
179200 ```
180201
181202 - * After : *
203+
182204 ```rust
183205 let tracer_provider = TracerProvider :: builder ()
184206 . with_span_processor (BatchSpanProcessor :: builder (exporter ). build ())
185207 . build ();
186208 ```
187209
210+ The new BatchLogProcessor can be used with OTLP Exporter , and supports
211+ following exporter features :
212+ - `grpc - tonic `: This requires `MeterProvider ` to be created within a tokio
213+ runtime .
214+ - `reqwest - blocking - client `: Works with a regular `main ` or `tokio :: main `.
215+
216+ In other words , other clients like `reqwest ` and `hyper ` are not supported .
217+
188218 2 . * Async Runtime Support *
189219 If your application cannot spin up new threads or you prefer using async
190220 runtimes , enable the
191221 " experimental_trace_batch_span_processor_with_async_runtime" feature flag and
192222 adjust code as below .
193223
194224 - * Before : *
225+
195226 ```rust
196227 let tracer_provider = TracerProvider :: builder ()
197228 . with_span_processor (BatchSpanProcessor :: builder (exporter , runtime :: Tokio ). build ())
198229 . build ();
199230 ```
200231
201232 - * After : *
233+
202234 ```rust
203235 let tracer_provider = TracerProvider :: builder ()
204236 . with_span_processor (span_processor_with_async_runtime :: BatchSpanProcessor :: builder (exporter , runtime :: Tokio ). build ())
0 commit comments