A deep-dive into instrumenting WordPress with OpenTelemetry, covering PHP distributed tracing, database query instrumentation, browser RUM, error capture, and security event tracking. The post walks through a modular WordPress plugin architecture with five components: a PHP tracer using the OTel PHP SDK, an error handler capturing fatals and wp_die() calls, browser RUM via the OTel JavaScript SDK with Core Web Vitals collection, user context enrichment, and a hierarchical configuration system. Production considerations include performance benchmarks (3.3% overhead without sampling, ~0% with 10% sampling), sampling strategies, GDPR handling for user PII, and graceful degradation. Known limitations include missing outbound traceparent injection and lack of metrics/logs signals.
Table of contents
Problem StatementArchitecture OverviewCore Implementation Deep-DiveProduction ConsiderationsImplementation PatternsKnown Limitations and Future WorkDeploymentGet Full Observability for Your WordPress StackReferencesSort: