File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,12 @@ where
14
14
use opentelemetry_otlp:: WithExportConfig ;
15
15
16
16
global:: set_text_map_propagator ( TraceContextPropagator :: new ( ) ) ;
17
- // FIXME choice the right/official env variable `OTEL_COLLECTOR_URL` or `OTEL_EXPORTER_OTLP_ENDPOINT`
18
17
// TODO try to autodetect if http or grpc should be used (eg based on env variable, port ???)
19
18
//endpoint (default = 0.0.0.0:4317 for grpc protocol, 0.0.0.0:4318 http protocol):
20
19
//.http().with_endpoint(collector_url),
21
20
let endpoint_grpc = std:: env:: var ( "OTEL_EXPORTER_OTLP_ENDPOINT" )
22
- . unwrap_or_else ( |_| "http://0.0.0.0:4317" . to_string ( ) ) ;
21
+ . or_else ( |_| std:: env:: var ( "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT" ) )
22
+ . unwrap_or_else ( |_| "http://127.0.0.1:4317" . to_string ( ) ) ;
23
23
let exporter = opentelemetry_otlp:: new_exporter ( )
24
24
. tonic ( )
25
25
. with_endpoint ( endpoint_grpc) ;
You can’t perform that action at this time.
0 commit comments