-
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
feat(metrics): Prefix all metric names [INGEST-548] #1147
Conversation
"sentry.transactions.measurements.lcp", | ||
"sentry.transactions.breakdowns.breakdown1.bar", | ||
"sentry.transactions.breakdowns.breakdown2.baz", | ||
"sentry.transactions.breakdowns.breakdown2.zap" |
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 briefly considered omitting the prefixes in the project config, since we're already in a config object called transactionMetrics
. But I figured that listing the full metric name would simplify searching for it, as with snuba referrers.
@@ -115,7 +128,7 @@ pub fn extract_transaction_metrics( | |||
}; | |||
|
|||
push_metric(Metric { | |||
name: format!("breakdown.{}.{}", breakdown, name), | |||
name: metric_name(&["breakdowns", breakdown, 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.
Note that this renames metrics from breakdown.foo
to breakdowns.foo
, to be consistent with measurements
.
fn metric_name(parts: &[&str]) -> String { | ||
let mut name = METRIC_NAME_PREFIX.to_owned(); | ||
for part in parts { | ||
name = format!("{}.{}", name, part); |
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.
name = format!("{}.{}", name, part); | |
write!(".{}", part); |
this may need some bogus error-handling because it goes through io::Write, but it prevents string allocations
As in getsentry/relay#1147, prefix all metric names with either "sentry.sessions" or "sentry.transactions".
Add product-specific prefixes to all metric names.
See also https://www.notion.so/sentry/Metrics-Namespaces-3679dfa27ed14b98975b154eb580644c.
This requires #1146 to be merged first.