Commit 5933f85
committed
client: add pre-throttling demand RU/s metric
Add a new client-side Prometheus Gauge
`resource_manager_client_resource_group_demand_ru_per_sec` that tracks the
EMA of demanded RU/s before Resource Control throttling takes effect.
The existing `avgRUPerSec` is based on post-throttling consumption: when a
request is rejected by the token bucket, its RU cost is subtracted from the
consumption counter. This means the consumption-based EMA underreports the
true workload demand when the resource group is actively throttled.
The new demand metric samples RU cost at every `onRequestWaitImpl`,
`onResponseImpl`, `onResponseWaitImpl`, and `addRUConsumption` entry point,
accumulating into a monotonically increasing `demandRUTotal` counter that is
never subtracted on throttle failure. A demand EMA is then computed using the
same `movingAvgFactor` as the consumption EMA and flushed to the Gauge on
each `updateAvgRequestResourcePerSec` tick.
This enables operators to:
- See per-instance RU demand in Grafana (natural `instance` label).
- Aggregate cluster-wide demand via `sum by (resource_group)`.
- Identify the true workload peak via `max_over_time(...)`.
Close #10581
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <github@ipotato.me>1 parent dca466b commit 5933f85
3 files changed
Lines changed: 115 additions & 5 deletions
File tree
- client/resource_group/controller
- metrics
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
| |||
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
| 115 | + | |
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
| |||
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| 132 | + | |
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
| |||
136 | 144 | | |
137 | 145 | | |
138 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
139 | 153 | | |
140 | 154 | | |
141 | 155 | | |
| |||
220 | 234 | | |
221 | 235 | | |
222 | 236 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
227 | 242 | | |
228 | 243 | | |
229 | 244 | | |
| |||
257 | 272 | | |
258 | 273 | | |
259 | 274 | | |
| 275 | + | |
260 | 276 | | |
261 | 277 | | |
262 | 278 | | |
| |||
271 | 287 | | |
272 | 288 | | |
273 | 289 | | |
274 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
275 | 293 | | |
276 | 294 | | |
277 | 295 | | |
| |||
319 | 337 | | |
320 | 338 | | |
321 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
322 | 354 | | |
323 | 355 | | |
324 | 356 | | |
| |||
554 | 586 | | |
555 | 587 | | |
556 | 588 | | |
| 589 | + | |
557 | 590 | | |
558 | 591 | | |
559 | 592 | | |
| |||
611 | 644 | | |
612 | 645 | | |
613 | 646 | | |
| 647 | + | |
| 648 | + | |
614 | 649 | | |
615 | 650 | | |
616 | 651 | | |
| |||
652 | 687 | | |
653 | 688 | | |
654 | 689 | | |
| 690 | + | |
655 | 691 | | |
656 | 692 | | |
657 | 693 | | |
| |||
669 | 705 | | |
670 | 706 | | |
671 | 707 | | |
| 708 | + | |
672 | 709 | | |
673 | 710 | | |
674 | 711 | | |
| |||
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
72 | 83 | | |
73 | 84 | | |
74 | 85 | | |
| |||
162 | 173 | | |
163 | 174 | | |
164 | 175 | | |
| 176 | + | |
165 | 177 | | |
166 | 178 | | |
167 | 179 | | |
| |||
0 commit comments