Tool: get_advanced_time_series_wait_event_stats
Fetches time-series history of wait event statistics to analyze contention trends for a requested AlloyDB instance within a specified time period. Supports filtering by database name, database user, and a specific query ID, as well as selecting the aggregation level (by wait class or granular wait event). Returns time-series data including rate of time spent (rate(time_spent)) grouped by wait class or event. Requires advanced query insights to be enabled.
The following sample demonstrate how to use curl to invoke the get_advanced_time_series_wait_event_stats MCP tool.
| Curl Request |
|---|
curl --location 'https://LOCATION-databaseinsights.googleapis.com/mcp' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "get_advanced_time_series_wait_event_stats", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Replace LOCATION with the location of your AlloyDB instance (for example, if your instance is in us-east7, use https://us-east7-databaseinsights.googleapis.com/mcp).
Input Schema
Message for fetching time-series history of wait event statistics (rate of time spent, grouped by wait class or event) for the requested instance.
FetchWaitEventTimeSeriesRequest
| JSON representation |
|---|
{
"parent": string,
"fullResourceName": string,
"startTime": string,
"endTime": string,
"database": string,
"username": string,
"queryId": string,
"view": enum ( |
| Fields | |
|---|---|
parent |
Required. The name of the location where we request history. Format: |
fullResourceName |
Required. Identifies the AlloyDB instance. |
startTime |
Optional. The beginning of the interval for fetching stats in RFC3339 format. |
endTime |
Optional. The end of the interval for fetching stats in RFC3339 format. |
database |
Optional. Filters results to a specific database name. |
username |
Optional. Filters results to a specific database user. |
queryId |
Optional. Fetches history for a specific query id. |
view |
Optional. The view used to group the wait event results. Defaults to WAIT_CLASS. |
WaitEventView
Defines the aggregation level for wait statistics.
| Enums | |
|---|---|
WAIT_EVENT_VIEW_UNSPECIFIED |
The view is not specified. |
WAIT_CLASS |
Default: Aggregates by wait class (e.g., IO, Lock, CPU). |
WAIT_EVENT |
Granular: Aggregates by specific wait event (e.g., DataFileRead, ClientWrite). |
Output Schema
Response message containing time-series history of wait event statistics (rate of time spent, grouped by wait class or event).
FetchWaitEventTimeSeriesResponse
| JSON representation |
|---|
{ "timeseries": [ { object ( |
| Fields | |
|---|---|
timeseries[] |
Structured time-series data grouped by wait class. |
metadata |
Metadata for the time series values. |
TimeSeries
| JSON representation |
|---|
{
"groupbyFieldValues": [
string
],
"values": [
{
object ( |
| Fields | |
|---|---|
groupbyFieldValues[] |
Contains the same fields in the same order as in input request. |
values[] |
Contains timeseries data for the metric. |
TimeSeriesMetricValues
| JSON representation |
|---|
{
"interval": {
object ( |
| Fields | |
|---|---|
interval |
Represents tumble interval start timestamp. |
value |
Contains the metric values for the time interval. |
metadata |
Field that contains the trace ID / span ID. |
Interval
| JSON representation |
|---|
{ "startTime": string, "endTime": string } |
| Fields | |
|---|---|
startTime |
Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start. 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: |
endTime |
Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. 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: |
Timestamp
| JSON representation |
|---|
{ "seconds": string, "nanos": integer } |
| Fields | |
|---|---|
seconds |
Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be between -62135596800 and 253402300799 inclusive (which corresponds to 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). |
nanos |
Non-negative fractions of a second at nanosecond resolution. This field is the nanosecond portion of the duration, not an alternative to seconds. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be between 0 and 999,999,999 inclusive. |
Value
| JSON representation |
|---|
{ // Union field |
| Fields | |
|---|---|
Union field kind. The kind of value. kind can be only one of the following: |
|
nullValue |
Represents a JSON |
numberValue |
Represents a JSON number. Must not be |
stringValue |
Represents a JSON string. |
boolValue |
Represents a JSON boolean ( |
structValue |
Represents a JSON object. |
listValue |
Represents a JSON array. |
Struct
| JSON representation |
|---|
{ "fields": { string: value, ... } } |
| Fields | |
|---|---|
fields |
Unordered map of dynamically typed values. An object containing a list of |
FieldsEntry
| JSON representation |
|---|
{ "key": string, "value": value } |
| Fields | |
|---|---|
key |
|
value |
|
ListValue
| JSON representation |
|---|
{ "values": [ value ] } |
| Fields | |
|---|---|
values[] |
Repeated field of dynamically typed values. |
ResultSetMetadata
| JSON representation |
|---|
{
"fields": [
{
object ( |
| Fields | |
|---|---|
fields[] |
Information on all columns of the result row. |
Field
| JSON representation |
|---|
{
"name": string,
"type": enum ( |
| Fields | |
|---|---|
name |
Field name according to the public schema. |
type |
Field type defined according to the public schema or depends on the aggregation method in case of an aggregation field. |
description |
Description of the value the field holds. |
NullValue
Represents a JSON null.
NullValue is a sentinel, using an enum with only one value to represent the null value for the Value type union.
A field of type NullValue with any value other than 0 is considered invalid. Most ProtoJSON serializers will emit a Value with a null_value set as a JSON null regardless of the integer value, and so will round trip to a 0 value.
| Enums | |
|---|---|
NULL_VALUE |
Null value. |
FieldType
Type of field, which will define how to read a particular key.
| Enums | |
|---|---|
FIELD_TYPE_UNSPECIFIED |
Field type is unknown. |
INT64 |
Int64 field type. |
UINT64 |
Unsigned int64 field type. |
INT32 |
Int32 field type. |
UINT32 |
Unsigned int64 field type. |
STRING |
String field type. |
DOUBLE |
Double based data type. |
ARRAY |
Trace info type. |
BOOL |
Boolean field type. |
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ✅ | Read Only Hint: ✅ | Open World Hint: ❌