fix(eap): Apply FINAL on GetTrace queries #7413
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some calls to GetTrace returns duplicate data because the trace was ingested twice. Adding
FINAL
for those queries will force ClickHouse to deduplicate the data and make the query longer.P90 of the query is well under 1s most of the time, applying
FINAL
will 2-3x this duration. I think this is a worthwhile trade-off for this particular endpoint since it's meant to return a single trace, the platform shouldn't return duplicated data.https://sentry.sentry.io/explore/traces/?aggregateField=%7B%22groupBy%22%3A%22%22%7D&aggregateField=%7B%22yAxes%22%3A%5B%22p90%28span.duration%29%22%5D%7D&interval=1h&project=300688&query=span.description%3A%22%2Aeap_items%2Aequals%28trace_id%2A%22%20transaction%3AEndpointGetTrace__v1%20span.duration%3A%3C30s&statsPeriod=14d