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):
191191def _get_resource (span ):
192192 """Get resource name for span"""
193193 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" )
197195 return (
198196 span .attributes ["http.method" ] + " " + route
199197 if route
Original file line number Diff line number Diff line change @@ -222,8 +222,8 @@ def test_export(self):
222222 def test_resources (self ):
223223 test_attributes = [
224224 {},
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 " },
227227 ]
228228
229229 for index , test in enumerate (test_attributes ):
@@ -235,7 +235,7 @@ def test_resources(self):
235235 self .assertEqual (len (datadog_spans ), 3 )
236236
237237 actual = [span ["resource" ] for span in datadog_spans ]
238- expected = ["0" , "GET /foo" , "GET /foo " ]
238+ expected = ["0" , "GET /foo/<int:id> " , "GET" ]
239239
240240 self .assertEqual (actual , expected )
241241
You can’t perform that action at this time.
0 commit comments