-
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): Track a spans/count_per_root_project metric #4134
Conversation
* master: ref(server): Move project source into the source module (#4154) instr(buffer): Measure envelope size (#4153) ref(redis): Cleanup code around Redis (#4151) lint: Rust 1.82 (#4150) chore(server): Remove native placeholders from transaction processing (#4148) feat(eap): Extract user IP (#4144) Revert "ref(buffer): remove peek" (#4146) ref(buffer): remove peek (#4136) release: 24.10.0 build(deps): bump tonic from 0.12.2 to 0.12.3 (#4143) instr(projects): Log fetch failure (#4142) ref(otel): Disable default features for otel schema (#4141) ref(server): Organize project services in nested modules (#4139) ref(redis): Update to redis client version 0.27.4 (#4132) feat(redis): Implement parallel cmd execution of Redis calls (#4118) feat(spooler): Add metric to track serialization performance (#4135)
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.
LGTM, left one minor nit
spans_extracted: bool, | ||
config: CombinedMetricExtractionConfig<'_>, | ||
sampling_decision: SamplingDecision, | ||
max_tag_value_size: usize, | ||
span_extraction_sample_rate: Option<f32>, | ||
) -> Vec<Bucket> { | ||
let mut metrics = generic::extract_metrics(event, config); | ||
// If spans were already extracted for an event, we rely on span processing to extract metrics. | ||
if !spans_extracted && sample(span_extraction_sample_rate.unwrap_or(1.0)) { | ||
extract_span_metrics_for_event(event, config, max_tag_value_size, &mut metrics); | ||
extract_spans: bool, |
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, extract_spans
replaces the combination of spans_extracted
and span_extraction_sample_rate
, and sampling_decision
is only used for tagging purposes further in, correct?
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.
Correct, the caller determines whether spans should be extracted, which comprises three conditions: The sample rate, whether spans were extracted before, and whether span extraction is enabled at all. That last condition is new and required because we want to skip the root counter metric.
sampling_decision
is there purely for tagging the root counter metric, right.
relay_log::trace!( | ||
span_count, | ||
?sampling_result, | ||
"Dropped spans because of sampling rule", |
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 assume this log was moved here so there is only one log entry instead of one per span?
Adds a new metric
c:spans/count_per_root_project@none
that tracks thenumber of spans per root project with a
transaction
anddecision
tag. This will be used by span-based dynamic sampling for rebalancing.
The new metric is tracked in the two places where span metrics are
emitted, under the condition that span metric extraction features are
enabled:
Requires getsentry/sentry#78992
Closes https://github.com/getsentry/projects/issues/198