API Observability TelemetryEventListenerInterface - evansims/openfga-php GitHub Wiki
Interface for event listeners that forward domain events to telemetry providers. This interface defines the contract for handling telemetry-related events throughout the OpenFGA client lifecycle, enabling observability without tightly coupling business logic to telemetry concerns.
Table of Contents
OpenFGA\Observability
- TelemetryEventListener (implementation)
public function onHttpRequestSent(HttpRequestSentEvent $event): void
Handle HTTP request sent events. Records telemetry data when an HTTP request is sent, including request method, URL, body size, and OpenFGA-specific context like operation, store ID, and model ID.
Name | Type | Description |
---|---|---|
$event |
HttpRequestSentEvent |
The HTTP request sent event |
void
public function onHttpResponseReceived(HttpResponseReceivedEvent $event): void
Handle HTTP response received events. Records telemetry data when an HTTP response is received, including response status, body size, and any exception information if the request failed.
Name | Type | Description |
---|---|---|
$event |
HttpResponseReceivedEvent |
The HTTP response received event |
void
public function onOperationCompleted(OperationCompletedEvent $event): void
Handle operation completed events. Records telemetry data when an OpenFGA operation completes, including success status, operation context, and exception details if the operation failed.
Name | Type | Description |
---|---|---|
$event |
OperationCompletedEvent |
The operation completed event |
void
public function onOperationStarted(OperationStartedEvent $event): void
Handle operation started events. Records telemetry data when an OpenFGA operation begins, including operation type, store context, and model information.
Name | Type | Description |
---|---|---|
$event |
OperationStartedEvent |
The operation started event |
void