File tree Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ password-strength-validator = ["zxcvbn"]
26
26
string_number = []
27
27
tokio-sync = [" tokio" ]
28
28
tracing = [" tracinglib" , " tracing-futures" ]
29
+ tracing-otel = []
29
30
unblock = [" blocking" ]
30
31
dynamic-schema = []
31
32
graphiql = [" handlebars" ]
Original file line number Diff line number Diff line change @@ -132,14 +132,25 @@ impl Extension for TracingExtension {
132
132
next : NextResolve < ' _ > ,
133
133
) -> ServerResult < Option < Value > > {
134
134
let span = if !info. is_for_introspection {
135
- Some ( span ! (
136
- target: "async_graphql::graphql" ,
137
- Level :: INFO ,
138
- "field" ,
139
- path = %info. path_node,
140
- parent_type = %info. parent_type,
141
- return_type = %info. return_type,
142
- ) )
135
+ if cfg ! ( feature = "tracing-otel" ) {
136
+ Some ( span ! (
137
+ target: "async_graphql::graphql" ,
138
+ Level :: INFO ,
139
+ "field" ,
140
+ otel. name = %info. path_node,
141
+ parent_type = %info. parent_type,
142
+ return_type = %info. return_type,
143
+ ) )
144
+ } else {
145
+ Some ( span ! (
146
+ target: "async_graphql::graphql" ,
147
+ Level :: INFO ,
148
+ "field" ,
149
+ path = %info. path_node,
150
+ parent_type = %info. parent_type,
151
+ return_type = %info. return_type,
152
+ ) )
153
+ }
143
154
} else {
144
155
None
145
156
} ;
You can’t perform that action at this time.
0 commit comments