Anomalies
Stay organized with collections
Save and categorize content based on your preferences.
The Google Play Developer Reporting API lets you retrieve anomalies detected in metric sets. An anomaly is
produced every time the metric value exceeds the expected range of the metric, based on the
previous 28 days of values for that same metric. Anomalies for consecutive days are merged into
a single anomaly result.
If the anomalous increase in the value of a metric persists for
long enough, the detection model adapts and widens the expected values until subsequent
datapoints aren't considered anomalous anymore.
Retrieving anomalies
Anomalies can be listed with the
anomalies.list method.
Simple request:
This HTTP GET
request specifies the application name parameter and returns the
full list of detected anomalies for your application.
GET https://playdeveloperreporting.googleapis.com/v1beta1/apps/com.example.app/anomalies
Anomaly response:
The response includes enough information to query exactly where the anomaly occurred:
{
"anomalies": [
{
"name": "apps/com.example.app/anomalies/12345"
"metric_set": "apps/com.example.app/anrRateMetricSet"
"timeline_spec": {
"aggregation_period": "DAILY"
"start_time": {
"year": 2022
"month": 1
"day": 23
"time_zone": {
"id": "America/Los_Angeles"
}
}
"end_time": {
"year": 2022
"month": 1
"day": 23
"time_zone": {
"id": "America/Los_Angeles"
}
}
}
"metric": {
"metric": "anrRate",
"decimal_value": {
"value": "3.1415926535"
}
}
},
{
"name": "apps/com.example.app/anomalies/12345"
"metric_set": "apps/com.example.app/crashRateMetricSet"
"timeline_spec": {
"aggregation_period": "DAILY"
"start_time": {
"year": 2021
"month": 12
"day": 10
"time_zone": {
"id": "America/Los_Angeles"
}
}
"end_time": {
"year": 2021
"month": 12
"day": 10
"time_zone": {
"id": "America/Los_Angeles"
}
}
}
"metric": {
"metric": "crashRate",
"decimal_value": {
"value": "2.7182818284"
}
}
},
]
}
Filtered request:
It is possible to apply a filter to return only anomalies that were active on a specific period
of time. To do this, specify the activeBetween(start, end)
function
in the filter field in the request. It is possible to specify unbounded limits at either side
of the range with the special keyword UNBOUNDED
. If specifying a start or end
bound, it must follow the RFC 3339 format, e.g. 2022-02-22T04:00Z
.
GET https://playdeveloperreporting.googleapis.com/v1beta1/apps/com.example.app/anomalies?filter=activeBetween("2022-01-01T00:00:00Z", UNBOUNDED)
Filtered response:
The response only includes anomalies that were active in the specified time range:
{
"anomalies": [
{
"name": "apps/com.example.app/anomalies/12345"
"metric_set": "apps/com.example.app/anrRateMetricSet"
"timeline_spec": {
"aggregation_period": "DAILY"
"start_time": {
"year": 2022
"month": 1
"day": 23
"time_zone": {
"id": "America/Los_Angeles"
}
}
"end_time": {
"year": 2022
"month": 1
"day": 23
"time_zone": {
"id": "America/Los_Angeles"
}
}
}
"metric": {
"metric": "anrRate",
"decimal_value": {
"value": "3.1415926535"
}
}
},
]
}
Available metrics
Not all metrics and metric sets currently support anomaly detection. Here's the list of
currently supported metrics:
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-12-05 UTC.
[null,null,["Last updated 2023-12-05 UTC."],[[["\u003cp\u003eThe Google Play Developer Reporting API allows you to retrieve anomalies, which are detected when a metric value falls outside its expected range based on the previous 28 days of data.\u003c/p\u003e\n"],["\u003cp\u003eConsecutive days of anomalies are merged into a single result, and the detection model adapts over time if an increase in a metric's value persists.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve anomalies using the \u003ccode\u003eanomalies.list\u003c/code\u003e method, filtering by an active time period with the \u003ccode\u003eactiveBetween\u003c/code\u003e function.\u003c/p\u003e\n"],["\u003cp\u003eAnomaly responses include information for identifying the anomaly, such as the affected metric, its value, and the time period it occurred.\u003c/p\u003e\n"],["\u003cp\u003eAnomaly detection is currently supported for specific metrics within the ANR rate, crash rate, excessive wakeup rate, and stuck background wakelock rate metric sets.\u003c/p\u003e\n"]]],["The Google Play Developer Reporting API detects anomalies when metric values exceed their expected range, based on the previous 28 days. Anomalies are retrievable via the `anomalies.list` method using a `GET` request. The response provides anomaly details, including the metric set, timeline, and metric value. Filtering is supported to find anomalies active within a specific time range with the `activeBetween(start, end)` function. Supported metrics for anomaly detection include `anrRate`, `crashRate`, `excessiveWakeupRate`, and `stuckBgWakelockRate`.\n"],null,["# Anomalies\n\nThe Google Play Developer Reporting API lets you retrieve anomalies detected in metric sets. An anomaly is\nproduced every time the metric value exceeds the expected range of the metric, based on the\nprevious 28 days of values for that same metric. Anomalies for consecutive days are merged into\na single anomaly result.\n\n\nIf the anomalous increase in the value of a metric persists for\nlong enough, the detection model adapts and widens the expected values until subsequent\ndatapoints aren't considered anomalous anymore.\n\nRetrieving anomalies\n--------------------\n\n\nAnomalies can be listed with the\n[anomalies.list](/play/developer/reporting/reference/rest/v1beta1/anomalies/list) method.\n\n#### Simple request:\n\n\nThis HTTP `GET` request specifies the application name parameter and returns the\nfull list of detected anomalies for your application. \n\n```text\nGET https://playdeveloperreporting.googleapis.com/v1beta1/apps/com.example.app/anomalies\n```\n\n#### Anomaly response:\n\n\nThe response includes enough information to query exactly where the anomaly occurred: \n\n```verilog\n{\n \"anomalies\": [\n {\n \"name\": \"apps/com.example.app/anomalies/12345\"\n \"metric_set\": \"apps/com.example.app/anrRateMetricSet\"\n \"timeline_spec\": {\n \"aggregation_period\": \"DAILY\"\n \"start_time\": {\n \"year\": 2022\n \"month\": 1\n \"day\": 23\n \"time_zone\": {\n \"id\": \"America/Los_Angeles\"\n }\n }\n \"end_time\": {\n \"year\": 2022\n \"month\": 1\n \"day\": 23\n \"time_zone\": {\n \"id\": \"America/Los_Angeles\"\n }\n }\n }\n \"metric\": {\n \"metric\": \"anrRate\",\n \"decimal_value\": {\n \"value\": \"3.1415926535\"\n }\n }\n },\n {\n \"name\": \"apps/com.example.app/anomalies/12345\"\n \"metric_set\": \"apps/com.example.app/crashRateMetricSet\"\n \"timeline_spec\": {\n \"aggregation_period\": \"DAILY\"\n \"start_time\": {\n \"year\": 2021\n \"month\": 12\n \"day\": 10\n \"time_zone\": {\n \"id\": \"America/Los_Angeles\"\n }\n }\n \"end_time\": {\n \"year\": 2021\n \"month\": 12\n \"day\": 10\n \"time_zone\": {\n \"id\": \"America/Los_Angeles\"\n }\n }\n }\n \"metric\": {\n \"metric\": \"crashRate\",\n \"decimal_value\": {\n \"value\": \"2.7182818284\"\n }\n }\n },\n ]\n}\n```\n\n#### Filtered request:\n\n\nIt is possible to apply a filter to return only anomalies that were active on a specific period\nof time. To do this, specify the `activeBetween(start, end)` function\nin the filter field in the request. It is possible to specify unbounded limits at either side\nof the range with the special keyword `UNBOUNDED`. If specifying a start or end\nbound, it must follow the RFC 3339 format, e.g. `2022-02-22T04:00Z`. \n\n```text\nGET https://playdeveloperreporting.googleapis.com/v1beta1/apps/com.example.app/anomalies?filter=activeBetween(\"2022-01-01T00:00:00Z\", UNBOUNDED)\n```\n\n#### Filtered response:\n\n\nThe response only includes anomalies that were active in the specified time range: \n\n```verilog\n{\n \"anomalies\": [\n {\n \"name\": \"apps/com.example.app/anomalies/12345\"\n \"metric_set\": \"apps/com.example.app/anrRateMetricSet\"\n \"timeline_spec\": {\n \"aggregation_period\": \"DAILY\"\n \"start_time\": {\n \"year\": 2022\n \"month\": 1\n \"day\": 23\n \"time_zone\": {\n \"id\": \"America/Los_Angeles\"\n }\n }\n \"end_time\": {\n \"year\": 2022\n \"month\": 1\n \"day\": 23\n \"time_zone\": {\n \"id\": \"America/Los_Angeles\"\n }\n }\n }\n \"metric\": {\n \"metric\": \"anrRate\",\n \"decimal_value\": {\n \"value\": \"3.1415926535\"\n }\n }\n },\n ]\n}\n```\n\nAvailable metrics\n-----------------\n\n\nNot all metrics and metric sets currently support anomaly detection. Here's the list of\ncurrently supported metrics:\n\n| Metric set | Supported metrics |\n|---------------------------------------------------------------------------------------------------------------------------|---------------------|\n| [vitals.anrrate](/play/developer/reporting/reference/rest/v1beta1/vitals.anrrate) | anrRate |\n| [vitals.crashrate](/play/developer/reporting/reference/rest/v1beta1/vitals.crashrate) | crashRate |\n| [vitals.excessivewakeuprate](/play/developer/reporting/reference/rest/v1beta1/vitals.excessivewakeuprate) | excessiveWakeupRate |\n| [vitals.stuckbackgroundwakelockrate](/play/developer/reporting/reference/rest/v1beta1/vitals.stuckbackgroundwakelockrate) | stuckBgWakelockRate |"]]