Repository navigation
fix(sampling): Forward compatibility for config - #1641
Conversation
| SamplingMode::Unsupported => { | ||
| if processing_enabled { | ||
| relay_log::error!("Found unsupported sampling mode even as processing Relay, keep"); | ||
| } | ||
| return Err(SamplingResult::Keep); |
There was a problem hiding this comment.
I'm not sure if I like this, but I don't have better suggestions.
There was a problem hiding this comment.
We could alternatively log an error for during project state deserialization (since that's where the error really happens) and fail silently here instead.
This behavior is fine since it's the same as if sampling were not implemented. That matches behavior in other cases, where Relay ignores all configuration it doesn't know about.
There was a problem hiding this comment.
We could alternatively log an error for during project state deserialization (since that's where the error really happens)
I'd rather log the error during deserialization.
There was a problem hiding this comment.
I tried to be consistent with check_unsupported_rules here, but maybe it's a bad pattern anyway.
relay/relay-server/src/utils/dynamic_sampling.rs
Lines 33 to 47 in ca27595
There was a problem hiding this comment.
As discussed offline, going to merge as-is.
| impl SamplingRule { | ||
| fn supported(&self) -> bool { | ||
| self.condition.supported() | ||
| self.condition.supported() && self.ty != RuleType::Unsupported |
There was a problem hiding this comment.
nit: Introduce a supported method on rules types, too?
| SamplingMode::Unsupported => { | ||
| if processing_enabled { | ||
| relay_log::error!("Found unsupported sampling mode even as processing Relay, keep"); | ||
| } | ||
| return Err(SamplingResult::Keep); |
There was a problem hiding this comment.
We could alternatively log an error for during project state deserialization (since that's where the error really happens) and fail silently here instead.
This behavior is fine since it's the same as if sampling were not implemented. That matches behavior in other cases, where Relay ignores all configuration it doesn't know about.
Add missing variants to enums in sampling config for forward compatibility.
#skip-changelog