Skip to content

Commit

Permalink
Merge pull request #1430 from DataDog/ruby-sinatra-tag
Browse files Browse the repository at this point in the history
Prevent finding rid in non-service entry spans
  • Loading branch information
lloeki authored Jul 28, 2023
2 parents 8555f4e + 0abc8a2 commit 18afda4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utils/interfaces/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,16 @@ def get_rid_from_span(span):
return None

meta = span.get("meta", {})
metrics = span.get("metrics", {})

user_agent = None

if span.get("type") == "rpc":
user_agent = meta.get("grpc.metadata.user-agent")
# java does not fill this tag; it uses the normal http tags

if not user_agent:
# code version
if not user_agent and metrics.get("_dd.top_level") == 1.0:
# The top level span (aka root span) is mark via the _dd.top_level tag by the tracers
user_agent = meta.get("http.request.headers.user-agent")

if not user_agent: # try something for .NET
Expand Down

0 comments on commit 18afda4

Please sign in to comment.