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: Syntax and Configuration (Alloy Language: River)
As part of a Grafana training or observability training, master the declarative syntax of Grafana...
OpenTelemetry Collector, Grafana Alloy et Bindplane : comparer trois approches des pipelines de télémétrie
Comparatif détaillé de trois façons de gérer des pipelines de télémétrie : l'OpenTelemetry Collec...
Grafana Alloy: Understanding and exploiting the User Interface (UI)
Discover how to enable, secure, and use Grafana Alloy's built-in web interface to visualize your ...
Grafana Alloy: Introduction and Architecture
Discover the fundamental concepts of Grafana Alloy, the transition from the static Agent to Alloy...
Grafana Alloy: Continuous Profiling with Pyroscope
Discover how to configure continuous profiling in your environments using Grafana Alloy and Pyros...
Grafana Alloy: Advanced Deployment and Clustering
Learn how to manage large-scale Grafana Alloy deployments. Configure Clustering mode for high ava...
Référence des Composants Grafana Alloy
Un guide de référence complet sur tous les composants disponibles dans Grafana Alloy, organisé pa...
Grafana Alloy vs Dynatrace ActiveGate: Which to choose?
Comparison between Grafana Alloy and Dynatrace ActiveGate. Understand the fundamental differences...
Grafana Alloy : Collecter les métriques système et les logs locaux
Découvrez comment configurer Grafana Alloy pour superviser le serveur sur lequel il s'exécute, av...