-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore: update query builder to use 5min/30min aggregation tables #5679
Conversation
TTL also needs to be updated? |
For those customers with a different TTL than default, it will be updated. Edit: TTL has been updated. This feature is enabled by default for everyone. Will disable it for tenants who don't have enough data backfilled. |
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 to me! Reviewed everything up to ac79b1c in 1 minute and 2 seconds
More details
- Looked at
1125
lines of code in10
files - Skipped
0
files when reviewing. - Skipped posting
4
drafted comments based on config settings.
1. pkg/query-service/app/metrics/v4/cumulative/timeseries.go:114
- Draft comment:
Theop
variable is redundantly set in each case of the switch statement but is overwritten byhelpers.AggregationColumnForSamplesTable
. Remove the redundant assignments to clean up the code. - Reason this comment was not posted:
Comment was on unchanged code.
2. pkg/query-service/app/metrics/v4/delta/timeseries.go:26
- Draft comment:
Theop
variable is redundantly set in each case of the switch statement but is overwritten byhelpers.AggregationColumnForSamplesTable
. Remove the redundant assignments to clean up the code. - Reason this comment was not posted:
Marked as duplicate.
3. pkg/query-service/app/metrics/v4/delta/timeseries.go:89
- Draft comment:
Theop
variable is redundantly set in each case of the switch statement but is overwritten byhelpers.AggregationColumnForSamplesTable
. Remove the redundant assignments to clean up the code. - Reason this comment was not posted:
Marked as duplicate.
4. pkg/query-service/app/metrics/v4/query_builder_pre_agg_test.go:1
- Draft comment:
Avoid using thecomponent/index.tsx
file structure approach, as it makes it difficult to debug and find components using global search tools like VS Code. This is applicable in other files as well. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_Cv8GQvlgcyiIxF6O
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
I have one concern wrt user experience. Some edge cases are missing with this. |
@shivanshuraj1333 we maintain mix, max, and count other than average. They can choose to use |
The default time aggregation for gauge metrics is avergage, but we also allow them to change. |
Summary
Uses changes from SigNoz/signoz-otel-collector#361
Table Selection and Aggregation Strategy
We have two pre-aggregated tables:
a) 5-minute aggregation
b) 30-minute aggregation
The choice of table depends on the query's time range:
Column Selection
The pre-aggregated tables contain columns for min, max, sum, and count of values from raw samples.
This PR changes the column selection logic:
value
columnmin
,max
,sum
, orcount
) based on the aggregation needsThese changes optimize query performance by using pre-aggregated data when possible and selecting the most appropriate columns for aggregation.