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


Namespace

OpenFGA\Observability


Source

View source code


Related Classes


Methods

onHttpRequestSent

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.

View source


Parameters

Name Type Description
$event HttpRequestSentEvent The HTTP request sent event

Returns

void


onHttpResponseReceived

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.

View source


Parameters

Name Type Description
$event HttpResponseReceivedEvent The HTTP response received event

Returns

void


onOperationCompleted

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.

View source


Parameters

Name Type Description
$event OperationCompletedEvent The operation completed event

Returns

void


onOperationStarted

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.

View source


Parameters

Name Type Description
$event OperationStartedEvent The operation started event

Returns

void

⚠️ **GitHub.com Fallback** ⚠️