Add proxy.process.http.429_responses metric#12878
Conversation
|
Found one correctness issue in the new metric verification helper:
Would you mind switching this to an anchored regex match so the assertion is exact? Something like |
bryancall
left a comment
There was a problem hiding this comment.
look at the comment on the PR
Add a new HTTP stat to track 429 (Too Many Requests) responses sent to clients. This is useful for monitoring rate-limiting behavior, as the rate_limit plugin defaults to returning 429 when limits are exceeded. The metric follows the same pattern as existing per-status-code counters (400-416) across HttpConfig, HttpTransact, traffic_top, and traffic_logstats. Also enhance the ATSReplayTest framework with a metric_checks feature that allows replay YAML files to declare expected metric values. After traffic completes, follow-up test runs automatically verify the metrics via traffic_ctl. This required creating the ATS process on the Test object (rather than a TestRun) when post-traffic verification is needed, so that ATS persists across test runs.
Thanks for the feedback. Update done. |
bryancall
left a comment
There was a problem hiding this comment.
Clean implementation following existing per-status-code counter patterns across all the right files (HttpConfig, HttpTransact, traffic_logstats, traffic_top, docs).
The metric_checks framework addition to ats_replay.test.ext is a nice improvement -- makes metric verification declarative in replay YAML files without per-test boilerplate. The _requires_persistent_ats() abstraction for Test vs TestRun ownership is well-factored for future extensions.
Add a new HTTP stat to track 429 (Too Many Requests) responses sent to clients. This is useful for monitoring rate-limiting behavior, as the rate_limit plugin defaults to returning 429 when limits are exceeded. The metric follows the same pattern as existing per-status-code counters (400-416) across HttpConfig, HttpTransact, traffic_top, and traffic_logstats.
Also enhance the ATSReplayTest framework with a metric_checks feature that allows replay YAML files to declare expected metric values. After traffic completes, follow-up test runs automatically verify the metrics via traffic_ctl. This required creating the ATS process on the Test object (rather than a TestRun) when post-traffic verification is needed, so that ATS persists across test runs.