Google is committed to advancing racial equity for Black communities. See how.

Statsd

The Statsd module includes statsd, a native service that runs in the background collecting metrics, and the Java service StatsCompanionService, which runs in the system process and bridges statsd and Java. This module is updatable, meaning it can receive updates to functionality (such as updates to the metrics used in data collection) outside of the normal Android release cycle.

Module boundary

Statsd is the primary touchpoint between the platform and launch-safety data collection. The statsd module includes the following code.

  • statsd, located in frameworks/base/cmds/statsd.

  • StatsCompanionService, located in frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java.

  • A subset of the platform protobuf structures, located primarily in frameworks/base/core/proto.

As a native service, statsd can outlive the framework and detect crashes in the system_server itself.

Module format

The statsd module (com.google.android.os.statsd) is in APEX format and is available for devices running Android 11 or higher.

Module dependences

The Statsd module presents a set of @hide APIs to log events from the system. For Java code, most @hide APIs are refactored to be built on a smaller set of @SystemApi tagged methods, with some small generated glue-code built in. For native code, existing native functions are refactored to be official VNDK C APIs, with generated glue.

Customization

The Statsd module doesn't support customization.

Testing

The Android Compatibility Test Suite (CTS) verifies the functionality of statsd and the atoms on which release management depends.