feat(rate_limit): log the rule name when a check fails open

Description

When a rate-limit check fails open, the WARN log names the limiter but not the rule, so a limiter with a dozen-plus rules gives no way to tell which one failed.

This came up in production: ~500/hr Regexp::TimeoutError on rack_request, which carries around 15 path regexes. Identifying the culprit meant loading GitLab's regexes locally and timing them by hand. With rule in the log it's a Kibana breakdown.

Adds rule to log_error, sourced from a per-call cursor set before the match, so a raise from the match itself (Regexp::TimeoutError) is attributed too. Covers both check and peek. Fail-open behaviour and rescue scope are unchanged.

rule is null when the error is raised outside the rule loop, e.g. bad identifier input or a failure after the walk finishes.

Related to gitlab-com/gl-infra/production-engineering#28882

Merge request reports

Loading
Loading