dd-trace-js
dd-trace-js copied to clipboard
Replace manual.keep tag usage with an specific method to keep the span
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 setsUSER_KEEP
priority, allowing to specify the sampling mechanism. - Replace the usage of
manual.keep
tag in appsec and iast modules with theDatadogSpan.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
- [ ] Unit tests.
- [ ] TypeScript definitions.
- [ ] TypeScript tests.
- [ ] API documentation.
- [ ] CircleCI jobs/workflows.
- [ ] Plugin is exported.