Repository URL to install this package:
Version:
1:7.26.0-1 ▾
|
datadog-agent
/
opt
/
datadog-agent
/
embedded
/
lib
/
python3.8
/
site-packages
/
ddtrace
/
ext
/
priority.py
|
---|
"""
Priority is a hint given to the backend so that it knows which traces to reject or kept.
In a distributed context, it should be set before any context propagation (fork, RPC calls) to be effective.
For example:
from ddtrace.ext.priority import USER_REJECT, USER_KEEP
context = tracer.context_provider.active()
# Indicate to not keep the trace
context.sampling_priority = USER_REJECT
# Indicate to keep the trace
span.context.sampling_priority = USER_KEEP
"""
# Use this to explicitly inform the backend that a trace should be rejected and not stored.
USER_REJECT = -1
# Used by the builtin sampler to inform the backend that a trace should be rejected and not stored.
AUTO_REJECT = 0
# Used by the builtin sampler to inform the backend that a trace should be kept and stored.
AUTO_KEEP = 1
# Use this to explicitly inform the backend that a trace should be kept and stored.
USER_KEEP = 2