Greek Developer
| #infrastructure #grafana #tempo #docker #podman #tracing #observability #opentelemetry

Infrastructure Setup: Grafana & Tempo

Quick setup scripts for Grafana and Tempo distributed tracing using Docker or Podman

Quick setup scripts for running Grafana and Tempo containers for distributed tracing using Docker Desktop or Podman Desktop.

Tempo Configuration File

Create tempo-config.yml with the following configuration:

server:
  http_listen_port: 3200

distributor:
  receivers:
    otlp:
      protocols:
        http:
        grpc:

storage:
  trace:
    backend: local
    local:
      path: ./data/tempo/blocks
    wal:
      path: ./data/wal/blocks

This configuration enables:

  • HTTP API on port 3200
  • OTLP receivers for both HTTP and gRPC protocols
  • Local storage for traces and write-ahead log

Setup with Podman Desktop

# Cleanup existing containers
podman rm gdev-grafana -f
podman rm gdev-tempo -f

# Create network for container communication
podman network create gdev-net

# Run Grafana and Tempo containers
podman run --network gdev-net --name gdev-grafana -d -p 3000:3000 grafana/grafana
podman run --network gdev-net --name gdev-tempo -d -p 3200:3200 -p 4317:4317 -v ./tempo-config.yml:/etc/tempo-config.yml grafana/tempo "-config.file=/etc/tempo-config.yml"

# Note: Grafana default credentials are admin/admin

Save as setup-with-podman.ps1 and run in PowerShell.

Setup with Docker Desktop

# Cleanup existing containers
docker rm gdev-grafana -f
docker rm gdev-tempo -f

# Create network for container communication  
docker network create gdev-net

# Run Grafana and Tempo containers
docker run --network gdev-net --name gdev-grafana -d -p 3000:3000 grafana/grafana
docker run --network gdev-net --name gdev-tempo -d -p 3200:3200 -p 4317:4317 -v ./tempo-config.yml:/etc/tempo-config.yml grafana/tempo "-config.file=/etc/tempo-config.yml"

# Note: Grafana default credentials are admin/admin

Save as setup-with-docker.ps1 and run in PowerShell.

Setup Validation

Verify that both services are running correctly:

# Check Grafana health
curl -i http://localhost:3000/api/health

# Check Tempo readiness
curl -i http://localhost:3200/ready

Wait until both endpoints return HTTP 200 status code.

Port Configuration

  • 3000: Grafana web interface
  • 3200: Tempo HTTP API
  • 4317: Tempo OTLP gRPC receiver

Access URLs

  • Grafana Dashboard: http://localhost:3000
  • Tempo API: http://localhost:3200
  • Tempo Metrics: http://localhost:3200/metrics

Default Credentials

  • Username: admin
  • Password: admin

Container Management

# Stop containers
docker stop gdev-grafana gdev-tempo
# or
podman stop gdev-grafana gdev-tempo

# Start containers
docker start gdev-grafana gdev-tempo
# or
podman start gdev-grafana gdev-tempo

# View logs
docker logs gdev-grafana
docker logs gdev-tempo

Data Storage

Tempo stores trace data in the ./data/tempo/blocks directory and write-ahead logs in ./data/wal/blocks. Make sure these directories are writable by the container.

OpenTelemetry Integration

Applications can send traces to Tempo using:

# OTLP HTTP endpoint
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:3200/v1/traces

# OTLP gRPC endpoint  
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:4317

Grafana Data Source

Add Tempo as a data source in Grafana:

  • URL: http://gdev-tempo:3200 (container network)
  • URL: http://localhost:3200 (host network)

Use Cases

  • Distributed tracing collection
  • Microservices observability
  • Performance monitoring
  • Request flow visualization
  • Trace correlation with logs and metrics