specoto/trace

PSR-22 Application Tracing interfaces — intentionally minimalist tracing contracts for PHP

Maintainers

Package info

gitlab.com/specoto/trace

Issues

pkg:composer/specoto/trace

Statistics

Installs: 0

Dependents: 1

Suggesters: 0

Stars: 0

dev-main 2026-06-17 19:07 UTC

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

InterfacePurpose
TracerProviderInterfaceEntry point — get a named tracer
TracerInterfaceCreate spans
SpanInterfaceRead/write span data
SpanContextInterfaceW3C trace context identity

Enums

EnumValues
SpanKindINTERNAL, CLIENT, SERVER, PRODUCER, CONSUMER
SpanStatusUNSET, 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)