Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions opentelemetry-otlp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## vNext

- The `OTEL_EXPORTER_OTLP_TIMEOUT`, `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT`, `OTEL_EXPORTER_OTLP_METRICS_TIMEOUT` and `OTEL_EXPORTER_OTLP_LOGS_TIMEOUT` are changed from seconds to miliseconds.
- Fixed `.with_headers()` in `HttpExporterBuilder` to correctly support multiple key/value pairs. [#2699](https://github.com/open-telemetry/opentelemetry-rust/pull/2699)

## 0.28.0

Expand Down Expand Up @@ -41,7 +42,7 @@ Released 2024-Nov-11
- Update `opentelemetry-http` dependency version to 0.27
- Update `opentelemetry-proto` dependency version to 0.27

- **BREAKING**:
- **BREAKING**:
- ([#2217](https://github.com/open-telemetry/opentelemetry-rust/pull/2217)) **Replaced**: The `MetricsExporterBuilder` interface is modified from `with_temporality_selector` to `with_temporality` example can be seen below:
Previous Signature:
```rust
Expand Down Expand Up @@ -88,9 +89,9 @@ Released 2024-Nov-11
- `MetricsExporterBuilder` -> `MetricExporterBuilder`

- [#2263](https://github.com/open-telemetry/opentelemetry-rust/pull/2263)
Support `hyper` client for opentelemetry-otlp. This can be enabled using flag `hyper-client`.
Support `hyper` client for opentelemetry-otlp. This can be enabled using flag `hyper-client`.
Refer example: https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-otlp/examples/basic-otlp-http

## v0.26.0
Released 2024-Sep-30

Expand Down
19 changes: 11 additions & 8 deletions opentelemetry-otlp/src/exporter/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,13 @@ impl<B: HasHttpConfig> WithHttpConfig for B {

fn with_headers(mut self, headers: HashMap<String, String>) -> Self {
// headers will be wrapped, so we must do some logic to unwrap first.
self.http_client_config()
let http_client_headers = self
.http_client_config()
.headers
.iter_mut()
.zip(headers)
.for_each(|(http_client_headers, (key, value))| {
http_client_headers.insert(key, super::url_decode(&value).unwrap_or(value));
});
.get_or_insert(HashMap::new());
headers.into_iter().for_each(|(key, value)| {
http_client_headers.insert(key, super::url_decode(&value).unwrap_or(value));
});
self
}
}
Expand Down Expand Up @@ -671,11 +671,14 @@ mod tests {
}

#[test]
fn test_http_exporter_builder_with_header() {
fn test_http_exporter_builder_with_headers() {
use std::collections::HashMap;
// Arrange
let initial_headers = HashMap::from([("k1".to_string(), "v1".to_string())]);
let extra_headers = HashMap::from([("k2".to_string(), "v2".to_string())]);
let extra_headers = HashMap::from([
("k2".to_string(), "v2".to_string()),
("k3".to_string(), "v3".to_string()),
]);
let expected_headers = initial_headers.iter().chain(extra_headers.iter()).fold(
HashMap::new(),
|mut acc, (k, v)| {
Expand Down