Skip to content

Commit

Permalink
Skip distributed tracing if standalone appsec is enabled and trace co…
Browse files Browse the repository at this point in the history
…ntains no appsec event
  • Loading branch information
vpellan committed Sep 23, 2024
1 parent 2ed7fbd commit 3f4ea1f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/datadog/tracing/contrib/http/circuit_breaker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ def internal_request?(request)
end

def should_skip_distributed_tracing?(client_config)
if Datadog.configuration.appsec.standalone.enabled
active_trace = Tracing.active_trace

# return true if absence of upstream ASM event (_dd.p.appsec:1)
# and no local security event (which sets _dd.p.appsec:1 locally)
return active_trace.nil? || active_trace.get_tag(Datadog::AppSec::Ext::TAG_APPSEC_EVENT) != '1'
end

return !client_config[:distributed_tracing] if client_config && client_config.key?(:distributed_tracing)

!Datadog.configuration.tracing[:http][:distributed_tracing]
Expand Down

0 comments on commit 3f4ea1f

Please sign in to comment.