11
submitted 2 years ago by [email protected] to c/[email protected]

I've been reading a bit the tracing crate documentation, trying to find out if there's a way to rate limit logs.

What I refer with rate limiting, is that once a particular log has shown up with some frequency (x amount of times in a given time) then it won't be captured or shown anymore, until certain amount of time... This to avoid getting the logs space/buffer being eaten by just one, or a few high frequency errors for example.

Thanks !

you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 1 points 2 years ago

One thing to keep in mind is that tracing works on spans/events, so rather than the subscriber receiving a string log message, it's receiving some metadata and a collection of field/value pairs, where values can be a lot of different types. You may need to determine ahead of time which fields you want deduped (or which you don't want deduped).

[-] [email protected] 1 points 2 years ago

yeap, thanks !

this post was submitted on 08 Sep 2023
11 points (100.0% liked)

Rust Programming

8858 readers
1 users here now

founded 6 years ago
MODERATORS