File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
ext/opentelemetry-ext-datadog
src/opentelemetry/ext/datadog Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -191,9 +191,7 @@ def _get_span_name(span):
191
191
def _get_resource (span ):
192
192
"""Get resource name for span"""
193
193
if "http.method" in span .attributes :
194
- route = span .attributes .get (
195
- "http.route" , span .attributes .get ("http.path" )
196
- )
194
+ route = span .attributes .get ("http.route" )
197
195
return (
198
196
span .attributes ["http.method" ] + " " + route
199
197
if route
Original file line number Diff line number Diff line change @@ -222,8 +222,8 @@ def test_export(self):
222
222
def test_resources (self ):
223
223
test_attributes = [
224
224
{},
225
- {"http.method" : "GET" , "http.route" : "/foo" },
226
- {"http.method" : "GET" , "http.path " : "/foo" },
225
+ {"http.method" : "GET" , "http.route" : "/foo/<int:id> " },
226
+ {"http.method" : "GET" , "http.target " : "/foo/200 " },
227
227
]
228
228
229
229
for index , test in enumerate (test_attributes ):
@@ -235,7 +235,7 @@ def test_resources(self):
235
235
self .assertEqual (len (datadog_spans ), 3 )
236
236
237
237
actual = [span ["resource" ] for span in datadog_spans ]
238
- expected = ["0" , "GET /foo" , "GET /foo " ]
238
+ expected = ["0" , "GET /foo/<int:id> " , "GET" ]
239
239
240
240
self .assertEqual (actual , expected )
241
241
You can’t perform that action at this time.
0 commit comments