WEBINAR: Coming soon to a browser near you: OpenTelemetry! Experts share how the OTel community is building better browser observability.

Register here

Embrace’s Gradle Plugin is now open-source!

Embrace has open-sourced the code behind our Gradle plugin! Now, Android developers can use our open-source plugin to seamlessly configure Embrace’s behavior in their apps, with access to the source code of the plugin itself from within the Android SDK repository.

What is the Embrace Gradle Plugin?

The Embrace Gradle Plugin, previously known as the “Swazzler”, adds Embrace’s capabilities to your Android app. The Gradle plugin lets Android developers configure the specific capabilities and instrumentation they want to add to their apps, and does the work of deobfuscating stack traces from your apps in production.

Flexible instrumentation configuration

The Embrace Gradle Plugin allows developers to configure various custom instrumentation specific to Embrace. Using bytecode instrumentation, the plugin can automatically add Embrace instrumentation where it’s needed for features like networking and taps.

For example, the plugin makes it possible to automatically instrument OkHttp requests, if a developer is using that HTTP client in their app.

A full list of instrumentation options can be found in the Embrace Gradle Plugin documentation.

Uploaded file mapping

The Embrace Gradle Plugin also helps make sense of errors and exceptions that are otherwise illegible. The plugin uploads mapping files at build-time, which means that these mappings can help deobfuscate stack traces from crashes that occur in production.

Improved test coverage

Finally, as part of making our plugin open-source, this effort allowed us to buff up the test coverage behind the plugin’s functionality. Along with unit tests we added tons of integration tests using Gradle’s own TestKit library, tying a nice bow on the effort to make this Gradle plugin public.

Conclusion

All told, the Embrace Gradle Plugin provides an easy base layer to get Embrace into your Android application. With the configuration options and file mapping benefits, this open-source plugin lets developers flexibly add Embrace in production, and is a great example for other Android developers looking to create Gradle plugins for real production use.

Check out our Android SDK to dig into the Swazzler and the production features that it supports.

Related Content
How does an ANR work?
A detailed look at how the Android OS monitors, processes, and triggers Application Not Responding (ANR) errors.
Embrace now supports Jetpack Compose
We're excited to announce that Embrace now supports Jetpack Compose! Our SDK captures clicks on Jetpack Compose elements and displays them right in the User Timeline.