Commit 24b6334 1 parent 8237f87 commit 24b6334 Copy full SHA for 24b6334
File tree 1 file changed +10
-1
lines changed
opentelemetry-otlp/src/exporter/http
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ use std::sync::Arc;
3
3
use futures_core:: future:: BoxFuture ;
4
4
use http:: { header:: CONTENT_TYPE , Method } ;
5
5
use opentelemetry:: trace:: { TraceError , TraceResult } ;
6
+ use opentelemetry_http:: ResponseExt ;
6
7
use opentelemetry_sdk:: export:: trace:: { ExportResult , SpanData , SpanExporter } ;
7
8
8
9
use super :: OtlpHttpClient ;
@@ -46,7 +47,15 @@ impl SpanExporter for OtlpHttpClient {
46
47
}
47
48
48
49
Box :: pin ( async move {
49
- client. send ( request) . await ?;
50
+ let request_uri = request. uri ( ) . to_string ( ) ;
51
+ let response = client. send ( request) . await ?;
52
+
53
+ if !response. status ( ) . is_success ( ) {
54
+ eprintln ! (
55
+ "OpenTelemetry export failed. Url: {}, Response: {:?}" ,
56
+ request_uri, response
57
+ ) ;
58
+ }
50
59
51
60
Ok ( ( ) )
52
61
} )
You can’t perform that action at this time.
0 commit comments