Skip to content

OpenTelemetry

Oleg Demeshev edited this page Aug 27, 2026 · 1 revision

The setup comes with Grafana OTel-LGTM support, an all-in-one OpenTelemetry backend for development. The otel-lgtm container bundles an OpenTelemetry Collector, Loki (logs), Tempo (traces), Prometheus (metrics) and Grafana, so you can view telemetry emitted by your Totara sites.

Starting the backend

The otel-lgtm container does not start by default. To start it run:

tup otel-lgtm

If you want it to start alongside your usual containers, add otel-lgtm to DEFAULT_CONTAINERS in your .env file.

Sending telemetry

The collector accepts OTLP over HTTP on port 4318:

  • From your PHP containers use http://otel-lgtm:4318
  • From your host machine (e.g. scripts running outside Docker) use http://localhost:4318

If your Totara version has a telemetry collector endpoint setting, point it at http://otel-lgtm:4318.

The PHP 8.4 and 8.5 containers also pass through the standard OTEL_* environment variables, so you can use OpenTelemetry's PHP auto-instrumentation. This is opt-in: uncomment the OTEL_* block in your .env file (see .env.dist) and recreate the PHP container.

Viewing telemetry

Go to http://localhost:3000 to open the Grafana GUI.

  • Logs: Explore > Loki, e.g. query {service_name="totara"}
  • Traces: Explore > Tempo
  • Metrics: Explore > Prometheus

Telemetry data is not persisted. Recreating the container gives you a clean slate.

Clone this wiki locally