-
public interface StreamTelemetryEngine for collecting telemetry signals across named scopes.
Product SDKs create an instance via the StreamTelemetry factory, inject it into StreamComponentProvider, and retain a reference for draining. Core emits signals internally; the product SDK decides when and where to send them.
If no telemetry is provided, core uses StreamTelemetryNoOp which discards everything at zero cost.
// Product SDK creates and keeps a reference val telemetry = StreamTelemetry(context, config) // Inject into core val client = StreamClient( ..., components = StreamComponentProvider(telemetry = telemetry), ) // Core emits internally telemetry.scope("connection").emit("connected", connectionId) // Product SDK drains on its own schedule val signals = telemetry.scope("connection").drain()
-
-
Method Summary
Modifier and Type Method Description abstract StreamTelemetryScopescope(String name)Returns the StreamTelemetryScope for the given name, creating it if it doesn't exist. abstract Result<Unit>cleanStaleVersions()Deletes disk spill directories from previous SDK versions. -
-
Method Detail
-
scope
abstract StreamTelemetryScope scope(String name)
Returns the StreamTelemetryScope for the given name, creating it if it doesn't exist.
Scope names are open — any string is valid. Core uses names like
"connection","network","auth", and"device". Product SDKs add their own (e.g."sfu","publisher").- Parameters:
name- Scope identifier.
-
cleanStaleVersions
abstract Result<Unit> cleanStaleVersions()
Deletes disk spill directories from previous SDK versions.
Call this when the product SDK is ready (e.g. after initialization). Directories that don't match the current StreamTelemetryConfig.version are removed.
-
-
-
-