From 7b03f4e91f2025b5fde3c899fcb2b3d8fdf6cbec Mon Sep 17 00:00:00 2001 From: Andrew Kent Date: Thu, 18 Jan 2018 11:19:33 -0500 Subject: [PATCH] priority sampling values --- dd-trace-ot/dd-trace-ot.gradle | 1 + .../common/sampling/PrioritySampling.java | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 dd-trace-ot/src/main/java/datadog/trace/common/sampling/PrioritySampling.java diff --git a/dd-trace-ot/dd-trace-ot.gradle b/dd-trace-ot/dd-trace-ot.gradle index fa14e46701..05d4dfaeab 100644 --- a/dd-trace-ot/dd-trace-ot.gradle +++ b/dd-trace-ot/dd-trace-ot.gradle @@ -14,6 +14,7 @@ whitelistedInstructionClasses += whitelistedBranchClasses += [ 'datadog.trace.common.writer.ListWriter', 'datadog.trace.common.util.Clock', 'datadog.trace.api.DDTags', + 'datadog.trace.common.sampling.PrioritySampling' ] dependencies { diff --git a/dd-trace-ot/src/main/java/datadog/trace/common/sampling/PrioritySampling.java b/dd-trace-ot/src/main/java/datadog/trace/common/sampling/PrioritySampling.java new file mode 100644 index 0000000000..aca9c67852 --- /dev/null +++ b/dd-trace-ot/src/main/java/datadog/trace/common/sampling/PrioritySampling.java @@ -0,0 +1,20 @@ +package datadog.trace.common.sampling; + +public class PrioritySampling { + /** + * Implementation detail of the client. will not be sent to the agent or propagated. + * + *

Internal value used when the priority sampling flag has not been set on the span context. + */ + public static final int UNSET = Integer.MIN_VALUE; + /** The sampler has decided to drop the trace. */ + public static final int SAMPLER_DROP = 0; + /** The sampler has decided to keep the trace. */ + public static final int SAMPLER_KEEP = 1; + /** The user has decided to drop the trace. */ + public static final int USER_DROP = -1; + /** The user has decided to keep the trace. */ + public static final int USER_KEEP = 2; + + private PrioritySampling() {} +}