This repository has been archived by the owner on Aug 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshared.proto
320 lines (262 loc) · 9.11 KB
/
shared.proto
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
syntax = "proto3";
import "google/protobuf/timestamp.proto";
package pganalyze.collector;
option go_package = "github.com/pganalyze/collector/output/pganalyze_collector";
message NullString {
bool valid = 1;
string value = 2;
}
message NullInt32 {
bool valid = 1;
int32 value = 2;
}
message NullDouble {
bool valid = 1;
double value = 2;
}
message NullTimestamp {
bool valid = 1;
google.protobuf.Timestamp value = 2;
}
message PostgresVersion {
string full = 1;
string short = 2;
int64 numeric = 3;
}
message RoleReference {
string name = 1; // Role name
}
message DatabaseReference {
string name = 1; // Database name
}
message RelationReference {
int32 database_idx = 1;
string schema_name = 2;
string relation_name = 3;
}
message IndexReference {
int32 database_idx = 1;
string schema_name = 2;
string index_name = 3;
}
message FunctionReference {
int32 database_idx = 1;
string schema_name = 2;
string function_name = 3;
string arguments = 4;
}
message QueryReference {
int32 database_idx = 1;
int32 role_idx = 2;
bytes fingerprint = 3;
}
message QueryInformation {
int32 query_idx = 1;
string normalized_query = 2;
repeated int64 query_ids = 3;
}
message QueryExplainInformation {
int32 query_idx = 1;
string explain_output = 2;
string explain_error = 3;
enum ExplainFormat {
TEXT_EXPLAIN_FORMAT = 0;
JSON_EXPLAIN_FORMAT = 1;
}
ExplainFormat explain_format = 4;
enum ExplainSource {
STATEMENT_LOG_EXPLAIN_SOURCE = 0; // Generated based on statement log (log_min_duration_statement)
AUTO_EXPLAIN_EXPLAIN_SOURCE = 1; // Generated by auto_explain
EXTERNAL_EXPLAIN_SOURCE = 2; // EXPLAIN generated through external process (e.g. operator running EXPLAIN)
GENERIC_EXPLAIN_SOURCE = 3; // EXPLAIN generated based on unknown constant parameters
}
ExplainSource explain_source = 5;
}
message System {
SystemInformation system_information = 1;
string system_id = 2; // Unique identifier for this system
string system_scope = 3; // Name the system ID is scoped by (optional)
SchedulerStatistic scheduler_statistic = 10;
MemoryStatistic memory_statistic = 11;
CPUInformation cpu_information = 12;
repeated CPUReference cpu_references = 13;
repeated CPUStatistic cpu_statistics = 14;
repeated NetworkReference network_references = 15;
repeated NetworkStatistic network_statistics = 16;
repeated DiskReference disk_references = 17;
repeated DiskInformation disk_informations = 18;
repeated DiskStatistic disk_statistics = 19;
repeated DiskPartitionReference disk_partition_references = 20;
repeated DiskPartitionInformation disk_partition_informations = 21;
repeated DiskPartitionStatistic disk_partition_statistics = 22;
int32 data_directory_disk_partition_idx = 30; // Disk partition that the PostgreSQL data directory lives on
int32 xlog_disk_partition_idx = 31; // Disk partition that the PostgreSQL WAL lives on
uint64 xlog_used_bytes = 32; // Size of the WAL directory, in bytes (not necessarily the same as used bytes on the WAL partition!)
}
message SystemInformation {
enum SystemType {
SELF_HOSTED_SYSTEM = 0;
AMAZON_RDS_SYSTEM = 1;
HEROKU_SYSTEM = 2;
GOOGLE_CLOUD_SQL_SYSTEM = 3;
AZURE_DATABASE_SYSTEM = 4;
CRUNCHY_BRIDGE_SYSTEM = 5;
AIVEN_SYSTEM = 6;
TEMBO_SYSTEM = 7;
}
SystemType type = 1;
oneof info {
SystemInformationSelfHosted self_hosted = 2;
SystemInformationAmazonRDS amazon_rds = 3;
SystemInformationCrunchyBridge crunchy_bridge = 5;
}
map<string, string> resource_tags = 4;
google.protobuf.Timestamp boot_time = 10; // Timestamp for when the system was started (aka uptime)
}
message SystemInformationSelfHosted {
string hostname = 1;
string architecture = 2;
string operating_system = 3;
string platform = 4;
string platform_family = 5;
string platform_version = 6;
string virtualization_system = 7; // Name of the virtualization system (only if we're a guest)
string kernel_version = 8;
string database_system_identifier = 9; // Postgres internal system identifier from pg_controldata
}
message SystemInformationAmazonRDS {
string region = 1;
string instance_class = 2;
string instance_id = 3;
string status = 4;
string availability_zone = 5;
bool publicly_accessible = 6;
bool multi_az = 7;
string secondary_availability_zone = 8;
string ca_certificate = 9;
bool auto_minor_version_upgrade = 10;
reserved 11;
string preferred_maintenance_window = 12;
string preferred_backup_window = 14;
google.protobuf.Timestamp latest_restorable_time = 13;
int32 backup_retention_period_days = 15;
string master_username = 16;
string initial_db_name = 17;
google.protobuf.Timestamp created_at = 18;
bool enhanced_monitoring = 19;
bool performance_insights = 20;
bool postgres_log_export = 21;
bool iam_authentication = 22;
bool deletion_protection = 23;
string parameter_apply_status = 40;
bool parameter_pgss_enabled = 41;
bool parameter_auto_explain_enabled = 42;
bool is_aurora_postgres = 50;
}
message SystemInformationCrunchyBridge {
string cluster_name = 1;
google.protobuf.Timestamp created_at = 2;
string plan_id = 3;
string provider_id = 4;
string region_id = 5;
int32 cpu_units = 6;
int32 storage_gb = 7;
double memory_gb = 8;
}
message SchedulerStatistic {
double load_average_1min = 1;
double load_average_5min = 2;
double load_average_15min = 3;
}
message MemoryStatistic {
uint64 total_bytes = 1;
uint64 cached_bytes = 2;
uint64 buffers_bytes = 3;
uint64 free_bytes = 4;
uint64 writeback_bytes = 5;
uint64 dirty_bytes = 6;
uint64 slab_bytes = 7;
uint64 mapped_bytes = 8;
uint64 page_tables_bytes = 9;
uint64 active_bytes = 10;
uint64 inactive_bytes = 11;
uint64 available_bytes = 12;
uint64 swap_used_bytes = 13;
uint64 swap_total_bytes = 14;
uint64 huge_pages_size_bytes = 20;
uint64 huge_pages_free = 21;
uint64 huge_pages_total = 22;
uint64 huge_pages_reserved = 23;
uint64 huge_pages_surplus = 24;
uint64 application_bytes = 30; // Some systems only tell us how much memory PostgreSQL is using (and nothing else)
}
message CPUInformation {
string model = 1;
int32 cache_size_bytes = 2;
double speed_mhz = 3;
int32 socket_count = 4;
int32 physical_core_count = 5;
int32 logical_core_count = 6;
}
message CPUReference {
string core_id = 1; // Which CPU core these stats refer to (-1 for systems where we only have an aggregate for all cores)
}
message CPUStatistic {
int32 cpu_idx = 1;
double user_percent = 2;
double system_percent = 3;
double idle_percent = 4;
double nice_percent = 5;
double iowait_percent = 6;
double irq_percent = 7;
double soft_irq_percent = 8;
double steal_percent = 9;
double guest_percent = 10;
double guest_nice_percent = 11;
}
message NetworkReference {
string interface_name = 1;
}
message NetworkStatistic {
int32 network_idx = 1;
uint64 transmit_throughput_bytes_per_second = 2;
uint64 receive_throughput_bytes_per_second = 3;
}
message DiskReference {
string device_name = 1;
}
message DiskInformation {
int32 disk_idx = 1;
string disk_type = 2; // Disk type (hdd/sdd/io1/gp2)
string scheduler = 3; // Linux Scheduler (noop/anticipatory/deadline/cfq)
uint32 provisioned_iops = 4; // If applicable, how many IOPS are provisioned for this device
bool encrypted = 5; // If applicable, is this device encrypted? (default false)
}
message DiskStatistic {
int32 disk_idx = 1;
double read_operations_per_second = 2; // The average number of read requests that were issued to the device per second
double reads_merged_per_second = 3; // The average number of read requests merged per second that were queued to the device
double bytes_read_per_second = 4; // The average number of bytes read from the device per second
double avg_read_latency = 5; // The average time (in milliseconds) for read requests issued to the device to be served
double write_operations_per_second = 6; // The average number of write requests that were issued to the device per second
double writes_merged_per_second = 7; // The average number of write requests merged per second that were queued to the device
double bytes_written_per_second = 8; // The average number of bytes written to the device per second
double avg_write_latency = 9; // The average time (in milliseconds) for write requests issued to the device to be served
int32 avg_queue_size = 10; // Average I/O operations in flight at the same time (waiting or worked on by the device)
double utilization_percent = 12; // Percentage of CPU time during which I/O requests were issued to the device (bandwidth utilization for the device)
}
message DiskPartitionReference {
string mountpoint = 1;
}
message DiskPartitionInformation {
int32 disk_partition_idx = 1;
int32 disk_idx = 2;
string filesystem_type = 3; // ext4/zfs/etc.
string filesystem_opts = 4; // filesystem options (noatime, etc)
string partition_name = 5; // Platform-specific name for the partition (e.g. /dev/sda9)
}
message DiskPartitionStatistic {
int32 disk_partition_idx = 1;
uint64 used_bytes = 2;
uint64 total_bytes = 3;
}