Skip to content
v0.1.3

Telemetry Module API Reference

This section documents the internals of the telemetry module in Bijux CLI.

bijux_cli.contracts.telemetry

Defines the contract for the fire-and-forget telemetry service.

This module specifies the TelemetryProtocol, a formal interface that any service responsible for collecting and managing "fire-and-forget" telemetry or analytics events must implement.

TelemetryProtocol

Bases: Protocol

Defines the contract for fire-and-forget analytics collection.

This interface specifies the methods for recording telemetry events and managing the lifecycle of the telemetry service.

enable

enable() -> None

Enables the collection of telemetry data.

Source code in src/bijux_cli/contracts/telemetry.py
def enable(self) -> None:
    """Enables the collection of telemetry data."""
    ...

event

event(
    name: str, payload: dict[str, Any]
) -> None | Coroutine[Any, Any, None]

Records a telemetry event.

Parameters:

  • name (str) –

    The name of the event (e.g., "COMMAND_START").

  • payload (dict[str, Any]) –

    A dictionary of key-value pairs containing the event data.

Returns:

  • None | Coroutine[Any, Any, None]

    Either None (sync) or an awaitable resolving to None (async).

Source code in src/bijux_cli/contracts/telemetry.py
def event(
    self, name: str, payload: dict[str, Any]
) -> None | Coroutine[Any, Any, None]:
    """Records a telemetry event.

    Args:
        name (str): The name of the event (e.g., "COMMAND_START").
        payload (dict[str, Any]): A dictionary of key-value pairs
            containing the event data.

    Returns:
        Either None (sync) or an awaitable resolving to None (async).
    """
    ...

flush

flush() -> None

Flushes any buffered telemetry events to their destination.

Source code in src/bijux_cli/contracts/telemetry.py
def flush(self) -> None:
    """Flushes any buffered telemetry events to their destination."""
    ...