Skip to content

Commit 1645aa3

Browse files
Merge pull request #146762 from angles-n-daemons/backport25.2-144567
release-25.2: eventpb: move hot range log events to the health channel
2 parents 9328bb7 + aaef90e commit 1645aa3

File tree

5 files changed

+79
-79
lines changed

5 files changed

+79
-79
lines changed

docs/generated/eventlog.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -181,34 +181,6 @@ events.
181181
| `StoreID` | | no |
182182

183183

184-
#### Common fields
185-
186-
| Field | Description | Sensitive |
187-
|--|--|--|
188-
| `Timestamp` | The timestamp of the event. Expressed as nanoseconds since the Unix epoch. | no |
189-
| `EventType` | The type of the event. | no |
190-
191-
### `hot_ranges_stats`
192-
193-
An event of type `hot_ranges_stats`
194-
195-
196-
| Field | Description | Sensitive |
197-
|--|--|--|
198-
| `RangeID` | | no |
199-
| `Qps` | | no |
200-
| `SchemaName` | SchemaName is the name of the schema in which the index was created. | yes |
201-
| `LeaseholderNodeID` | LeaseholderNodeID indicates the Node ID that is the current leaseholder for the given range. | no |
202-
| `WritesPerSecond` | Writes per second is the recent number of keys written per second on this range. | no |
203-
| `ReadsPerSecond` | Reads per second is the recent number of keys read per second on this range. | no |
204-
| `WriteBytesPerSecond` | Write bytes per second is the recent number of bytes written per second on this range. | no |
205-
| `ReadBytesPerSecond` | Read bytes per second is the recent number of bytes read per second on this range. | no |
206-
| `CPUTimePerSecond` | CPU time per second is the recent cpu usage in nanoseconds of this range. | no |
207-
| `Databases` | Databases for the range. | yes |
208-
| `Tables` | Tables for the range | yes |
209-
| `Indexes` | Indexes for the range | yes |
210-
211-
212184
#### Common fields
213185

214186
| Field | Description | Sensitive |
@@ -475,6 +447,34 @@ Events in this category pertain to the health of one or more servers.
475447
Events in this category are logged to the `HEALTH` channel.
476448

477449

450+
### `hot_ranges_stats`
451+
452+
An event of type `hot_ranges_stats`
453+
454+
455+
| Field | Description | Sensitive |
456+
|--|--|--|
457+
| `RangeID` | | no |
458+
| `Qps` | | no |
459+
| `SchemaName` | SchemaName is the name of the schema in which the index was created. | yes |
460+
| `LeaseholderNodeID` | LeaseholderNodeID indicates the Node ID that is the current leaseholder for the given range. | no |
461+
| `WritesPerSecond` | Writes per second is the recent number of keys written per second on this range. | no |
462+
| `ReadsPerSecond` | Reads per second is the recent number of keys read per second on this range. | no |
463+
| `WriteBytesPerSecond` | Write bytes per second is the recent number of bytes written per second on this range. | no |
464+
| `ReadBytesPerSecond` | Read bytes per second is the recent number of bytes read per second on this range. | no |
465+
| `CPUTimePerSecond` | CPU time per second is the recent cpu usage in nanoseconds of this range. | no |
466+
| `Databases` | Databases for the range. | yes |
467+
| `Tables` | Tables for the range | yes |
468+
| `Indexes` | Indexes for the range | yes |
469+
470+
471+
#### Common fields
472+
473+
| Field | Description | Sensitive |
474+
|--|--|--|
475+
| `Timestamp` | The timestamp of the event. Expressed as nanoseconds since the Unix epoch. | no |
476+
| `EventType` | The type of the event. | no |
477+
478478
### `runtime_stats`
479479

480480
An event of type `runtime_stats` is recorded every 10 seconds as server health metrics.

pkg/server/structlogging/hot_ranges_log_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (spy *hotRangesLogSpy) Intercept(e []byte) {
4343
}
4444

4545
re := regexp.MustCompile(`"EventType":"hot_ranges_stats"`)
46-
if entry.Channel != logpb.Channel_OPS || !re.MatchString(entry.Message) {
46+
if entry.Channel != logpb.Channel_HEALTH || !re.MatchString(entry.Message) {
4747
return
4848
}
4949

pkg/util/log/eventpb/cluster_events.proto

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -202,50 +202,3 @@ message TenantSharedServiceStop {
202202

203203
CommonSharedServiceEventDetails shared = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true];
204204
}
205-
206-
// HotRangesStats
207-
message HotRangesStats {
208-
CommonEventDetails common = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true];
209-
210-
int64 range_id = 2 [(gogoproto.jsontag) = ",omitempty", (gogoproto.customname) = "RangeID"];
211-
212-
double qps = 3 [(gogoproto.jsontag) = ",includeempty"];
213-
214-
// SchemaName is the name of the schema in which the index was created.
215-
string schema_name = 7 [(gogoproto.jsontag) = ",omitempty"];
216-
217-
// LeaseholderNodeID indicates the Node ID that is the current leaseholder for the given range.
218-
int32 leaseholder_node_id = 8 [(gogoproto.customname) = "LeaseholderNodeID", (gogoproto.jsontag) = ",omitempty"];
219-
220-
// Writes per second is the recent number of keys written per second on
221-
// this range.
222-
double writes_per_second = 9 [(gogoproto.jsontag) = ",omitempty"];
223-
224-
// Reads per second is the recent number of keys read per second on
225-
// this range.
226-
double reads_per_second = 10 [(gogoproto.jsontag) = ",omitempty"];
227-
228-
// Write bytes per second is the recent number of bytes written per second on
229-
// this range.
230-
double write_bytes_per_second = 11 [(gogoproto.jsontag) = ",omitempty"];
231-
232-
// Read bytes per second is the recent number of bytes read per second on
233-
// this range.
234-
double read_bytes_per_second = 12 [(gogoproto.jsontag) = ",omitempty"];
235-
236-
// CPU time per second is the recent cpu usage in nanoseconds of this range.
237-
double cpu_time_per_second = 13 [(gogoproto.customname) = "CPUTimePerSecond", (gogoproto.jsontag) = ",omitempty"];
238-
239-
// Databases for the range.
240-
repeated string databases = 16;
241-
// Tables for the range
242-
repeated string tables = 17;
243-
// Indexes for the range
244-
repeated string indexes = 18;
245-
246-
// previously used for database, table, and index name
247-
// syntax reserved 4 to 6 breaks json encoding checks
248-
reserved 4;
249-
reserved 5;
250-
reserved 6;
251-
}

pkg/util/log/eventpb/eventlog_channels_generated.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/util/log/eventpb/health_events.proto

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,50 @@ message RuntimeStats {
6060
// The bytes sent on all network interfaces since this process started.
6161
uint64 net_host_send_bytes = 19 [(gogoproto.jsontag) = ",omitempty"];
6262
}
63+
64+
// HotRangesStats
65+
message HotRangesStats {
66+
CommonEventDetails common = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "", (gogoproto.embed) = true];
67+
68+
int64 range_id = 2 [(gogoproto.jsontag) = ",omitempty", (gogoproto.customname) = "RangeID"];
69+
70+
double qps = 3 [(gogoproto.jsontag) = ",includeempty"];
71+
72+
// SchemaName is the name of the schema in which the index was created.
73+
string schema_name = 7 [(gogoproto.jsontag) = ",omitempty"];
74+
75+
// LeaseholderNodeID indicates the Node ID that is the current leaseholder for the given range.
76+
int32 leaseholder_node_id = 8 [(gogoproto.customname) = "LeaseholderNodeID", (gogoproto.jsontag) = ",omitempty"];
77+
78+
// Writes per second is the recent number of keys written per second on
79+
// this range.
80+
double writes_per_second = 9 [(gogoproto.jsontag) = ",omitempty"];
81+
82+
// Reads per second is the recent number of keys read per second on
83+
// this range.
84+
double reads_per_second = 10 [(gogoproto.jsontag) = ",omitempty"];
85+
86+
// Write bytes per second is the recent number of bytes written per second on
87+
// this range.
88+
double write_bytes_per_second = 11 [(gogoproto.jsontag) = ",omitempty"];
89+
90+
// Read bytes per second is the recent number of bytes read per second on
91+
// this range.
92+
double read_bytes_per_second = 12 [(gogoproto.jsontag) = ",omitempty"];
93+
94+
// CPU time per second is the recent cpu usage in nanoseconds of this range.
95+
double cpu_time_per_second = 13 [(gogoproto.customname) = "CPUTimePerSecond", (gogoproto.jsontag) = ",omitempty"];
96+
97+
// Databases for the range.
98+
repeated string databases = 16;
99+
// Tables for the range
100+
repeated string tables = 17;
101+
// Indexes for the range
102+
repeated string indexes = 18;
103+
104+
// previously used for database, table, and index name
105+
// syntax reserved 4 to 6 breaks json encoding checks
106+
reserved 4;
107+
reserved 5;
108+
reserved 6;
109+
}

0 commit comments

Comments
 (0)