jeevesagent.observability.tracing

Telemetry adapters.

  • NoTelemetry — no-op default. Both methods do as little work as possible so wrapping every loop step in async with telemetry.trace(...) has effectively zero cost when telemetry isn’t configured.

  • OTelTelemetry — OpenTelemetry-backed. Lazy SDK imports inside __init__. Spans go to whatever TracerProvider is configured; metrics go to whatever MeterProvider is configured. Tests pass in-memory providers; production users wire up their exporters once at startup and the adapter inherits.

Metric type dispatch is by suffix:

  • names ending in _ms, _seconds, or _bytes -> histogram

  • everything else -> counter

That keeps the public interface a single emit_metric() while still producing the right OTel instrument under the hood.

Classes

NoTelemetry

No-op telemetry. Very cheap; safe to call on every loop step.

OTelTelemetry

OpenTelemetry-backed Telemetry.

Module Contents

class jeevesagent.observability.tracing.NoTelemetry[source]

No-op telemetry. Very cheap; safe to call on every loop step.

async emit_metric(name: str, value: float, **attrs: Any) None[source]
async trace(name: str, **attrs: Any) collections.abc.AsyncIterator[jeevesagent.core.types.Span][source]
class jeevesagent.observability.tracing.OTelTelemetry(*, tracer_provider: Any | None = None, meter_provider: Any | None = None, instrumentation_name: str = 'jeevesagent')[source]

OpenTelemetry-backed Telemetry.

async emit_metric(name: str, value: float, **attrs: Any) None[source]
async trace(name: str, **attrs: Any) collections.abc.AsyncIterator[jeevesagent.core.types.Span][source]