Skip to content
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

Merged
merged 6 commits into from
Jan 19, 2018

Conversation

ufoot
Copy link
Member

@ufoot ufoot commented Dec 26, 2017

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.

@ufoot ufoot added this to the 0.11.0 milestone Dec 26, 2017
@ufoot ufoot requested review from talwai and AlexJF December 27, 2017 07:56
AlexJF
AlexJF previously approved these changes Dec 27, 2017
Copy link
Contributor

@AlexJF AlexJF left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asked to*

talwai
talwai previously approved these changes Dec 27, 2017
Copy link

@palazzem palazzem left a 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.
Copy link

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

@palazzem palazzem merged commit ea7f625 into master Jan 19, 2018
@palazzem palazzem deleted the christian/dualsampling branch January 19, 2018 22:35
@palazzem palazzem modified the milestones: 0.11.0, 0.10.1 Jan 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants