2. Transformation and Sampling #
Adapting spans and sampling.
Optimizing trace storage #
The volume of data generated by distributed tracing can be colossal. Alloy's processor components (otelcol.processor) allow you to transform data in flight: modify span attributes, mask sensitive information (PII), and importantly, apply sampling strategies. You can configure probabilistic sampling to keep only a certain percentage of traces, or use tail-based sampling to specifically keep traces with errors or that are particularly slow, before sending them to Grafana Tempo via otelcol.exporter.otlp.
Best Practice: Use the otelcol.processor.tail_sampling component to implement intelligent sampling. Keep 100% of traces containing errors or abnormal latency, but only 5% of normal success traces. This significantly reduces your Tempo costs.Common Mistake: Sending the entirety (100%) of traces from a high-traffic application directly to Tempo. This causes network saturation, very high costs, and overall slow exploration.
otelcol.processor.tail_sampling "smart_sampler" {
policy {
name = "keep-errors"
type = "status_code"
status_code {
status_codes = ["ERROR"]
}
}
policy {
name = "probabilistic-success"
type = "probabilistic"
probabilistic {
sampling_percentage = 5
}
}
output {
metrics = [otelcol.exporter.otlp.tempo.input]
}
}My progress
Sign in to track your progress and take notes. Sign in
Course Glossary
Grafana Alloy
An open-source, vendor-neutral telemetry collector designed to replace Grafana Agent, fully compatible with OpenTelemetry (OTel).
Recommended Articles
Grafana Alloy : Collecte et Transformation de Télémétrie
Apprenez à utiliser Grafana Alloy pour collecter, transformer et acheminer logs, métriques et tra...
Grafana Tempo : le backend de traces distribuées à grande échelle
Comprendre le tracing distribué et Grafana Tempo : traces, spans, TraceID, architecture (distribu...
La stack LGTM (Loki, Grafana, Tempo, Mimir) : architecture et mise en place
Comprendre la stack LGTM de Grafana Labs : Loki pour les logs, Grafana pour la visualisation, Tem...
Grafana Alloy: Log Management with Loki
Discover how to configure Grafana Alloy to read log files, journald, or network streams, process ...
Envoyer des traces vers Tempo : instrumentation OpenTelemetry et Alloy
Produire et acheminer des traces vers Tempo : auto-instrumentation Python/Java/Node, SDK manuel, ...
Bonnes Pratiques Grafana Alloy : Optimiser sa Collecte de Télémétrie
Découvrez les règles d'or pour configurer Grafana Alloy de manière robuste : modularité, gestion ...
Grafana Alloy: Metrics Collection (Prometheus & Ecosystem)
Learn how to configure Grafana Alloy to collect, transform, and forward metrics using the Prometh...
Grafana Alloy vs Grafana Agent vs Promtail : Lequel choisir ?
Découvrez l'évolution des collecteurs de télémétrie de l'écosystème Grafana. Comparatif détaillé ...
Grafana Alloy: The importance of Self-Monitoring
Discover why and how to configure Grafana Alloy so that it monitors itself, collecting its own lo...