-
Notifications
You must be signed in to change notification settings - Fork 93
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
feat(server): Denylist for metrics #2954
Conversation
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.
Just a quick check of things, I need in my PR as well
relay-dynamic-config/src/metrics.rs
Outdated
|
||
impl Metrics { | ||
/// Filters metrics based on the metric name. | ||
pub fn filter_metrics(&self, metrics: &mut Vec<Bucket>) { |
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.
Let's move this function into a logic module to keep the config types plain. For now, processor.rs
would be the ideal place for this, until all metrics related processing functionality moves into a dedicated module.
This means you can also remove the dependency on relay_metrics
from this crate.
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 just moved this logic into the apply_filter_metrics function in project.rs, how do you think about that?
relay-dynamic-config/src/metrics.rs
Outdated
#[derive(Debug, Default, Clone, Serialize, Deserialize)] | ||
#[serde(transparent)] | ||
pub struct Metrics { | ||
/// Patterns of names of metrics that we want to filter. |
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.
/// Patterns of names of metrics that we want to filter. | |
/// The list of patterns which used to filter names of the received metrics. |
Maybe something like this will sound better?
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.
hmm, isnt it a bit misleading, like we want to say we filter metrics based on their name, not that we filter their names?
how about /// List of patterns for blocking metrics based on their name.
?
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.
Approved once #[serde(transparent)]
is removed
Co-authored-by: Jan Michael Auer <mail@jauer.org>
relay-dynamic-config/src/metrics.rs
Outdated
} | ||
|
||
impl Metrics { | ||
/// Returns `true` if it contains any names patterns to filter metric names. |
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.
This comment is outdated, is_empty does more now
relay-dynamic-config/src/project.rs
Outdated
@@ -88,6 +89,9 @@ pub struct ProjectConfig { | |||
/// relays that might still need them. | |||
#[serde(skip_serializing_if = "Option::is_none")] | |||
pub span_description_rules: Option<Vec<SpanDescriptionRule>>, | |||
/// Configuration for filtering metrics. |
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.
/// Configuration for filtering metrics. | |
/// Configuration for metrics. |
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.
This seems like a footgun that the there is no explicit filter for namespaces at least, but this was already discussed and marked as a future improvement.
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.
Does this get rid of Request Changes
now?
New addition to projectconfig that allow users to filter out certain metrics based on their name using glob patterns.
#2796