Metrics Service
Service for sending OpenTelemetry metrics to OTLP endpoint Completely failsafe - all operations are non-blocking and errors are silently handled Singleton object like SentryHelper for direct access
Functions
Initialize the metrics service. Should be called once during SDK initialization.
Send device information metrics on SDK initialization
Send a gauge metric (for values that can go up or down) Used for things like duration, memory usage, active connections
Update bot_name when settings load
Enable or disable metrics sending (INTERNAL USE ONLY) Set synchronously to avoid race condition where sendEvent() checks isEnabled before the async coroutine has set it. This ensures metrics sent immediately after setEnabled(true) are not silently dropped.
Enable or disable app lifecycle event tracking (foreground/background) Call this when SDK starts (true) or disconnects (false)
Check if app lifecycle tracking is enabled