Telemetry

object Telemetry

The entry point for Android Solid Services telemetry.

Every signal the SDK emits passes through here. Until a host application calls install, all calls are no-ops, so the libraries add no monitoring dependency and send nothing anywhere.

class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
Telemetry.install(MyTelemetrySink())
}
}

All members are thread-safe, and no member ever throws: an exception raised by the installed sink is swallowed rather than propagated to the calling SDK code.

Properties

Link copied to clipboard

Reports whether a sink other than the default no-op is installed.

Functions

Link copied to clipboard

Installs sink as the destination for all subsequent signals, replacing any previous one.

Link copied to clipboard
fun log(message: String)

Records a breadcrumb to be attached to subsequent reports.

Link copied to clipboard
fun recordException(throwable: Throwable, attributes: Map<String, String> = emptyMap())
fun recordException(throwable: Throwable, vararg attributes: Pair<String, String>)

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

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

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

Link copied to clipboard

Starts a span for an outbound HTTP request to url using method.

Link copied to clipboard

Starts a custom span named name.

Link copied to clipboard
fun uninstall()

Restores the default no-op sink, discarding signals again.