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_telemetryproxy payload. - sanitize
- Recursive URL-sanitization for caller-supplied properties.
Structs§
- Telemetry
Guard - RAII handle that flushes and shuts down the global tracer provider on drop.
Enums§
- Property
Value - Represents any valid JSON value.
- Telemetry
Error - Errors returned by
try_send_telemetry. - Telemetry
Init Error - Errors returned during OpenTelemetry SDK initialization.
- User
IdRef - Reference type for the
user_idfield. Accepts aUuid, a&str, orOption<Uuid>via theFromimpls below; callers rarely construct this directly.
Traits§
- Settings
View - 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
tracinglayer 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_telemetrybut returnsResult<(), TelemetryError>for callers that want to know whether dispatch was attempted.
Type Aliases§
- Boxed
Telemetry Layer - Type-erased layer compatible with any
tracingregistry that supportsLookupSpan. 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.