-
Notifications
You must be signed in to change notification settings - Fork 98
feat(inbound filters): Enable filtering sessions #4745
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
base: master
Are you sure you want to change the base?
Conversation
&self.inner.global_config.current(), | ||
&config, |
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.
Here, we are getting passed the config
from outside, but reading the global_config
from self.inner
. I did it this way because that's how it is in other processors (e.g. replays), but I don't know whether there's a good reason for it or it's a historical accident.
fn get_value(&self, path: &str) -> Option<relay_protocol::Val<'_>> { | ||
let path = path.strip_prefix("session.")?; | ||
|
||
match path { | ||
"session_id" => Some(self.session_id.into()), | ||
"distinct_id" => Some(self.distinct_id.as_deref()?.into()), | ||
"sequence" => Some(self.sequence.into()), | ||
"init" => Some(self.init.into()), | ||
"duration" => Some(self.duration?.into()), | ||
"errors" => Some(self.errors.into()), | ||
"release" => Some(self.attributes.release.as_str().into()), | ||
"environment" => Some(self.attributes.environment.as_deref()?.into()), | ||
"ip_address" => Some(self.attributes.ip_address.as_ref()?.as_str().into()), | ||
"user_agent" => Some(self.attributes.user_agent.as_deref()?.into()), | ||
// TODO: status, abnormal mechanism? | ||
_ => None, | ||
} | ||
} |
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.
Maybe it would make sense to only expose the same fields in SessionUpdate
and SessionAggregates
so that generic filters would work in a similar fashion for both things
This enables filtering for
SessionUpdate
andSessionAggregate
items. In the course of this, it alsoFilterable
andGetter
implementations toSessionUpdate
andSessionAggregates
;SessionProcessingConfig
struct to bundle all the auxiliary data needed inprocess_session
andprocess_session_aggregates
(modeled onReplayProcessingConfig
);Aside from this not having tests, my main open questions are around the
Getter
impls. To wit:"session_update"
/"session_aggregates"
)?Getter
impls change anything about the way filtering works? I believeFilterable
already returns the fields we actually care about.Closes RELAY-41.