Skip to content

PAM Native Observability

Install through PAM — not Composer directly:

Terminal window
pam add observability
pam doctor

PAM performs the Composer compatibility preflight internally, updates the project manifests, and refreshes native integration. Remove it with pam remove observability.

$telemetry = new Observability($config, new CurlTelemetryTransport());
$span = $telemetry->span('feed.load');
try {
loadFeed();
$span->status(SpanStatus::Ok);
} catch (Throwable $error) {
$span->exception($error);
throw $error;
} finally {
$span->end();
$telemetry->flush();
}

Observability creates spans, structured logs, counters, gauges, crash context, and batches. ObservabilityConfig defines HTTPS endpoint, service identity, sampling, queue, and batch policy. Span/SpanStatus, Severity, and SignalKind are typed enums. TelemetryTransport supports Sentry, Datadog, Honeycomb, New Relic, gateways, or offline spools; CurlTelemetryTransport is the dependency-light HTTPS default.

The bounded queue drops oldest under pressure and restores failed exports to the front. Signals collect no secrets/personal data automatically: define an attribute allowlist. Flush on lifecycle transitions without indefinitely blocking UI, distinguish permanent/transient transport failure, and monitor dropped-signal counters.