-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
telemetry.proto
74 lines (58 loc) · 3.17 KB
/
telemetry.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
// Copyright 2021 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.
syntax = "proto3";
package cockroach.util.log.eventpb;
option go_package = "eventpb";
import "gogoproto/gogo.proto";
import "util/log/eventpb/events.proto";
import "util/log/eventpb/sql_audit_events.proto";
// Category: Telemetry events
// Channel: TELEMETRY
// Notes to CockroachDB maintainers: refer to doc.go at the package
// level for more details. Beware that JSON compatibility rules apply
// here, not protobuf.
// The comment at the top has a specific format for the doc generator.
// *Really look at doc.go before modifying this file.*
// SampledQuery is the SQL query event logged to the telemetry channel. It
// contains common SQL event/execution details.
message SampledQuery {
CommonEventDetails common = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true];
CommonSQLEventDetails sql = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true];
CommonSQLExecDetails exec = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true];
// skipped_queries indicate how many SQL statements were not
// considered for sampling prior to this one. If the field is
// omitted, or its value is zero, this indicates that no statement
// was omitted since the last event.
uint64 skipped_queries = 4 [(gogoproto.jsontag) = ",omitempty"];
// Cost of the query as estimated by the optimizer.
double cost_estimate = 5 [(gogoproto.jsontag) = ",omitempty"];
// The distribution of the DistSQL query plan (local, full, or partial).
string distribution = 6 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "redact:\"nonsensitive\""];
}
// CapturedIndexUsageStats
message CapturedIndexUsageStats {
CommonEventDetails common = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true];
// Couldn't use roachpb.CollectedIndexUsageStatistics due to circular dependency.
// TotalReadCount is the number of times this index has been read from.
uint64 total_read_count = 2;
// LastRead is the timestamp that this index was last being read from.
string last_read = 3 [(gogoproto.jsontag) = ",omitempty"];
// TableID is the ID of the table this index is created on. This is same as
// descpb.TableID and is unique within the cluster.
uint32 table_id = 8 [(gogoproto.customname) = "TableID"];
// IndexID is the ID of the index within the scope of the given table.
uint32 index_id = 9 [(gogoproto.customname) = "IndexID"];
string database_name = 10 [(gogoproto.jsontag) = ",omitempty"];
string table_name = 11 [(gogoproto.jsontag) = ",omitempty"];
string index_name = 12 [(gogoproto.jsontag) = ",omitempty"];
string index_type = 13 [(gogoproto.jsontag) = ",omitempty"];
bool is_unique = 14 [(gogoproto.jsontag) = ",omitempty"];
bool is_inverted = 15 [(gogoproto.jsontag) = ",omitempty"];
}