Method: projects.locations.queryMetrics.fetch

queryMetrics.fetch fetches the given database query level metrics.

HTTP request

POST https://databaseinsights.googleapis.com/v1beta/{parent=projects/*/locations/*}/queryMetrics:fetch

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The name of the location where we request metrics. Format: projects/{project}/locations/{location}

Request body

The request body contains data with the following structure:

JSON representation
{
  "resource": string,
  "promqlQuery": string,
  "startTime": string,
  "endTime": string
}
Fields
resource

string

Required. The resource name used for query metrics. It is the project ID in this case.

promqlQuery

string

Required. The promqlQuery to fetch the query metrics.

startTime

string

Optional. The startTime of the metrics in RFC3339 format.

endTime

string

Optional. The endTime of the metrics in RFC3339 format.

Response body

The response of the queryMetrics.fetch RPC.

If successful, the response body contains data with the following structure:

JSON representation
{
  "promqlResult": string
}
Fields
promqlResult

string

The result of the fetch query metrics.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the parent resource:

  • databaseinsights.queryMetrics.fetch

For more information, see the IAM documentation.