forked from GoogleCloudPlatform/professional-services
-
Notifications
You must be signed in to change notification settings - Fork 0
/
queries.toml
209 lines (181 loc) · 7.53 KB
/
queries.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# queries.toml
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Please refer to MQL document and make sure the query works in the Metrics
# Explorer without any errors. For units conversion (`scale()`), see below.
# https://cloud.google.com/monitoring/mql/reference#unit-code-def
#
# If you change the structure of this file, make sure to also update
# https://github.com/GoogleCloudPlatform/professional-services/blob/main/tools/capacity-planner-sheets-extension/toml_to_queries_js.py
[l7xlb]
product_name = "HTTP(S) Load Balancing"
[l7xlb.qps]
metric_name = "QPS"
query = """fetch https_lb_rule
| metric 'loadbalancing.googleapis.com/https/request_count'
| align rate(1m)
| every 1m
| group_by [resource.region], [value_requst_count_aggregate: aggregate(value.request_count)]"""
[l7xlb.ingress]
metric_name = "Ingress Gbps"
query = """fetch https_lb_rule
| metric 'loadbalancing.googleapis.com/https/request_bytes_count'
| align rate(1m)
| every 1m
| group_by [resource.region], [value_requst_bytes_count_aggregate: aggregate(value.request_bytes_count)]
| scale('Gibit/s')"""
[l7xlb.egress]
metric_name = "Egress Gbps"
query = """fetch https_lb_rule
| metric 'loadbalancing.googleapis.com/https/response_bytes_count'
| align rate(1m)
| every 1m
| group_by [resource.region], [value_response_bytes_count_aggregate: aggregate(value.response_bytes_count)]
| scale('Gibit/s')"""
[l4xlb]
product_name = "TCP/UDP Load Balancing"
[l4xlb.ingress]
metric_name = "Ingress Gbps"
query = """fetch tcp_lb_rule
| metric 'loadbalancing.googleapis.com/l3/external/ingress_bytes_count'
| align rate(1m)
| every 1m
| group_by [resource.region], [value_ingress_bytes_count_aggregate: aggregate(value.ingress_bytes_count)]
| scale ('Gibit/s')"""
[l4xlb.egress]
metric_name = "Egress Gbps"
query = """fetch tcp_lb_rule
| metric 'loadbalancing.googleapis.com/l3/external/egress_bytes_count'
| align rate(1m)
| every 1m
| group_by [resource.region], [value_egress_bytes_count_aggregate: aggregate(value.egress_bytes_count)]
| scale ('Gibit/s')"""
[cdn]
product_name = "Cloud CDN"
[cdn.qps]
metric_name = "QPS"
query = """fetch https_lb_rule
| metric 'loadbalancing.googleapis.com/https/request_count'
| filter (metric.cache_result != 'DISABLED')
| align rate(1m)
| every 1m
| group_by [resource.region],
[value_requst_count_aggregate: aggregate(value.request_count)]"""
[cdn.egress]
metric_name = "Egress Gbps"
query = """fetch https_lb_rule
| metric 'loadbalancing.googleapis.com/https/response_bytes_count'
| filter (metric.cache_result != 'DISABLED')
| align rate(1m)
| every 1m
| group_by [], [value_response_bytes_count_aggregate: aggregate(value.response_bytes_count)]
| scale ('Gibit/s')"""
[pubsub]
product_name = "Cloud Pub/Sub"
[pubsub.pub_qps]
metric_name = "Publisher QPS"
query = """fetch pubsub_topic
| metric 'pubsub.googleapis.com/topic/send_request_count'
| align rate(1m)
| every 1m
| group_by [resource.topic_id], [value_send_request_count_aggregate: aggregate(value.send_request_count)]"""
[pubsub.pub_mbps]
metric_name = "Publisher Throughput GB/s"
query = """fetch pubsub_topic
| metric 'pubsub.googleapis.com/topic/byte_cost'
| align rate(1m)
| every 1m
| group_by [resource.topic_id], [value_byte_cost_aggregate: aggregate(value.byte_cost)]
| scale ('GiBy/s')"""
[pubsub.pub_avg_msg_size]
metric_name = "Publisher Average Message Size"
query = """fetch pubsub_topic
| metric 'pubsub.googleapis.com/topic/message_sizes'
| align delta(1m)
| every 1m
| group_by [resource.topic_id], [value_message_sizes_mean: mean(value.message_sizes)]
| scale('By')"""
[pubsub.sub_pull_qps]
metric_name = "Subscriber Pull QPS"
query = """fetch pubsub_subscription
| metric 'pubsub.googleapis.com/subscription/pull_request_count'
| align rate(1m)
| every 1m
| group_by [resource.subscription_id], [value_pull_request_count_aggregate: aggregate(value.pull_request_count)]"""
[pubsub.sub_strpull_qps]
metric_name = "Subscriber Streaming Pull QPS"
query = """fetch pubsub_subscription
| metric 'pubsub.googleapis.com/subscription/streaming_pull_response_count'
| align rate(1m)
| every 1m
| group_by [resource.subscription_id], [value_streaming_pull_response_count_aggregate: aggregate(value.streaming_pull_response_count)]"""
[pubsub.sub_mbps]
metric_name = "Subscriber Throughput GB/s"
query = """fetch pubsub_subscription
| metric 'pubsub.googleapis.com/subscription/byte_cost'
| align rate(1m)
| every 1m
| group_by [resource.subscription_id], [value_byte_cost_aggregate: aggregate(value.byte_cost)]
| scale ('GiBy/s')"""
[bigtable]
product_name = "Cloud BigTable"
[bigtable.qps]
metric_name = "QPS"
query = """fetch bigtable_table
| metric 'bigtable.googleapis.com/server/request_count'
| align rate(1m)
| every 1m
| group_by [], [value_request_count_aggregate: aggregate(value.request_count)]"""
[bigtable.ingress]
metric_name = "Ingress MB/s"
query = """fetch bigtable_table
| metric 'bigtable.googleapis.com/server/received_bytes_count'
| align rate(1m)
| every 1m
| group_by [], [value_received_bytes_count_aggregate: aggregate(value.received_bytes_count)]
| scale ('MiBy/s')"""
[bigtable.egress]
metric_name = "Egress MB/s"
query = """fetch bigtable_table
| metric 'bigtable.googleapis.com/server/sent_bytes_count'
| align rate(1m)
| every 1m
| group_by [], [value_sent_bytes_count_aggregate: aggregate(value.sent_bytes_count)]
| scale ('MiBy/s')"""
[spanner]
product_name = "Cloud Spanner"
[spanner.qps]
metric_name = "QPS"
query = """fetch spanner_instance
| metric 'spanner.googleapis.com/api/api_request_count'
| align rate(1m)
| every 1m
| group_by [], [value_api_request_count_aggregate: aggregate(value.api_request_count)]"""
[gcs]
product_name = "Cloud Storage"
[gcs.qps]
metric_name = "QPS"
query = """fetch gcs_bucket
| metric 'storage.googleapis.com/api/request_count'
| align rate(1m)
| every 1m
| group_by [resource.location], [value_request_count_aggregate: aggregate(value.request_count)]"""
[gcs.egress]
metric_name = "Egress MiB/s"
query = """fetch gcs_bucket
| metric 'storage.googleapis.com/network/sent_bytes_count'
| align rate(1m)
| every 1m
| group_by [resource.location], [value_sent_bytes_count_aggregate: aggregate(value.sent_bytes_count)]
| scale ('MiBy/s')"""