Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

This module primarily concerns being able to orchestrate telemetry across a given pipeline or workflow. This includes tracing, being able to send traces to an OpenTelemetry collector, setting up your agents with the correct tracing style so you can emit the right traces for platforms like Langfuse, and more.

Macros§

completion_parent_span
Declare a completion-parent span conforming to the adoption contract.

Structs§

CompletionSpanBuilder
Builder for a canonical GenAI completion span.
Empty
Marks a span field as declared but not yet valued.

Enums§

CompletionOperation
A supported GenAI completion operation and its canonical span name.

Constants§

COMPLETION_PARENT_MARKER_FIELD
Core-owned marker field for a runtime span that may absorb provider completion fields.
COMPLETION_PARENT_REQUIRED_FIELDS
Fields a completion-parent span must statically declare (as tracing::field::Empty or a value) to be adopted by CompletionSpanBuilder::build, alongside COMPLETION_PARENT_MARKER_FIELD.

Traits§

ProviderResponseExt
Provider response metadata used to populate GenAI telemetry spans.
SpanCombinator
A trait designed specifically to be used with Spans for the purpose of recording telemetry. Implemented for tracing::Span to record GenAI semantic convention fields.

Functions§

record_model_input
Records serialized model input messages on gen_ai.input.messages when content telemetry is explicitly enabled.
record_model_output
Records serialized model output messages on gen_ai.output.messages when content telemetry is explicitly enabled.
system_instructions_json
Serializes system instructions using the normalized GenAI telemetry shape.