-
Notifications
You must be signed in to change notification settings - Fork 104
ref(metrics): Disable span metrics #4931
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
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.
As mentioned in a comment, the count_per_root
is still used, also the usage
metric might still be used in a billing consumer.
91bd476
to
e431ebc
Compare
tests/integration/test_metrics.py
Outdated
@@ -835,8 +832,6 @@ def assert_transaction(): | |||
"received_at": time_after(timestamp), | |||
} | |||
|
|||
assert metrics["c:spans/usage@none"]["value"] == 2 |
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.
@Dav1dde Should we still count the metric is the span extraction is not activated? I don't think so.
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.
Is there a case where we don't have span extraction?
In any case, if we still have transaction only flows, these metrics should be fine to not emit.
So this is now gone, because it was tied to the span metric extraction feature flag, which no longer is set. Which brings the question, is there any transaction only product surface (AM1/AM2?) which requires span metrics to work (as they won't have span extraction)?
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.
Okay so talking with Jan, I think we will always have to extract count_per_root
and usage
metrics, unconditionally, if we don't want to hide it behind another feature flag (which I don't think we should, let's just always extract them), as we don't know if they are later required for the product (dynamic sampling/outcomes) or not.
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.
We still need to gate them behind ExtractSpansFromEvent
otherwise we'd also extract this for AM1 organizations (which we don't want), but we shouldn't gate this behind any span metrics extraction flag since we'll want to extract them regardless.
tests/integration/test_spans.py
Outdated
outcomes = outcomes_consumer.get_outcomes(timeout=10, n=7) | ||
assert summarize_outcomes(outcomes) == { | ||
(16, 0): 6, # SpanIndexed, Accepted | ||
(15, 1): 2, # Metric, Filtered |
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.
@Dav1dde Can't quite say if this is right.
We likely started to emit metrics for usage and count_per_root all the time, which might itself be a bug, and they get filtered? What's the correct behavior here?
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.
Yeah then we should fix that, either not emit the metrics when they shouldn't be emitted or if they should be emitted make sure they aren't dropped/filtered.
I don't know if we need the span based metrics in circumstances where there is no span extraction, will need to find that out, but I don't think so 🤔
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 don't really get this failure. We get disabled-namespace
outcomes for project 43 but I enable span ingestion for that project, no outcome gets emitted.
I'm not sure I understand what the failure is here, can you take a look please?
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.
That makes sense, because the Spans metrics namespace is gated behind the span ingestion feature flag here.
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.
Right but, why do we have a disabled-namespace
outcome if it's disabled and not having ANY outcomes when it's enabled. Not having any outcomes when it's enabled suggests it doesn't try to emit a metric, but somehow, when it's disabled, it tries to emit 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.
Since project 43 is the root and has dynamic sampling removing things, the organizations:standalone-span-ingestion
should be enabled on both projects as they are part of the same organization. Then the test is well set up and passes (as it should).
tests/integration/test_metrics.py
Outdated
@@ -835,8 +832,6 @@ def assert_transaction(): | |||
"received_at": time_after(timestamp), | |||
} | |||
|
|||
assert metrics["c:spans/usage@none"]["value"] == 2 |
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.
Is there a case where we don't have span extraction?
In any case, if we still have transaction only flows, these metrics should be fine to not emit.
So this is now gone, because it was tied to the span metric extraction feature flag, which no longer is set. Which brings the question, is there any transaction only product surface (AM1/AM2?) which requires span metrics to work (as they won't have span extraction)?
tests/integration/test_spans.py
Outdated
outcomes = outcomes_consumer.get_outcomes(timeout=10, n=7) | ||
assert summarize_outcomes(outcomes) == { | ||
(16, 0): 6, # SpanIndexed, Accepted | ||
(15, 1): 2, # Metric, Filtered |
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.
Yeah then we should fix that, either not emit the metrics when they shouldn't be emitted or if they should be emitted make sure they aren't dropped/filtered.
I don't know if we need the span based metrics in circumstances where there is no span extraction, will need to find that out, but I don't think so 🤔
tests/integration/test_metrics.py
Outdated
@@ -835,8 +832,6 @@ def assert_transaction(): | |||
"received_at": time_after(timestamp), | |||
} | |||
|
|||
assert metrics["c:spans/usage@none"]["value"] == 2 |
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.
Okay so talking with Jan, I think we will always have to extract count_per_root
and usage
metrics, unconditionally, if we don't want to hide it behind another feature flag (which I don't think we should, let's just always extract them), as we don't know if they are later required for the product (dynamic sampling/outcomes) or not.
@sentry review |
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.
Looks good, gets rid of a bunch of old stuff, usage metric and count per root metrics aren't changed which are the important bits.
relay-dynamic-config/src/feature.rs
Outdated
/// Enables metric extraction from spans for addon modules. | ||
/// | ||
/// Serialized as `projects:span-metrics-extraction-addons`. | ||
/// This feature has graduated and is hard-coded for external Relays. |
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.
Graduated features are hardcoded at the top of the file in the GRADUATED_FEATURE_FLAGS
slice, but I don't think we can graduate it, as that would unconditionally enable it.
Should call out that this is deprecated and just kept around for external Relays, we can also maybe just graduate them if the span extraction one is enabled, then we can remove them from Sentry.
We migrated all parts of the frontend using span metrics to querying the EAP. We do not need to collect them anymore.