-
Notifications
You must be signed in to change notification settings - Fork 2
ObservabilityEventAdapter
Viames Marino edited this page Apr 22, 2026
·
1 revision
Pair\Core\ObservabilityEventAdapter is the optional interface for observability adapters that can receive non-span events.
It is intentionally separate from ObservabilityAdapter so existing span-only adapters remain compatible.
use Pair\Core\ObservabilityEvent;
use Pair\Core\ObservabilityEventAdapter;
final class CustomEventAdapter implements ObservabilityEventAdapter {
public function recordEvent(ObservabilityEvent $event): void {
error_log(json_encode($event->toArray(), JSON_UNESCAPED_SLASHES));
}
}In practice, an adapter that wants both traces and events implements both interfaces.
See also: Observability, ObservabilityAdapter, ObservabilityEvent.