-
Notifications
You must be signed in to change notification settings - Fork 0
[CLEAN] Synthetic Benchmark PR #103102 - feat(tracemetrics): Parse metric from aggregations #15
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
base: base_pr_103102_20251204_6705
Are you sure you want to change the base?
[CLEAN] Synthetic Benchmark PR #103102 - feat(tracemetrics): Parse metric from aggregations #15
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
User description
Benchmark PR getsentry#103102
Type: Clean (correct implementation)
Original PR Title: feat(tracemetrics): Parse metric from aggregations
Original PR Description: This parses the metric from aggregations instead of relying on the top level metric name/type. The top level ones still take precedence for better compatibility. It has the limitation that it only allows a single metric across all the aggregations.
Original PR URL: getsentry#103102
PR Type
Enhancement
Description
Parse metric information from aggregation functions instead of relying solely on top-level metric configuration
Extract metric name, type, and unit from function arguments and store in new
ResolvedMetricAggregateclassRefactor metric filter generation into reusable utility functions for cleaner code organization
Add support for multiple aggregations with the same metric while preventing cross-metric aggregations
Diagram Walkthrough
File Walkthrough
columns.py
Add metric extraction from aggregation argumentssrc/sentry/search/eap/columns.py
castimport for type castingMetricTypefrom types moduleResolvedMetricAggregatedataclass extendingResolvedAggregatewith metric metadata fieldsTraceMetricAggregateDefinition.resolve()to extract and storemetric name, type, and unit from function arguments
ResolvedMetricAggregateinstead ofResolvedAggregatewithpopulated metric fields
resolver.py
Add column-aware query resolution with dataset conditionssrc/sentry/search/eap/resolver.py
and_trace_item_filtersutility functionresolve_query()to useand_trace_item_filters()for cleanerfilter combination logic
resolve_query_with_columns()method that accepts selectedcolumns and equations
resolve_dataset_conditions()to extract dataset-specificconditions from selected columns
config.extra_conditions()with column and equation informationfor metric-aware filtering
config.py
Implement metric parsing from aggregations with fallbacksrc/sentry/search/eap/trace_metrics/config.py
MetricTypedefinition to types moduleMetricdataclass to represent metric with name, type, andunit
extra_conditions()signature to accept selected columns andequations
_extra_conditions_from_metric()to handle top-level config metricfiltering
_extra_conditions_from_columns()to parse metrics from aggregationfunctions
get_metric_filter()as standalone function for reusabilitysingle query
types.py
Update config interface and centralize type definitionssrc/sentry/search/eap/types.py
SearchResolverConfig.extra_conditions()signature to acceptselected columns and equations parameters
MetricTypetype alias definition from trace_metrics config totypes module
rpc_utils.py
Extract filter combination utility functionsrc/sentry/search/eap/rpc_utils.py
and_trace_item_filters()functionTraceItemFilterobjectsrpc_dataset_common.py
Integrate column-aware query resolution and consolidate utilitiessrc/sentry/snuba/rpc_dataset_common.py
and_trace_item_filtersfrom rpc_utils moduleget_table_rpc_request()to callresolve_query_with_columns()with selected columns and equations
get_timeseries_query()before filterresolution for proper metric extraction
extra_conditionscalls and letresolve_query_with_columns()handle dataset conditionsand_trace_item_filters()function definitiontrace_metrics.py
Remove redundant extra conditions extractionsrc/sentry/snuba/trace_metrics.py
extra_conditionsextraction calls fromrun_table_query()and
run_timeseries_query()resolve_query_with_columns()handle metric condition injectionautomatically
test_organization_events_trace_metrics.py
Update tests for metric unit format and aggregation parsingtests/snuba/api/endpoints/test_organization_events_trace_metrics.py
-instead ofnonefor missing metric unitparameter
functions