public class SamplerConfig extends BaseConfig
The following config options are supported via YAML, system properties, or environment variables, where ROOT/root can any of the defined samplers: 'root', 'remote_parent_sampled', or 'remote_parent_not_sampled'.
Environment Variables:
NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_ROOT: 'default' NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_ROOT: 'adaptive' NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_ROOT: 'always_on' NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_ROOT: 'always_off' NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_ROOT: 'trace_id_ratio_based' NEW_RELIC_DISTRIBUTED_TRACING_SAMPLER_ROOT_TRACE_ID_RATIO_BASED_RATIO: '0.1'
System Properties:
-Dnewrelic.config.distributed_tracing.sampler.root=default -Dnewrelic.config.distributed_tracing.sampler.root=adaptive -Dnewrelic.config.distributed_tracing.sampler.root=always_on -Dnewrelic.config.distributed_tracing.sampler.root=always_off -Dnewrelic.config.distributed_tracing.sampler.root=trace_id_ratio_based -Dnewrelic.config.distributed_tracing.sampler.root.trace_id_ratio_based.ratio=0.1
YAML:
Yaml supports both of the following formats for specifying the sampler and sampler type:
distributed_tracing:
sampler:
root:
default:
OR
distributed_tracing:
sampler:
root: default
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ADAPTIVE |
static java.lang.String |
ADAPTIVE_SAMPLING_TARGET |
static java.lang.String |
ALWAYS_OFF |
static java.lang.String |
ALWAYS_ON |
static java.lang.String |
DEFAULT |
static java.lang.Integer |
DEFAULT_ADAPTIVE_SAMPLING_PERIOD |
static java.lang.Integer |
DEFAULT_ADAPTIVE_SAMPLING_TARGET |
static java.lang.String |
DEFAULT_SAMPLER_TYPE |
static java.lang.String |
RATIO |
static java.lang.String |
REMOTE_PARENT_NOT_SAMPLED |
static java.lang.String |
REMOTE_PARENT_SAMPLED |
static java.lang.String |
ROOT |
static java.lang.String |
SAMPLER_CONFIG_ROOT |
static java.lang.String |
TRACE_ID_RATIO_BASED |
addDeprecatedProperties, COMMA_SEPARATOR, deprecatedProperties, SEMI_COLON_SEPARATOR, systemPropertyPrefix| Constructor and Description |
|---|
SamplerConfig(java.lang.String sampler,
java.util.Map<java.lang.String,java.lang.Object> props,
java.lang.String parentRoot) |
| Modifier and Type | Method and Description |
|---|---|
int |
getAdaptiveSamplingTarget() |
java.lang.String |
getSampler() |
java.lang.Float |
getSamplerRatio() |
java.lang.String |
getSamplerType() |
addDeprecatedProperty, castValue, clearDeprecatedProperties, getDoubleProperty, getIntegerSet, getIntProperty, getProperties, getProperty, getProperty, getPropertyFromSystemEnvironment, getPropertyFromSystemProperties, getStringPropertyOrNull, getSystemPropertyKey, getUniqueStrings, getUniqueStrings, getUniqueStringsFromCollection, getUniqueStringsFromCollection, getUniqueStringsFromString, nestedPropspublic static final java.lang.String SAMPLER_CONFIG_ROOT
public static final java.lang.String ADAPTIVE_SAMPLING_TARGET
public static final java.lang.Integer DEFAULT_ADAPTIVE_SAMPLING_TARGET
public static final java.lang.Integer DEFAULT_ADAPTIVE_SAMPLING_PERIOD
public static final java.lang.String ROOT
public static final java.lang.String REMOTE_PARENT_SAMPLED
public static final java.lang.String REMOTE_PARENT_NOT_SAMPLED
public static final java.lang.String DEFAULT
public static final java.lang.String ADAPTIVE
public static final java.lang.String ALWAYS_ON
public static final java.lang.String ALWAYS_OFF
public static final java.lang.String TRACE_ID_RATIO_BASED
public static final java.lang.String DEFAULT_SAMPLER_TYPE
public static final java.lang.String RATIO