SIGN IN SIGN UP

chore(observability): enhance log rate limiting layer to apply the per component (#6563)

This modifies our tracing rate limiting logic to apply the rate limit separately per component, by using the `component_name` from span attributes, to avoid components masking logs from other components when they share a tracing call site (through sharing code).

This required refactoring the tracing rate limit logic to be a layer that wraps another layer rather than a layer that wraps a subscriber as we need access to the event data but the layer only has access to the event by reference in the observer methods (like `on_event`). Instead, we swap the `FmtSubscriber` for the `fmt::Layer` and wrap that with our rate limiting that can conditionally forward events via `on_event`.

I also swapped out the `RwLock<HashMap>` for a `Dashmap` which has a simpler API to work with for these cases and maintained performance.
J
Jesse Szwedko committed
aabbdfed4da06a66db0c0fa11396c3b64822914a
Parent: 5ee7958
Committed by GitHub <noreply@github.com> on 3/3/2021, 3:48:51 PM