Open source

Set up Alloy to remote-write to Tempo

This section uses a Grafana Alloy Helm chart deployment to send traces to Tempo.

To do this, you need to create a configuration that can be used by Alloy to receive and export traces in OTLP protobuf format.

  1. Create a new values.yaml file which we’ll use as part of the Alloy install.

  2. Edit the values.yaml file and add the following configuration to it:

    YAML
    alloy:
      extraPorts:
        - name: otlp-grpc
          port: 4317
          targetPort: 4317
          protocol: TCP
      configMap:
        create: true
        content: |-
          // Creates a receiver for OTLP gRPC.
          // You can easily add receivers for other protocols by using the correct component
          // from the reference list at: https://grafana.com/docs/alloy/latest/reference/components/
          otelcol.receiver.otlp "otlp_receiver" {
            // Listen on all available bindable addresses on port 4317 (which is the
            // default OTLP gRPC port) for the OTLP protocol.
            grpc {
              endpoint = "0.0.0.0:4317"
            }
    
            // Output straight to the OTLP gRPC exporter. We would usually do some processing
            // first, most likely batch processing, but for this example we pass it straight
            // through.
            output {
              traces = [
                otelcol.exporter.otlp.tempo.input,
              ]
            }
          }
    
          // Define an OTLP gRPC exporter to send all received traces to Tempo.
          // The unique label 'tempo' is added to uniquely identify this exporter.
          otelcol.exporter.otlp "tempo" {
              // Define the client for exporting.
              client {
                 // Send to the Tempo distributor on port 4317 (OTLP gRPC).
                 endpoint = "distributor.tempo.svc.cluster.local:4317"
                  // Disable TLS for OTLP export.
                  tls {
                      // The connection is insecure.
                      insecure = true
                      // Do not verify TLS certificates when connecting.
                      insecure_skip_verify = true
                  }
              }
          }

    Update the distributor endpoint to match your deployment. The service name and namespace depend on how you deployed Tempo:

    • Tanka: distributor.<NAMESPACE>.svc.cluster.local:4317
    • Helm: <RELEASE-NAME>-distributor.<NAMESPACE>.svc.cluster.local:4317
  3. Deploy Alloy using Helm:

    Bash
    helm install -f values.yaml grafana-alloy grafana/alloy

    If you deploy Alloy into a specific namespace, create the namespace first and specify it to Helm by appending --namespace=<grafana-alloy-namespace> to the end of the command.