waffle-commons/telemetry-otel

OpenTelemetry SDK bridge for Waffle Commons: implements the framework TracerInterface with W3C trace-context propagation, keeping the OTel SDK out of the core perimeter.

Maintainers

Package info

github.com/waffle-commons/telemetry-otel

pkg:composer/waffle-commons/telemetry-otel

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.0-beta5 2026-07-08 15:57 UTC

This package is auto-updated.

Last update: 2026-07-08 17:44:49 UTC


README

Discord PHP Version Require PHP CI codecov Latest Stable Version Packagist License

Waffle Commons — Telemetry (OpenTelemetry Bridge)

OpenTelemetry SDK bridge for the Waffle Commons framework. It implements Waffle\Commons\Contracts\Telemetry\TracerInterface on top of the audited OpenTelemetry PHP SDK and propagates W3C Trace Context on outbound HTTP calls — isolating the vendor SDK in this adapter so the core packages stay vendor-free.

Status: shipped in Beta 5 / AXE 5 (RFC-005). The SDK-free defaults, the Prometheus endpoint and the metric collectors live in waffle-commons/telemetry.

What's inside

  • Tracer adaptersTrace\OtelTracer, Trace\OtelSpan and Trace\OtelSpanContext adapt the OpenTelemetry SDK to the framework's Contracts\Telemetry\TracerInterface / SpanInterface / SpanContextInterface. The SDK owns the active-context stack, so the adapters hold no per-request worker state.
  • W3C propagationPropagation\W3CTraceContextPropagator injects / extracts traceparent + tracestate, enabling transparent distributed tracing across services.
  • FactoryFactory\OtelTracerFactory assembles a tracer from any SpanExporterInterface (or a console JSON exporter for local docker logs inspection), keeping every OpenTelemetry\SDK\* symbol out of the core perimeter.

Perimeter

The only Waffle package permitted to require the OpenTelemetry SDK (open-telemetry/*). Depends on waffle-commons/contracts plus the OTel SDK; mago guard is configured to allow the SDK here and nowhere else. The request-scoped trace-context holder implements ResettableInterface (wfl igor 0 KO).

Development

composer install
composer mago     # fmt + lint + analyze + guard — must be ZERO output
composer tests    # PHPUnit 12.5, >=95% coverage
composer igor     # worker-safety audit — 0 KO

License

MIT — see LICENSE.md.