1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/jaeger-config-sampling.adoc
2020-08-28 18:26:27 +00:00

76 lines
2.8 KiB
Plaintext

////
This REFERENCE module included in the following assemblies:
-rhbjaeger-deploy.adoc
////
[id="jaeger-config-sampling_{context}"]
= Jaeger sampling configuration options
The Operator can be used to define sampling strategies that will be supplied to tracers that have been configured to use a remote sampler.
While all traces are generated, only a few are sampled. Sampling a trace marks the trace for further processing and storage.
[NOTE]
====
This is not relevant if a trace was started by the Istio proxy as the sampling decision is made there. The Jaeger sampling decision is only relevant when the trace is started by an application using the Jaeger tracer.
====
When a service receives a request that contains no trace context, the Jaeger tracer will start a new trace, assign it a random trace ID, and make a sampling decision based on the currently installed sampling strategy. The sampling decision is propagated to all subsequent requests in the trace, so that other services are not making the sampling decision again.
Jaeger libraries support the following samplers:
* *Constant* - The sampler always makes the same decision for all traces. It either samples all traces (sampling.param=1) or none of them (sampling.param=0).
* *Probabilistic* - The sampler makes a random sampling decision with the probability of sampling equal to the value of the `sampling.param` property. For example, with sampling.param=0.1 approximately 1 in 10 traces will be sampled.
* *Rate Limiting* - The sampler uses a leaky bucket rate limiter to ensure that traces are sampled with a certain constant rate. For example, when sampling.param=2.0 it will sample requests with the rate of 2 traces per second.
* *Remote* - The sampler consults the Jaeger agent for the appropriate sampling strategy to use in the current service. This allows controlling the sampling strategies in the services from a central configuration in the Jaeger backend.
.Jaeger sampling parameters
[options="header"]
[cols="l, a, a, a"]
|===
|Parameter |Description |Values |Default value
|spec:
sampling:
options: {}
|Configuration options that define the sampling strategies for tracing.
|
|
|sampling:
type:
|Sampling strategy to use. (See descriptions above.)
|Valid values are `const`, `probabilistic`, `ratelimiting`, and `remote`.
|`remote`
|sampling:
options:
type:
param:
|Parameters for the selected sampling strategy. (See examples above.)
|Decimal and integer values (0, .1, 1, 10)
|N/A
|===
This example defines a default sampling strategy that is probabilistic, with a 50% chance of the trace instances being sampled.
.Probabilistic sampling example
[source,yaml]
----
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
name: with-sampling
spec:
strategy: allInOne
sampling:
options:
default_strategy:
type: probabilistic
param: 50
----