-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: add ExponentialHistogram support for metrics v4 query range #4525
Conversation
WalkthroughThis update introduces enhancements and optimizations across the query service, particularly focusing on time series data handling. It adds support for multiple quantiles, dynamic table selection, and special handling for different metric types including percentile aggregations. Additionally, it streamlines the code by consolidating similar functions, improving code maintainability. The introduction of new Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files ignored due to path filters (2)
deploy/docker-swarm/clickhouse-setup/otel-collector-config.yaml
is excluded by:!**/*.yaml
deploy/docker/clickhouse-setup/otel-collector-config.yaml
is excluded by:!**/*.yaml
Files selected for processing (4)
- pkg/query-service/app/metrics/v4/delta/time_series_test.go (1 hunks)
- pkg/query-service/app/metrics/v4/delta/timeseries.go (5 hunks)
- pkg/query-service/app/metrics/v4/helpers/clauses.go (2 hunks)
- pkg/query-service/model/v3/v3.go (1 hunks)
Additional comments: 6
pkg/query-service/app/metrics/v4/helpers/clauses.go (1)
- 37-42: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-49]
The consolidation of
GroupByAttributeKeyTagsWithoutLe
andOrderByAttributeKeyTagsWithoutLe
intoGroupByAttributeKeyTags
andOrderByAttributeKeyTags
is not directly visible in the provided code. Ensure that the consolidated functions correctly handle all cases previously covered by the removed functions, including any special handling for thele
attribute if applicable.pkg/query-service/app/metrics/v4/delta/timeseries.go (4)
- 12-15: The
sketchFmt
variable is updated to support multiple quantiles. Verify that the format string is correctly used in all relevant places and that it properly handles multiple quantile values.- 92-95: The dynamic selection of the table name based on
mq.AggregateAttribute.Type
introduces a special case forexphist
type metrics. Ensure that this logic is correctly applied in all relevant query preparation functions and that the table namedistributed_exp_hist
is correctly configured in the database schema.- 122-128: The handling for percentile aggregations using the
sketchFmt
variable is introduced. Ensure that the percentile values are correctly calculated and applied in the query, and that thesketchFmt
variable is used correctly with the appropriate quantile values.- 214-216: The special case for
exphist
type metrics incanShortCircuit
function is added. Verify that this logic correctly identifies scenarios where the optimized query can be used forexphist
metrics and that it does not inadvertently affect other metric types or aggregation scenarios.pkg/query-service/model/v3/v3.go (1)
- 492-501: The addition of new
MetricType
constants expands the model to include various types of metrics, includingExponentialHistogram
. Ensure that these new types are correctly used throughout the codebase and that their inclusion does not introduce inconsistencies or errors in metric processing or representation.
Reviews please. |
Summary
Part of #4016
Although this was not originally planned for, we have all the pieces in place to support it. This doesn't require any additional work from the frontend.
Related and depends on SigNoz/signoz-otel-collector#288
Summary by CodeRabbit