operonx.telemetry¶
Tracing backends — Langfuse, OpenTelemetry, and a local file-based tracer.
tracers
¶
Backwards-compat shim for the legacy tracer constructor.
Pre-T2: each backend had its own Tracer subclass.
Post-T2.12: LangfuseTracer is a TracePipeline subclass that wires
up a LangfuseTreeExporter internally. New code should use
operonx.telemetry.exporters.LangfuseTreeExporter (or
LangfuseGroupedTimelineExporter) inside an explicit TracePipeline.
Classes¶
LangfuseTracer
¶
LangfuseTracer(
config: Optional["LangfuseConfig"] = None,
resource: Optional[str] = None,
tags: Optional[List[str]] = None,
trace_filter: Optional["TraceFilter"] = None,
)
Bases: TracePipeline
Pipeline-shaped Langfuse tracer with the legacy constructor signature.
Constructor accepts the same args as the pre-T2 tracer. Internally
constructs a LangfuseTreeExporter plus the processor chain derived
from trace_filter (via trace_filter_to_processors).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
Optional['LangfuseConfig']
|
Direct |
None
|
resource
|
Optional[str]
|
|
None
|
tags
|
Optional[List[str]]
|
Static tags attached to every trace. |
None
|
trace_filter
|
Optional['TraceFilter']
|
Legacy |
None
|
Use LangfuseTracer.as_pipeline(...) to get a plain TracePipeline
without the legacy attributes — recommended for new code.
Source code in operonx/telemetry/tracers/langfuse.py
Functions¶
to_config_dict
¶
Return Langfuse config dict for the Rust backend.
None when constructed from a ResourceHub key (in which case the
Rust side resolves the resource itself).
Source code in operonx/telemetry/tracers/langfuse.py
as_pipeline
classmethod
¶
as_pipeline(
config: Optional["LangfuseConfig"] = None,
resource: Optional[str] = None,
tags: Optional[List[str]] = None,
trace_filter: Optional["TraceFilter"] = None,
*,
grouped_timeline: bool = False,
) -> TracePipeline
Return a plain TracePipeline configured equivalently.
Use this when you want the new pipeline shape without the legacy
attributes (.tags, .resource, etc.). The constructor
provides the same wiring plus those attributes for back-compat.
Set grouped_timeline=True for educa's turn-grouped shape (uses
LangfuseGroupedTimelineExporter — pair with GroupBy +
Aggregate processors).