Package 

Interface StreamTelemetry


  • 
    public interface StreamTelemetry
    
                        

    Engine 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 StreamTelemetryScope scope(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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.