Commit eb522ae
authored
feat: complete the Kea hook's DHCP drop census and count replies (#3320)
The Kea hook's drop counter under-counts: two hard-drop paths and six
allocation/renewal refusals log without incrementing, and there is no
reply counter at all -- so grant rate and the full drop taxonomy are
both blind spots on the primary DHCP serving path. This closes both.
- `carbide_dhcp_replies_sent_total{message_type}` -- new, counts every
reply Kea actually sends (`offer`/`ack`/`nak`/`other`), incremented at
the end of `pkt4_send` and suppressed when the exchange was marked
dropped. Lease grants are the `offer`/`ack` series, matching the DPU
dhcp-server's counter of the same name.
- `carbide_dhcp_dropped_requests_total{reason}` -- the exposed name, the
`reason` label key, and every pre-existing reason string stay
byte-identical for existing dashboards, while eight previously-uncounted
paths now increment it: option-encoding failures, missing machine
context, and the six allocation/renewal refusals. A refused REQUEST
counts both its refusal and the `nak` reply that follows -- both really
happened.
Notable details:
- The raw-string reason plumbing hardens into a bounded `DropReason`
enum with a manual `LabelValue` impl pinning the legacy strings
verbatim; unrecognized FFI strings bucket to `Unknown` instead of
minting new label values.
- All events are metric-only (`log = off`): the Kea process has no
tracing subscriber, and every existing C++ LOG line stays untouched --
the C++ diff is pure one-line increments beside the drops they count.
- An option-encoding failure that throws on several options of one reply
counts that packet's drop once (status-guarded).
- The in-tree real-Kea integration tests -- the hook loaded into an
actual multi-threaded Kea -- pass with the new counters live.
Tests added!
This supports #3177
Signed-off-by: Chet Nichols III <chetn@nvidia.com>1 parent 2ab3c5c commit eb522ae
6 files changed
Lines changed: 580 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
| |||
519 | 524 | | |
520 | 525 | | |
521 | 526 | | |
| 527 | + | |
522 | 528 | | |
523 | 529 | | |
524 | 530 | | |
| |||
543 | 549 | | |
544 | 550 | | |
545 | 551 | | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
546 | 560 | | |
547 | 561 | | |
548 | 562 | | |
| |||
603 | 617 | | |
604 | 618 | | |
605 | 619 | | |
| 620 | + | |
606 | 621 | | |
607 | 622 | | |
608 | 623 | | |
| |||
620 | 635 | | |
621 | 636 | | |
622 | 637 | | |
| 638 | + | |
623 | 639 | | |
624 | 640 | | |
625 | 641 | | |
| |||
631 | 647 | | |
632 | 648 | | |
633 | 649 | | |
| 650 | + | |
634 | 651 | | |
635 | 652 | | |
636 | 653 | | |
| |||
683 | 700 | | |
684 | 701 | | |
685 | 702 | | |
| 703 | + | |
686 | 704 | | |
687 | 705 | | |
688 | 706 | | |
| |||
692 | 710 | | |
693 | 711 | | |
694 | 712 | | |
| 713 | + | |
695 | 714 | | |
696 | 715 | | |
697 | 716 | | |
| |||
700 | 719 | | |
701 | 720 | | |
702 | 721 | | |
| 722 | + | |
703 | 723 | | |
704 | 724 | | |
705 | 725 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | | - | |
68 | | - | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
242 | 265 | | |
243 | 266 | | |
244 | 267 | | |
245 | 268 | | |
246 | 269 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 270 | + | |
| 271 | + | |
252 | 272 | | |
253 | 273 | | |
254 | 274 | | |
| |||
0 commit comments