The keepsuit/laravel-opentelemetry package hooks OpenTelemetry into Laravel's HTTP kernel, database, queue, cache and logging. Install it, set a few variables in .env, and requests, queries and jobs reach Maple as traces.
composer require keepsuit/laravel-opentelemetry
php artisan vendor:publish \
--provider="Keepsuit\LaravelOpenTelemetry\LaravelOpenTelemetryServiceProvider" \
--tag="opentelemetry-config" # .env
OTEL_SERVICE_NAME=my-laravel-app
OTEL_TRACES_EXPORTER=otlp
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.maple.dev
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer YOUR_INGEST_KEY"
OTEL_RESOURCE_ATTRIBUTES="deployment.environment.name=production" // config/logging.php
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'otlp'],
],
], This is the short path. The full Laravel guide covers the rest.
Organization in the EU region? Send to https://ingest.eu.maple.dev instead of https://ingest.maple.dev. An ingest key only works in its own region.
What you get
A server span per request, named after its method and route, and the http.server.request.duration metric.
A span per statement with the standard db.* attributes, which draw the database node on the service map.
Producer and consumer spans, with the trace context carried across the queue to the worker.
A client span per outgoing request, with traceparent sent to the service you call.
Redis commands as spans, cache hits and misses as span events, and a span per view or Livewire render.
Log records go to Maple with the active trace id attached, so each line links to its request.
http/protobuf falls back to the slow pure-PHP protobuf library. Install the protobuf C extension for production, or set the protocol to http/json, which Maple also accepts.
After editing .env, run php artisan config:clear. A cached config keeps exporting with the old values, or not at all.
Each instrumentation has its own OTEL_INSTRUMENTATION_* variable, such as OTEL_INSTRUMENTATION_QUERY=false. Keep queries on: they feed the service map.
Add the SDK, point your OTLP exporter at Maple, and traces arrive.
maple.dev: observability on OpenTelemetry