Closed AllenLuUber closed 10 months ago
Patch coverage: 100.00%
and project coverage change: +0.08%
:tada:
Comparison is base (
efa54f1
) 84.10% compared to head (e05334c
) 84.19%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Let's say you have added routing-delegate in the
tagsBlocklist
, state of cache on first request this would be the map structure:[req.procedure+req.routingdelegate+...] - [metrics[tags - routing-delegate:"-", procedure:"req-procedure", ...]]
For another request with different delegate key:[req.procedure+req.routingdelegate1+...] - [metrics[tags - routing-delegate:"-", procedure:"req-procedure", ...]]
It ended up creating same metrics instances which results in failure from constructor from net/metrics.In the PR, I was able to reproduce the issue using the added test before fixing the code:
The bug is we did not check from this
tagsBlocklist
when we are constructing the key for metrics reuse. It was always added. This diff makes it optional based on the values oftagsBlocklist
. Also changed the type to maps for faster lookup.tagsBlocklist