-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dual sampling] support -1 as a priority sampling value #391
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
docs/index.rst
Outdated
@@ -358,7 +358,8 @@ Priority sampling | |||
Priority sampling consists in deciding if a trace will be kept by using a `priority` attribute that will be propagated | |||
for distributed traces. Its value gives indication to the Agent and to the backend on how important the trace is. | |||
|
|||
- 0: Don't keep the trace. | |||
- -1: The user asked not to keep the trace. | |||
- 0: The sampler automatically decided not to keep the trace. | |||
- 1: The sampler automatically decided to keep the trace. | |||
- 2: The user asked the keep the trace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asked to*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a question about values.
docs/index.rst
Outdated
@@ -358,9 +358,10 @@ Priority sampling | |||
Priority sampling consists in deciding if a trace will be kept by using a `priority` attribute that will be propagated | |||
for distributed traces. Its value gives indication to the Agent and to the backend on how important the trace is. | |||
|
|||
- 0: Don't keep the trace. | |||
- -1: The user asked not to keep the trace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same suggestions for other tracers. What if we provide a module with priority values? something like http://www.django-rest-framework.org/api-guide/status-codes/#status-codes
# NOTE: all names are just an examples
from ddtrace.ext import priority
# somewhere in the code
ctx.sampling_priority = priority.KEEP_TRACE
484145c
to
20dd515
Compare
31915fb
to
416ce8d
Compare
Allow usage of
-1
as a priority sampling value. Here there's no real impact, it's mostly about writing tests ensuring this works and updating the docs.