Kotlin Compiler Plugin

The Sentry Kotlin Compiler Plugin is an addition to the Sentry Android Gradle plugin and offers improvements to existing SDK features. As of now the main focus of the plugin is to improve apps which utilize Jetpack Compose by automatically tagging @Composable functions.

How it works

Given a @Composable function:

Copied
@Composable
fun LoginScreen() {
    Column() {
        // ...
    }
}

The Sentry Kotlin Compiler Plugin will transform it into the following:

Copied
@Composable
fun LoginScreen() {
    Column(modifier = Modifier.sentryTag("LoginScreen")) {
        // ...
    }
}

Setup

Install

Kotlin Compiler plugins are executed during compilation and thus need to be applied to every relevant Gradle module. Add the following to e.g. your app/build.gradle:

app/build.gradle
Copied
plugins {
  id "io.sentry.kotlin.compiler.gradle" version "4.2.0"
}

Configuration

As of now no additional steps are necessary. Checkout the docs for View Hierarchy and User Interaction Tracing to see which features the Sentry Kotlin Compiler Plugin improves.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").