Keeping the threshold in a BPF map so you never detach XDP is a nice fix. When a link degrades, does GCRA drop the noisy burst fast enough that the Prometheus alert still fires on the real counts?
Thanks for reading it this closely, good question!
The alert doesn't depend on GCRA at all. Every slow request is counted before the limiter gets involved, so the counter always has the real number. GCRA only decides how many JSON lines get written. The alert reads the counter, so it still fires on the real counts.
The only place I can lose events is earlier, if the kernel ring buffer or the analysis queue fills up. I count those losses separately and have an alert on them, because that's exactly when things are going badly.
I haven't tested this on real hardware yet, only on my Soft-RoCE testbed, so I'm curious whether you've seen it behave differently in practice.