File tree Expand file tree Collapse file tree 4 files changed +45
-2
lines changed
init-tracing-opentelemetry Expand file tree Collapse file tree 4 files changed +45
-2
lines changed Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " bug_234_tls"
3
+ version = " 0.1.0"
4
+ edition = " 2021"
5
+ authors.workspace = true
6
+ license.workspace = true
7
+ homepage.workspace = true
8
+ repository.workspace = true
9
+ rust-version.workspace = true
10
+
11
+ [dependencies ]
12
+ axum = { workspace = true , default-features = true }
13
+ axum-tracing-opentelemetry = { path = " ../../axum-tracing-opentelemetry" }
14
+ tokio = { version = " 1" , features = [" full" ] }
15
+ tracing = { version = " 0.1" , features = [" log" ] }
16
+ tracing-subscriber = { version = " 0.3.19" , features = [" env-filter" , " std" ] }
17
+ init-tracing-opentelemetry = { path = " ../../init-tracing-opentelemetry" , features = [
18
+ " otlp" ,
19
+ " tracing_subscriber_ext" ,
20
+ " tls" ,
21
+ ] }
22
+ tracing-opentelemetry-instrumentation-sdk = { path = " ../../tracing-opentelemetry-instrumentation-sdk" , features = [
23
+ " http" ,
24
+ ] }
25
+ # opentelemetry = { version = "0.29.1", features = ["metrics"] }
Original file line number Diff line number Diff line change
1
+ use axum:: { response:: Html , routing:: get, Router } ;
2
+
3
+ #[ tokio:: main]
4
+ async fn main ( ) {
5
+ // build our application with a route
6
+ let app = Router :: new ( ) . route ( "/" , get ( handler) ) ;
7
+
8
+ // run it
9
+ let listener = tokio:: net:: TcpListener :: bind ( "127.0.0.1:3000" )
10
+ . await
11
+ . unwrap ( ) ;
12
+ println ! ( "listening on {}" , listener. local_addr( ) . unwrap( ) ) ;
13
+ axum:: serve ( listener, app) . await . unwrap ( ) ;
14
+ }
15
+
16
+ async fn handler ( ) -> Html < & ' static str > {
17
+ Html ( "<h1>Hello, World!</h1>" )
18
+ }
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ tracer = ["dep:opentelemetry-semantic-conventions"]
70
70
xray = [" dep:opentelemetry-aws" ]
71
71
zipkin = [" dep:opentelemetry-zipkin" ]
72
72
tracing_subscriber_ext = [" dep:tracing-subscriber" , " otlp" ]
73
- tls = [" opentelemetry-otlp/tls" ]
73
+ tls = [" opentelemetry-otlp/tls" , " tonic " ]
74
74
tls-roots = [" opentelemetry-otlp/tls-roots" ]
75
75
tls-webpki-roots = [" opentelemetry-otlp/tls-webpki-roots" ]
76
76
logfmt = [" dep:tracing-logfmt" ]
Original file line number Diff line number Diff line change 26
26
Some ( "grpc/tls" ) => Some (
27
27
SpanExporter :: builder ( )
28
28
. with_tonic ( )
29
- . with_tls_config ( ClientTlsConfig :: new ( ) . with_native_roots ( ) )
29
+ . with_tls_config ( ClientTlsConfig :: new ( ) . with_enabled_roots ( ) )
30
30
. build ( ) ?,
31
31
) ,
32
32
Some ( "grpc" ) => Some ( SpanExporter :: builder ( ) . with_tonic ( ) . build ( ) ?) ,
You can’t perform that action at this time.
0 commit comments