Skip to content
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

Update traceql metrics to use the trace-level timestamp columns #3353

Merged
merged 5 commits into from
Feb 14, 2024

Conversation

mdisibio
Copy link
Contributor

@mdisibio mdisibio commented Jan 31, 2024

What this PR does:
This PR circles back to a metrics TODO and uses the trace-level timestamp columns to more quickly filter the relevant traces in a block. The columns are not free and hinder performance unless they are able to filter out enough values. So it is decided at runtime based on the request and the block in question.

For now, did some local benchmarking, and using the simple heuristic that if we are looking at less than 20% of the block, then it's worth pulling in the columns. Between 20 and 100%, we avoid the extra I/O but spend more cycles throwing away traces (this is the current behavior). Open to suggestions on a better heuristic.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Copy link
Member

@mapno mapno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool optimisation. LGTM

@mdisibio mdisibio merged commit 9809c98 into grafana:main Feb 14, 2024
14 checks passed
kvrhdn pushed a commit to kvrhdn/tempo that referenced this pull request Feb 26, 2024
…ana#3353)

* Update traceql metrics to use the trace-level timestamp columns conditionally

* comments

* Update benchmark, comment

* lint

* Change overlap cutoff to 20%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants