REST Resource: projects.locations.instances.queryMetrics

Resource: QueryMetric

Represents a query metric.

JSON representation
{
  "name": string,
  "query": string,
  "userId": string,
  "queryOrigin": enum (QueryOrigin),
  "queryStartTime": string,
  "queryId": string,

  // Union field origin_metrics can be only one of the following:
  "searchMetrics": {
    object (SearchMetrics)
  }
  // End of list of possible types for union field origin_metrics.
}
Fields
name

string

Output only. Identifier. The resource name of the query metric. Format: projects/{project}/locations/{location}/instances/{instance}/queryMetrics/{queryMetric}

query

string

Output only. Actual user query

userId

string

Output only. The user ID of the person or service account that initiated the query.

queryOrigin

enum (QueryOrigin)

Output only. The origin of the query (e.g., 'Search', 'Dashboard').

queryStartTime

string (Timestamp format)

Output only. The exact timestamp when the user initiated the query.

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: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

queryId

string

Output only. Unique identifier for tracing the query end-to-end.

Union field origin_metrics. Detailed metrics and dimensions for the query. origin_metrics can be only one of the following:
searchMetrics

object (SearchMetrics)

Metrics for Search queries.

SearchMetrics

Detailed metrics and dimensions for a single search query.

JSON representation
{
  "querySource": enum (QuerySource),
  "queryType": enum (QueryType),
  "timeRangeBucket": enum (QueryTimeRangeBucket),
  "status": {
    object (Status)
  },
  "queryExecutionLatencyMs": string
}
Fields
querySource

enum (QuerySource)

Output only. The source of the search query.

queryType

enum (QueryType)

Output only. Type of search query.

timeRangeBucket

enum (QueryTimeRangeBucket)

Output only. The scan time range bucket of the search query.

status

object (Status)

Output only. Query execution Status.

queryExecutionLatencyMs

string (int64 format)

Output only. Query Execution Latency in milliseconds.

QuerySource

Search entry point/source (e.g., 'UI', 'API', 'LRO-API', 'Backstory API').

Enums
QUERY_SOURCE_UNSPECIFIED Query Source unspecified
QUERY_SOURCE_UI UI
QUERY_SOURCE_API Dataplane UdmSearch API
QUERY_SOURCE_SEARCH_LRO_API Dataplane LRO Search API
QUERY_SOURCE_BACKSTORY_API Backstory UdmSearch API
QUERY_SOURCE_ALL_APIS All API query sources combined (excludes UI).

QueryTimeRangeBucket

Scan Time Range Bucket.

Enums
QUERY_TIME_RANGE_BUCKET_UNSPECIFIED Query time range bucket unspecified.
UP_TO_ONE_HOUR <= 1 hour
ONE_HOUR_TO_ONE_DAY

1 hour up to 1 day

ONE_DAY_TO_SEVEN_DAYS

1 day up to 7 days

SEVEN_TO_THIRTY_DAYS

7 days up to 30 days

THIRTY_TO_NINETY_DAYS

30 days up to 90 days

GREATER_THAN_NINETY_DAYS

90 days

QueryOrigin

Distinguishes where the query was initiated from.

Enums
QUERY_ORIGIN_UNSPECIFIED Query Origin unspecified.
SEARCH Query Origin Search.

Methods

fetchTimeSeries

Fetches aggregated time series data derived from QueryMetrics.

list

Lists QueryMetrics for the instance.