specoto / trace
PSR-22 Application Tracing interfaces — intentionally minimalist tracing contracts for PHP
Requires
- php: >=8.3
This package is not auto-updated.
Last update: 2026-06-19 06:07:57 UTC
README
This package provides the proposed PSR-22 interfaces for application tracing in PHP. It contains only interfaces and enums — no concrete implementations.
This is a personal prototype based on the PSR-22 draft. Library and framework authors can depend on this package; tracing providers can implement these interfaces.
Interfaces
| Interface | Purpose |
|---|---|
TracerProviderInterface | Entry point — get a named tracer |
TracerInterface | Create spans |
SpanInterface | Read/write span data |
SpanContextInterface | W3C trace context identity |
Enums
| Enum | Values |
|---|---|
SpanKind | INTERNAL, CLIENT, SERVER, PRODUCER, CONSUMER |
SpanStatus | UNSET, OK, ERROR |
Design
This package is intentionally minimalist — it scopes itself to what library authors need to emit tracing signals, and nothing more. Transmission, batching, exporting, and context propagation are out of scope.
See the PSR-22 meta document for the full rationale:
"This standard aims to create an intentionally minimalist set of interfaces that can be used to provide tracing signals to 3rd party libraries in a unified manner."
"By taking transmission mechanisms out of scope for this PSR, we drastically increase the simple adoptability of tracing for all parties involved."
Repository
GitLab: gitlab.com/specoto/trace
Packagist: specoto/trace
Requirements
- PHP 8.3+ (enums)