Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add error logging for failed OpenTelemetry HTTP export #1498

Merged
merged 14 commits into from
Feb 1, 2024
10 changes: 9 additions & 1 deletion opentelemetry-otlp/src/exporter/http/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@
}

Box::pin(async move {
client.send(request).await?;
let request_uri = request.uri().to_string();
let response = client.send(request).await?;

Check warning on line 50 in opentelemetry-otlp/src/exporter/http/trace.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-otlp/src/exporter/http/trace.rs#L49-L50

Added lines #L49 - L50 were not covered by tests

if !response.status().is_success() {
eprintln!(
"OpenTelemetry export failed. Url: {}, Response: {:?}",
request_uri, response
);
cijothomas marked this conversation as resolved.
Show resolved Hide resolved
}

Check warning on line 57 in opentelemetry-otlp/src/exporter/http/trace.rs

View check run for this annotation

Codecov / codecov/patch

opentelemetry-otlp/src/exporter/http/trace.rs#L52-L57

Added lines #L52 - L57 were not covered by tests

Ok(())
})
Expand Down
Loading