tlc.core.utils.telemetry

Module Contents

Classes

Class

Description

JupyterExcepthookIntegration

Hook into Jupyter’s excepthook to capture unhandled exceptions so that they get reported to Sentry.

Telemetry

Telemetry class for 3LC.

RunningMessage

API

class tlc.core.utils.telemetry.JupyterExcepthookIntegration

Bases: sentry_sdk.integrations.Integration

Hook into Jupyter’s excepthook to capture unhandled exceptions so that they get reported to Sentry.

identifier = jupyter_excepthook
static setup_once() None
class tlc.core.utils.telemetry.Telemetry

Telemetry class for 3LC.

This class is responsible for initializing the telemetry system for 3LC.

telemetry_instance: tlc.core.utils.telemetry.Telemetry | None = None
static instance() tlc.core.utils.telemetry.Telemetry

Get the telemetry instance.

static get_sentry_environment() str

Get the Sentry environment.

This method uses various heuristics to determine the environment in which the code is running.

  1. If the TLC_SENTRY_ENVIRONMENT environment variable is set, it will take precedence over the other logic.

  2. If the tlc module is installed from a wheel, the environment will be set to “production”.

  3. If neither of these are set, we will assume that we are running from a development environment.

static get_sentry_config() tlcsaas.sentry_config.SentryConfiguration
static get_sentry_dashboard_config() dict
property is_enabled: bool
should_capture_messages(is_include_object_service: bool = True) bool
LogLevelStr = None
capture_message(message_text: str, message_tags: dict[str, Any] | None = None, message_extras: dict[str, Any] | None = None, level: LogLevelStr = 'info', include_stack_trace: bool = False) None
class tlc.core.utils.telemetry.RunningMessage(session_id: str, start_time: datetime.datetime)
static get_adapter_stats() dict[str, Any]
async consider_message() None