Skip to content

Observability API

The client.observability namespace exposes audit logs, event emission, metrics, quality monitoring, per-window telemetry, and structured logging.

SDK proxy

crp.sdk.proxies_extra._ObservabilityProxy

Observability proxy (§8.9, §9).

Exposes audit logs, event emission, metrics, quality monitoring, per-window telemetry, and structured logging.

audit_events()

Return an AuditLogger instance.

If the orchestrator exposes a compatible audit trail, that object is returned; otherwise a fresh AuditLogger is created.

Returns:

Type Description
Any

AuditLogger or orchestrator audit trail.

emit(event_type, payload=None)

Emit a CRPEvent through the orchestrator event bus when present.

Parameters:

Name Type Description Default
event_type str

Canonical event type string.

required
payload dict[str, Any] | None

Event data dict.

None

Returns:

Type Description
Any

The emitted CRPEvent instance.

metrics()

Return a MetricsExporter instance.

Returns:

Type Description
Any

MetricsExporter instance.

quality()

Return a quality monitor instance.

Returns QualityMonitor if available; otherwise falls back to QualityReporter.

Returns:

Type Description
Any

Quality reporter/monitor instance.

telemetry(window_id='')

Return a WindowTelemetry record for the current session/window.

Parameters:

Name Type Description Default
window_id str

Window identifier. Defaults to empty string.

''

Returns:

Type Description
Any

WindowTelemetry instance.

structured_log(record)

Format a log record as structured JSON.

Parameters:

Name Type Description Default
record Any

A logging.LogRecord or dict describing the event.

required

Returns:

Type Description
str

JSON-formatted log line.