Resource: Anomaly
Represents an anomaly detected in a dataset.
Our anomaly detection systems flag datapoints in a time series that fall outside of and expected range derived from historical data. Although those expected ranges have an upper and a lower bound, we only flag anomalies when the data has become unexpectedly worse, which usually corresponds to the case where the metric crosses the upper bound.
Multiple contiguous datapoints in a timeline outside of the expected range will be grouped into a single anomaly. Therefore, an anomaly represents effectively a segment of a metric's timeline. The information stored in the timelineSpec
, dimensions
and metric
can be used to fetch a full timeline with extended ragne for context.
Required permissions: to access this resource, the calling user needs the View app information (read-only) permission for the app.
JSON representation |
---|
{ "name": string, "metricSet": string, "timelineSpec": { object ( |
Fields | |
---|---|
name |
Identifier. Name of the anomaly. Format: apps/{app}/anomalies/{anomaly} |
metric |
Metric set resource where the anomaly was detected. |
timeline |
Timeline specification that covers the anomaly period. |
dimensions[] |
Combination of dimensions in which the anomaly was detected. |
metric |
Metric where the anomaly was detected, together with the anomalous value. |
TimelineSpec
Specification of the time-related aggregation parameters of a timeline.
Timelines have an aggregation period (DAILY
, HOURLY
, etc) which defines how events are aggregated in metrics.
The points in a timeline are defined by the starting DateTime of the aggregation period. The duration is implicit in the AggregationPeriod.
Hourly aggregation periods, when supported by a metric set, are always specified in UTC to avoid ambiguities around daylight saving time transitions, where an hour is skipped when adopting DST, and repeated when abandoning DST. For example, the timestamp '2021-11-07 01:00:00 America/Los_Angeles' is ambiguous since it can correspond to '2021-11-07 08:00:00 UTC' or '2021-11-07 09:00:00 UTC'.
Daily aggregation periods require specifying a timezone which will determine the precise instants of the start and the end of the day. Not all metric sets support all timezones, so make sure to check which timezones are supported by the metric set you want to query.
JSON representation |
---|
{ "aggregationPeriod": enum ( |
Fields | |
---|---|
aggregation |
Type of the aggregation period of the datapoints in the timeline. Intervals are identified by the date and time at the start of the interval. |
start |
Starting datapoint of the timeline (inclusive). Must be aligned to the aggregation period as follows:
The timezone of the end point must match the timezone of the start point. |
end |
Ending datapoint of the timeline (exclusive). See startTime for restrictions. The timezone of the end point must match the timezone of the start point. |
DimensionValue
Represents the value of a single dimension.
JSON representation |
---|
{ "dimension": string, "valueLabel": string, // Union field |
Fields | |
---|---|
dimension |
Name of the dimension. |
value |
Optional. Human-friendly label for the value, always in English. For example, 'Spain' for the 'ES' country code. Whereas the dimension value is stable, this value label is subject to change. Do not assume that the (value, valueLabel) relationship is stable. For example, the ISO country code 'MK' changed its name recently to 'North Macedonia'. |
Union field value . Actual value of the dimension. Type-dependent. value can be only one of the following: |
|
string |
Actual value, represented as a string. |
int64 |
Actual value, represented as an int64. |
MetricValue
Represents the value of a metric.
JSON representation |
---|
{ "metric": string, // Union field |
Fields | |
---|---|
metric |
Name of the metric. |
Union field value . Actual value of the metric. Type-dependent. value can be only one of the following: |
|
decimal |
Actual value, represented as a decimal number. |
Union field confidence_interval . If given, represents a confidence interval for value. confidence_interval can be only one of the following: |
|
decimal |
Confidence interval of a value that is of type |
DecimalConfidenceInterval
Represents the confidence interval of a metric.
JSON representation |
---|
{ "lowerBound": { object ( |
Fields | |
---|---|
lower |
The confidence interval's lower bound. |
upper |
The confidence interval's upper bound. |
Methods |
|
---|---|
|
Lists anomalies in any of the datasets. |