Skip to content
← All packages

Statamic Telemetry

alpha

Statamic overlay for Telemetry for Laravel. Content-aware trace names, Stache and static cache instrumentation, site context and user attribution as a proper Statamic addon.

Statamic Telemetry teaches Telemetry for Laravel Statamic's vocabulary. The core package already traces requests, queries, queue jobs and cache operations. This addon renames and enriches those signals with what actually matters in a Statamic site: which entry rendered, which collection it belongs to, whether the static cache hit, and what the Stache is doing.

Traces That Speak Statamic

Content-Aware Span Names

Every Statamic frontend request goes through one catch-all route, so default span names collapse to a single useless value. Entry requests become GET entry:blog.article, term requests GET term:topics. Bounded names, raw route kept as an attribute.

Static Cache Visibility

Hit, miss and write outcome on the root span plus operation counters. Also fixes a subtle replay bug: the trace id header is stripped before the half-measure cacher snapshots it into the cached response.

Stache Instrumentation

Cache keys classified into bounded groups (stache.index, stache.item, stache.meta) so counters do not drown in thousands of raw keys. Warm and clear counters, warm duration histogram.

Site Context

The site handle rides as an ambient dimension on every span in the trace and propagates into queued jobs. Multi-site debugging without guessing.

Statamic Metrics

Counters for form submissions, Glide generations per preset, content changes by type and action, search index updates and auth events. Opt-in inventory gauges for entries, assets and users.

Grafana Dashboard

Bundles a Statamic dashboard for the core Grafana suite: static cache hit ratio, Stache traffic, content changes and Tempo panels for content traces and slow uncached pages.

The catch-all route problem

Generic APM tooling groups requests by route pattern. In Statamic, nearly every frontend request matches the same catch-all pattern, so an entire site collapses into one series and one span name. You can see that something is slow, but not what. The addon resolves the actual content behind the request and names the span after it, with entry id, collection, blueprint and taxonomy as attributes on the root span. One TraceQL query finds every slow article render across the fleet.

The design notes are honest about the edges. Full-measure static cache hits never reach PHP and produce no telemetry at all. Static cache drivers are subclassed rather than decorated, because Statamic picks code paths with instanceof checks. And every listener wraps its body in a guard, so a broken listener can never break the entry save, upload or login it observes.

Built on Telemetry for Laravel

The addon requires cboxdk/laravel-telemetry and inherits its runtime model: metrics aggregate in Redis, Prometheus scrapes a route, traces ship as OTLP HTTP JSON. Everything is on by default except Antlers view spans and the inventory gauges.