Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

Product-analytics telemetry. Telemetry surface for embedders.

Re-exports the public API of cognee_observability (OTEL setup, gap 01) and cognee_telemetry (send_telemetry product-analytics client, gap 02) so consumers reach both through the same cognee_lib::telemetry namespace.

When the telemetry cargo feature is on, observability re-exports pull in cognee-observability and the send_telemetry re-exports pull in the real cognee-telemetry impl. When the feature is off, observability re-exports vanish and the send_telemetry re-exports resolve to the noop bodies inside cognee-telemetry (so cognee_telemetry::send_telemetry and cognee_telemetry::TelemetryError are always available — they exist regardless of feature state in the leaf crate).

Modules§

env
Environment-driven configuration for send_telemetry.
ids
Identity-layer helpers for send_telemetry.
payload
Strongly-typed serde model of the send_telemetry proxy payload.
sanitize
Recursive URL-sanitization for caller-supplied properties.

Structs§

TelemetryGuard
RAII handle that flushes and shuts down the global tracer provider on drop.

Enums§

PropertyValue
Represents any valid JSON value.
TelemetryError
Errors returned by try_send_telemetry.
TelemetryInitError
Errors returned during OpenTelemetry SDK initialization.
UserIdRef
Reference type for the user_id field. Accepts a Uuid, a &str, or Option<Uuid> via the From impls below; callers rarely construct this directly.

Traits§

SettingsView
Borrow-only adapter over the OTEL fields of cognee Settings.

Functions§

already_instrumented
Has this crate already installed an OTEL tracer provider in the current process?
init_telemetry
Build the OTEL tracing layer and an RAII guard.
is_tracing_enabled
Python-parity check: should we initialize and emit OTEL spans?
parse_otlp_headers
Parse "k1=v1,k2=v2" into a list of (key, value) pairs.
send_telemetry
Fire-and-forget product-analytics event.
try_send_telemetry
Same as send_telemetry but returns Result<(), TelemetryError> for callers that want to know whether dispatch was attempted.

Type Aliases§

BoxedTelemetryLayer
Type-erased layer compatible with any tracing registry that supports LookupSpan. Boxing is what lets the disabled and enabled paths return the same shape — the caller composes it onto a subscriber via .with(layer) without seeing the underlying generic parameters.