Deployment guide

Grafana Tempo and OpenTelemetry: distributed tracing on VPS

Deploy on a VPS Cloud →

Security & Monitoring7 min read

Grafana Tempo and OpenTelemetry: distributed tracing on VPS

Proprietary agents such as Datadog or New Relic charge for observability per feature, gradually locking you into their ecosystem. OpenTelemetry and Grafana Tempo offer a CNCF-graduated, backend-portable alternative that you can deploy entirely on your own VPS in under an hour.

Why choose OpenTelemetry over a proprietary agent

OpenTelemetry is a CNCF-graduated project that unifies the three pillars of observability — traces, metrics and logs — under a vendor-neutral standard. Unlike Datadog or New Relic agents, the OTel Collector receives, transforms and exports telemetry to any compatible backend. You can switch storage without touching your application code. SDKs cover Node.js, Python, Go, Java, PHP, Ruby and most modern languages, making it a durable instrumentation foundation regardless of your stack.

What the OTel + Grafana Tempo stack gives you

  • Index-free distributed tracing — Grafana Tempo v2.x stores traces in compressed blocks (parquet) on local disk or object storage, with no Cassandra or Elasticsearch required.
  • TraceQL queries — Tempo's dedicated query language lets you filter traces by duration, service, error status or custom attributes in seconds.
  • Multi-protocol compatibility — Tempo accepts OTLP, Zipkin and Jaeger, so your existing applications connect without re-instrumentation.
  • Lightweight on VPS — 2 GB of RAM is enough for a dev or staging environment; in production under load, 4 GB provides a comfortable margin.
  • Controlled cost — a self-hosted VPS at 99 DH/month/month replaces a Datadog APM subscription billed at approximately $23 per host per month.

VPS prerequisites

Your VPS must have at least 2 GB of RAM and root or sudo access. Docker Engine and Docker Compose v2 must be installed. Prepare a dedicated subdomain (for example grafana.your-domain.com) to expose the Grafana interface behind a TLS reverse proxy. Ports 4317 (OTLP/gRPC) and 4318 (OTLP/HTTP) must be open in your firewall to receive telemetry from your applications.

Deploy the OTel stack in five steps

01

Create the Docker Compose structure

Organise an otel-stack/ folder containing your configuration files and a docker-compose.yml. Define four services: otel-collector, tempo, prometheus and grafana. Connect them on an internal Docker network called monitoring. Mount a named volume tempo-data for trace persistence on the VPS disk.

02

Configure the OTel Collector (`otelcol-config.yaml`)

Declare two receivers: otlp on ports 4317 (gRPC) and 4318 (HTTP). In the exporters section, add otlp/tempo pointing to tempo:4317 and prometheus on port 8889. The traces pipeline connects the OTLP receiver to the Tempo exporter; the metrics pipeline connects the OTLP receiver to the Prometheus exporter.

03

Configure Grafana Tempo (`tempo-config.yaml`)

Enable the OTLP receiver (gRPC on port 4317). Set the storage backend to local mode with path /var/tempo. Enable the search feature to allow TraceQL queries from Grafana. For production use, replace the local backend with s3 or gcs and supply your object storage credentials.

04

Launch Grafana with Tempo and Prometheus datasources

Mount a provisioning file datasources.yaml in the /etc/grafana/provisioning/datasources/ folder. Declare two datasources: a Tempo one pointing to http://tempo:3200 and a Prometheus one to http://prometheus:9090. Start everything with docker compose up -d. Open Grafana on port 3000 and verify that both datasources show green.

05

Instrument a first Node.js or Python application

For Node.js, install @opentelemetry/sdk-node and @opentelemetry/auto-instrumentations-node. Initialise the SDK with the OTLP exporter pointing to http://your-vps:4318 and set the OTEL_SERVICE_NAME environment variable to your service name. For Python, use opentelemetry-distro and opentelemetry-exporter-otlp. Restart your application and open Grafana Explore to see your first traces appear.

TraceQL is Grafana Tempo's native query language. It lets you filter traces by duration, service, HTTP status or custom attribute. For example, the query { duration > 500ms && status = error } immediately isolates slow, failing calls across your entire infrastructure. Combine multiple conditions with && or || to refine a diagnosis without scrolling through thousands of spans manually.

Going further: correlating traces, metrics and logs

Add Grafana Loki to your stack to centralise application logs in the same environment. Grafana Explore lets you jump from a trace to its associated logs in one click, then check the corresponding Prometheus metrics over the same time window. If you prefer a single all-in-one binary, OpenObserve is a lightweight alternative that bundles traces, metrics and logs in a single service — also available as a self-hosted option on VPS.

Grafana est dans le catalogue ServOrbit

Déployez Grafana en un clic depuis notre Marketplace et connectez-y votre stack OTel + Tempo sans configuration manuelle.

Need help?

Browse our help center and FAQ, or write to our team — support in French, English and Arabic.