Grafana Cloud

tracing block

tracing is an optional configuration block used to customize how Alloy produces traces. tracing is specified without a label and can only be provided once per configuration file.


tracing {
  sampling_fraction = 0.1

  write_to = [otelcol.exporter.otlp.tempo.input]

otelcol.exporter.otlp "tempo" {
  // Send traces to a locally running Tempo without TLS enabled.
  client {
    endpoint = env("TEMPO_OTLP_ENDPOINT")

    tls {
      insecure = true


The following arguments are supported:

sampling_fractionnumberFraction of traces to keep.0.1no
write_tolist(otelcol.Consumer)Inputs from otelcol components to send traces to.[]no

The write_to argument controls which components to send traces to for processing. The elements in the array can be any otelcol component that accept traces, including processors and exporters. When write_to is set to an empty array [], all traces are dropped.


Any traces generated before the tracing block has been evaluated,such as at the early start of the process’ lifetime, are dropped.

The sampling_fraction argument controls what percentage of generated traces should be sent to the consumers specified by write_to. When set to 1 or greater, 100% of traces are kept. When set to 0 or lower, 0% of traces are kept.


The following blocks are supported inside the definition of tracing:

samplersamplerDefine custom sampling on top of the base sampling
sampler > jaeger_remotejaeger_remoteRetrieve sampling information via a Jaeger remote

The > symbol indicates deeper levels of nesting. For example, sampler > jaeger_remote refers to a jaeger_remote block defined inside an sampler block.

sampler block

The sampler block contains a definition of a custom sampler to use. The sampler block supports no arguments and is controlled fully through inner blocks.

It’s invalid to define more than one sampler to use in the sampler block.

jaeger_remote block

The jaeger_remote block configures the retrieval of sampling information through a remote server that exposes Jaeger sampling strategies.

urlstringURL to retrieve sampling strategies from.""no
max_operationsnumberLimit number of operations which can have custom sampling.256no
refresh_intervaldurationFrequency to poll the URL for new sampling strategies."1m"no

The remote sampling strategies are retrieved from the URL specified by the url argument, and polled for updates on a timer. The frequency for how often polling occurs is controlled by the refresh_interval argument.

nameslist(string)DNS names to look up.yes
portnumberPort to use for collecting metrics. Not used for SRV records.0no
refresh_intervaldurationHow often to query DNS for updates."30s"no
typestringType of DNS record to query. Must be one of SRV, A, AAAA, or MX."SRV"no

Requests to the remote sampling strategies server are made through an HTTP GET request to the configured url argument. A service=alloy query parameter is always added to the URL to allow the server to respond with service-specific strategies. The HTTP response body is read as JSON matching the schema specified by Jaeger’s strategies.json file.

The max_operations limits the amount of custom span names that can have custom sampling rules. If the remote sampling strategy exceeds the limit, sampling decisions fall back to the default sampler.