sinhaparth5 opened a new pull request, #13601:
URL: https://github.com/apache/trafficserver/pull/13601

   `RateLimiter::initializeMetrics()` takes the tag before the prefix:
   
   ```cpp
   void initializeMetrics(uint type, std::string tag, std::string prefix = 
RATE_LIMITER_METRIC_PREFIX)
   ```
   
   The remap path passes them in that order (`txn_limiter.cc:182`), but the YAML
   path passed `(prefix, tag)`. `metric_helper()` builds the name as
   `prefix + "." + type + "." + tag`, so every SNI limiter with a `metrics` node
   came out as `tag.sni.prefix`.
   
   This affects a `metrics` node even when only one of the two keys is set, 
since
   the unset one takes its default and the two get swapped together.
   
   ### Testing
   
   New autest `rate_limit_metric_names` covers all three shapes: both keys set,
   only `tag` set, and only `prefix` set.
   
   Run against the plugin built without this change, `traffic_ctl metric match`
   reports the reversed names, which is what the test now pins:
   
   ```
   onlytag.sni.plugin.rate_limiter.queued          (expected 
plugin.rate_limiter.sni.onlytag.queued)
   prefixonly.example.com.sni.onlyprefix.queued    (expected 
onlyprefix.sni.prefixonly.example.com.queued)
   ```
   
   All 7 rate_limit autests pass with the change.
   
   Fixes: #13599
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to