Public telemetry API for Luxonis packages.
The luxonis_ml.telemetry package exposes a lightweight event-capture
client, environment-driven configuration, singleton helpers, context
providers, and suppression tools. It is designed so consuming packages can
emit usage events without coupling directly to a specific analytics backend.
PostHog support is optional through luxonis-ml[telemetry]; disabled,
misconfigured, and debug configurations can use no-op or stdout backends.
Example
Emit an event from a component while keeping backend configuration separate from the call site.
from luxonis_ml.telemetry import Telemetry telemetry = Telemetry("luxonis_ml", source_component="data") telemetry.capture( "dataset_export_started", {"dataset_type": "coco"}, )
Note
Telemetry failures are intentionally non-fatal for host applications. If a backend cannot be initialized or capture fails, the telemetry layer falls back or suppresses the error rather than interrupting the caller.
See Also
luxonis_ml.telemetry.client for the capture client,
luxonis_ml.telemetry.config for configuration, and
luxonis_ml.telemetry.backends for backend implementations.
| Package | backends |
No package docstring; 0/1 constant, 4/4 classes, 0/4 module documented |
| Package | cli |
No package docstring; 4/4 functions, 0/3 module documented |
| Module | client |
No module docstring; 0/2 type alias, 1/1 function documented |
| Module | config |
Undocumented |
| Module | context |
No module docstring; 0/1 constant, 4/4 functions documented |
| Module | events |
No module docstring; 1/1 class documented |
| Module | redaction |
No module docstring; 0/7 constant, 7/7 functions documented |
| Module | singleton |
No module docstring; 0/3 variable, 3/5 functions, 0/1 class documented |
| Module | suppression |
No module docstring; 0/1 variable, 1/1 function documented |
From __init__.py:
| Class | |
Telemetry client for emitting events via pluggable backends. |
| Class | |
Configuration for telemetry collection. |
| Class | |
Optional product-level defaults for telemetry configuration. |
| Function | get |
Return an existing telemetry instance or initialize one. |
| Function | get |
Return a telemetry instance by singleton identity. |
| Function | host |
Return coarse host metadata for optional event context. |
| Function | host |
Context provider that exposes coarse host metadata. |
| Function | initialize |
Initialize and return a telemetry instance for one emitter. |
| Function | shutdown |
Register an exit handler to flush telemetry on shutdown. |
| Function | suppress |
Context manager to suppress telemetry for nested calls. |
| Function | system |
Return extended runtime metadata for optional event context. |
| Function | system |
Context provider that exposes extended runtime metadata. |
str, *, source_component: str | None = None, library_version: str | None = None, config: TelemetryConfig | None = None, context_providers: list[ ContextProvider] | None = None, system_context_providers: list[ SystemContextProvider] | None = None, register_exit_handler: bool = True) -> Telemetry:
¶
Return an existing telemetry instance or initialize one.
| Parameters | |
librarystr | Name of the library emitting telemetry. |
sourcestr | None | Optional emitter/component name for the singleton instance. If omitted, the library name is reused. |
librarystr | None | Version string for the library. |
config:TelemetryConfig | None | Optional telemetry configuration. |
contextlist[ | Callables that return extra context to attach to every event. |
systemlist[ | Callables that return extra context to attach only when system metadata is requested. |
registerbool | Whether to flush telemetry on process exit. |
| Returns | |
Telemetry | The existing or newly initialized telemetry instance for the (library_name, source_component) key. |
str | None = None, *, source_component: str | None = None) -> Telemetry | None:
¶
Return a telemetry instance by singleton identity.
| Parameters | |
librarystr | None | Optional library/product name to filter by. |
sourcestr | None | Optional emitter/component name to filter by. |
| Returns | |
Telemetry | None | The matching telemetry instance when the lookup resolves to one instance. Ambiguous lookups return None. |
str, source_component: str | None = None, library_version: str | None = None, config: TelemetryConfig | None = None, context_providers: list[ ContextProvider] | None = None, system_context_providers: list[ SystemContextProvider] | None = None, register_exit_handler: bool = True) -> Telemetry:
¶
Initialize and return a telemetry instance for one emitter.
| Parameters | |
librarystr | Name of the library emitting telemetry. |
sourcestr | None | Optional emitter/component name. If omitted, the library name is reused. |
librarystr | None | Optional version string for the library. |
config:TelemetryConfig | None | Optional telemetry configuration. |
contextlist[ | Optional list of context provider callables. |
systemlist[ | Optional list of system context provider callables. |
registerbool | Whether to flush telemetry on process exit. |
| Returns | |
Telemetry | The initialized telemetry instance for the exact (library_name, source_component) key. |