oumi.telemetry#

Telemetry module for Oumi usage analytics.

This module provides anonymous usage telemetry to help improve Oumi. Analytics is enabled by default but can be disabled by setting the environment variable DO_NOT_TRACK=1.

Use TelemetryManager.capture_operation() to track operations with automatic timing, success/failure, and exception capture.

For more information, see: https://docs.oumi.ai/latest/about/telemetry.html

class oumi.telemetry.TelemetryManager[source]#

Bases: object

Singleton manager for telemetry collection via PostHog.

Analytics is enabled by default but can be disabled by setting DO_NOT_TRACK=1.

Example

telemetry = TelemetryManager.get_instance() with telemetry.capture_operation(“my-event”):

do_work() # Timing, success/failure, and exceptions captured automatically

capture_operation(event: str, properties: dict[str, Any] | None = None) Generator[None][source]#

Context manager that captures timing, success/failure, and exceptions.

No-op when telemetry is disabled.

Parameters:
  • event – The event name

  • properties – Initial properties to include with the event.

Example

with telemetry.capture_operation(“cli-train”):

telemetry.tags(trainer_type=”TRL_SFT”) run_training()

property enabled: bool#

Check if telemetry is enabled.

classmethod get_instance() TelemetryManager[source]#

Get the singleton instance of TelemetryManager.

tags(**kwargs: Any) None[source]#

Add multiple tags to the current context.