Tail sampling is a sampling strategy that samples spans/traces after they are received by the OpenTelemetry Collector based on certain conditions. This can be used to get rid of traces triggered by e.g. Kubernetes liveness/readiness probes or Prometheus scrape jobs.
config:
processors:
tail_sampling/probefilter:
policies: [
{
name: filter_k8s_probe_traces_user_agent,
type: string_attribute,
string_attribute: {
key: http.user_agent,
values: [ "kube-probe/*", "Prometheus/*" ],
enabled_regex_matching: true,
invert_match: true
}
},
{
name: filter_k8s_probe_traces_user_agent2,
type: string_attribute,
string_attribute: {
key: user_agent.original,
values: [ "kube-probe/*", "Prometheus/*" ],
enabled_regex_matching: true,
invert_match: true
}
}
]