TelemetrySink

interface TelemetrySink

Receives the performance and error signals emitted by Android Solid Services.

The libraries are deliberately free of any monitoring dependency: they emit through Telemetry, and nothing is reported until a host application installs a sink. Implement this interface to route those signals to your own backend — Firebase, Sentry, OpenTelemetry, or plain logs — then call Telemetry.install from Application.onCreate.

Implementations must be safe to call from any thread. They may throw: Telemetry isolates failures so that a broken sink cannot break the caller.

Functions

Link copied to clipboard
abstract fun log(message: String)

Records a breadcrumb to be attached to subsequent reports.

Link copied to clipboard
abstract fun recordException(throwable: Throwable, attributes: Map<String, String>)

Reports a handled, non-fatal throwable together with contextual attributes.

Link copied to clipboard
abstract fun setKey(key: String, value: String)

Sets a key/value pair to be attached to subsequent reports.

Link copied to clipboard
abstract fun startNetworkSpan(url: String, method: String): TelemetryNetworkSpan

Starts a span for an outbound HTTP request.

Link copied to clipboard
abstract fun startSpan(name: String): TelemetrySpan

Starts a custom span named name.