Telemetry Cheatsheet
Namespace:Cognesy\\Telemetry\\
TraceContextSpanReferenceObservationMetricMeasurementTelemetryContinuationInstrumentationProfile
TelemetryTelemetryHub(deprecated alias)TraceRegistryCompositeTelemetryExporter
Telemetrytakesnew TraceRegistry()plus an exporter- use
CompositeTelemetryExporter([...])when you want to fan out to multiple backends - call
flush()after the run to send buffered observations and metrics
Logfire
Basic setup:endpointis the base OTLP URL, not the full/v1/tracespathLogfireExporterrequires eitherLogfireConfigor a custom transport- working helper:
examples/_support/logfire.php - practical examples:
examples/D05_AgentTroubleshooting/TelemetryLogfire/run.phpexamples/D05_AgentTroubleshooting/SubagentTelemetryLogfire/run.php
Langfuse
Basic setup:- Langfuse traces are sent to
/api/public/otel/v1/traces - request-scoped traces fall back to request ids as
session.idvalues - working helper:
examples/_support/langfuse.php - practical examples:
examples/D05_AgentTroubleshooting/TelemetryLangfuse/run.phpexamples/D05_AgentTroubleshooting/SubagentTelemetryLangfuse/run.php
Runtime wiring
For runtime packages, telemetry is usually attached to an event bus throughRuntimeEventBridge
and one or more projectors:
- runtime packages own their local projectors and emit serialized
data['telemetry']envelopes - telemetry core rehydrates the envelope and correlates spans centrally
AgentCtrlTelemetryProjectorcorrelatesagent-ctrlbyexecutionIdagent_ctrl.session_idis continuation metadata, not the primary trace key- request-scoped traces fall back to request ids as
session.idvalues for Langfuse
Cognesy\\Telemetry\\Adapters\\OTelCognesy\\Telemetry\\Adapters\\LogfireCognesy\\Telemetry\\Adapters\\Langfuse