- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- TimeSeriesView
- TimeSeriesDataPoint
- LatencyMetrics
- FailureMetrics
Full name: projects.locations.instances.queryMetrics.fetchTimeSeries
Fetches aggregated time series data derived from QueryMetrics. This is a custom method (AIP-136) designed for generating data for trend charts. Instead of returning individual QueryMetric resources, it returns time-bucketed data points (TimeSeriesDataPoint) with calculated aggregations (e.g., average latency, p95, failure counts) based on the requested view and time range.
HTTP request
GET https://{endpoint}/v1alpha/{parent}/queryMetrics:fetchTimeSeries
Where {endpoint} is one of the supported service endpoints.
Path parameters
| Parameters | |
|---|---|
parent |
Required. The parent instance resource name. Format: projects/{project}/locations/{location}/instances/{instance} |
Query parameters
| Parameters | |
|---|---|
timeRange |
Required. Time range for the time series. |
view |
Optional. Specifies which metrics to return in the time series. If unspecified, defaults to LATENCY. |
filter |
Optional. A filter expression that filters query metrics included in the time series. Supports equality filtering by searchMetrics.query_source with string values only. Allowed values for searchMetrics.query_source: - "QUERY_SOURCE_UI" - "QUERY_SOURCE_API" - "QUERY_SOURCE_SEARCH_LRO_API" - "QUERY_SOURCE_BACKSTORY_API" - "QUERY_SOURCE_ALL_APIS" Multiple query sources can be combined by Example: "searchMetrics.query_source = 'QUERY_SOURCE_BACKSTORY_API' OR searchMetrics.query_source = 'QUERY_SOURCE_SEARCH_LRO_API'" |
Request body
The request body must be empty.
Response body
Response message for queryMetrics.fetchTimeSeries.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{
"dataPoints": [
{
object ( |
| Fields | |
|---|---|
dataPoints[] |
Aggregated query metric data points. Note that the aggregations will be done over 1 day intervals. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platformhttps://www.googleapis.com/auth/chroniclehttps://www.googleapis.com/auth/chronicle.readonly
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the parent resource:
chronicle.queryMetrics.list
For more information, see the IAM documentation.
TimeSeriesView
Views to apply to the query time series metrics.
| Enums | |
|---|---|
TIME_SERIES_VIEW_UNSPECIFIED |
Defaults to LATENCY view if unspecified. |
LATENCY |
Returns both average and P95 latency metrics. |
FAILURE |
Returns only failure metrics. |
LATENCY_AVG |
Returns only average latency metrics. |
LATENCY_P95 |
Returns only P95 latency metrics. |
TimeSeriesDataPoint
Represents a single data point in the time series.
| JSON representation |
|---|
{ "bucketStartTime": string, "querySource": enum ( |
| Fields | |
|---|---|
bucketStartTime |
The start time of the bucket. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
querySource |
The source of the queries for this data point. |
timeRangeBucket |
The scan time range bucket of the queries for this data point. |
querySources[] |
The sources of the queries for this data point. |
Union field metrics. The metrics payload. The type of metric returned matches the requested view. metrics can be only one of the following: |
|
latencyMetrics |
Aggregated latency metrics for successful queries in this bucket. |
failureMetrics |
Aggregated failure rate metrics for queries in this bucket. |
LatencyMetrics
Aggregated latency metrics.
| JSON representation |
|---|
{ "avgLatencyMs": number, "p95LatencyMs": number } |
| Fields | |
|---|---|
avgLatencyMs |
Average latency in milliseconds. |
p95LatencyMs |
P95 latency in milliseconds. |
FailureMetrics
Aggregated failure metrics.
| JSON representation |
|---|
{ "failureCount": string, "totalCount": string, "failureRate": number } |
| Fields | |
|---|---|
failureCount |
Number of failed queries. |
totalCount |
Total number of queries. |
failureRate |
Failure rate (failureCount / totalCount). |