dd-trace-js icon indicating copy to clipboard operation
dd-trace-js copied to clipboard

Replace manual.keep tag usage with an specific method to keep the span

Open iunanua opened this issue 4 months ago • 2 comments

What does this PR do?

  • Incorporate the new PrioritySampler.setPriority(span, samplingPriority, mechanism) method to allow to set an span priority directly.
  • Implement DatadogSpan.keep() method which sets USER_KEEP priority, allowing to specify the sampling mechanism.
  • Replace the usage of manual.keep tag in appsec and iast modules with the DatadogSpan.keep() method.

Motivation

Modules like appsec and iast use manual.keep tag when they want to indicate the tracer to keep the trace. But this is not entirely correct because some times priority has been set on the creation of the trace and adding manual.keep tag has no effect in the trace's priority.

Plugin Checklist

Additional Notes

iunanua avatar Sep 30 '24 14:09 iunanua