-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref(cardinality): Passive mode per cardinality limit #3199
Conversation
768b4f3
to
81f7fb0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth a changelog entry, since it adds a new field to project configs.
&Item::new(4, MetricNamespace::Custom), | ||
]) | ||
); | ||
drop(rejected); // NLL are broken here without the explicit drop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's NLL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non lexical lifetimes.
The compiler should be smart enough to see that rejected is no longer used, but without the drop I cannot call into_accepted
because there is still the reference to rejected
.
pub fn enforced_limits(&self) -> &HashSet<&'a str> { | ||
/// | ||
/// This includes passive limits. | ||
pub fn limits(&self) -> &HashSet<&'a CardinalityLimit> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub fn limits(&self) -> &HashSet<&'a CardinalityLimit> { | |
pub fn exceeded_limits(&self) -> &HashSet<&'a CardinalityLimit> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do that in a follow-up, I need. a librelay release to continue and I don't feel like waiting another 30 minutes...
) Followup of #3199 Renames the `limits` fn to a better name, adds changelog and librelay changelog entry (project config is affected).
Makes it possible to mark individual cardinality limits per project to be marked as passive.
Initially the idea was not to add the
passive
flag to the individual limit and only enforce the passive property/mode in the processor. But it turns out this is more complicated than just directly discarding a passive result in the cardinality limiter. This was made easy due to already having the correct abstraction (Rejections
trait) in place, it just needed to be slightly updated to be passed the limit instead of just the limit id. This approach also allows us to tag all metrics and cardinality errors with a passive tag.#skip-changelog