Skip to content

Commit 459a17f

Browse files
committed
feat(spans): Remove references to old -if syntax
- This removes the old if syntax from the prebuilt dashboards
1 parent b57d9a5 commit 459a17f

14 files changed

Lines changed: 72 additions & 72 deletions

File tree

static/app/views/dashboards/utils/prebuiltConfigs/ai/aiAgentsModels.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const MODELS_TABLE: PrebuiltWidget = {
116116
fields: [
117117
SpanFields.GEN_AI_RESPONSE_MODEL,
118118
'count()',
119-
'equation|count_if(span.status,equals,internal_error) + count_if(span.status,equals,error)',
119+
'equation|count_if(`span.status:internal_error`) + count_if(`span.status:error`)',
120120
`avg(${SpanFields.SPAN_DURATION})`,
121121
`p95(${SpanFields.SPAN_DURATION})`,
122122
`sum(${SpanFields.GEN_AI_COST_TOTAL_TOKENS})`,
@@ -127,7 +127,7 @@ const MODELS_TABLE: PrebuiltWidget = {
127127
],
128128
aggregates: [
129129
'count()',
130-
'equation|count_if(span.status,equals,internal_error) + count_if(span.status,equals,error)',
130+
'equation|count_if(`span.status:internal_error`) + count_if(`span.status:error`)',
131131
`avg(${SpanFields.SPAN_DURATION})`,
132132
`p95(${SpanFields.SPAN_DURATION})`,
133133
`sum(${SpanFields.GEN_AI_COST_TOTAL_TOKENS})`,

static/app/views/dashboards/utils/prebuiltConfigs/ai/aiAgentsTools.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ const TOOLS_TABLE: PrebuiltWidget = {
7575
fields: [
7676
SpanFields.GEN_AI_TOOL_NAME,
7777
'count()',
78-
'equation|count_if(span.status,equals,internal_error) + count_if(span.status,equals,error)',
78+
'equation|count_if(`span.status:internal_error`) + count_if(`span.status:error`)',
7979
`avg(${SpanFields.SPAN_DURATION})`,
8080
`p95(${SpanFields.SPAN_DURATION})`,
8181
],
8282
aggregates: [
8383
'count()',
84-
'equation|count_if(span.status,equals,internal_error) + count_if(span.status,equals,error)',
84+
'equation|count_if(`span.status:internal_error`) + count_if(`span.status:error`)',
8585
`avg(${SpanFields.SPAN_DURATION})`,
8686
`p95(${SpanFields.SPAN_DURATION})`,
8787
],

static/app/views/dashboards/utils/prebuiltConfigs/ai/mcpOverview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ const OVERVIEW_TABLE: PrebuiltWidget = {
184184
SpanFields.SPAN_DESCRIPTION,
185185
'count()',
186186
`${SpanFunction.FAILURE_RATE}()`,
187-
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error) + count_if(${SpanFields.SPAN_STATUS},equals,error)`,
187+
`equation|count_if(\`${SpanFields.SPAN_STATUS}:internal_error\`) + count_if(\`${SpanFields.SPAN_STATUS}:error\`)`,
188188
`avg(${SpanFields.SPAN_DURATION})`,
189189
`p95(${SpanFields.SPAN_DURATION})`,
190190
],
191191
aggregates: [
192192
'count()',
193193
`${SpanFunction.FAILURE_RATE}()`,
194-
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error) + count_if(${SpanFields.SPAN_STATUS},equals,error)`,
194+
`equation|count_if(\`${SpanFields.SPAN_STATUS}:internal_error\`) + count_if(\`${SpanFields.SPAN_STATUS}:error\`)`,
195195
`avg(${SpanFields.SPAN_DURATION})`,
196196
`p95(${SpanFields.SPAN_DURATION})`,
197197
],

static/app/views/dashboards/utils/prebuiltConfigs/ai/mcpPrompts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ const PROMPTS_TABLE: PrebuiltWidget = {
9696
SpanFields.MCP_PROMPT_NAME,
9797
'count()',
9898
`${SpanFunction.FAILURE_RATE}()`,
99-
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error) + count_if(${SpanFields.SPAN_STATUS},equals,error)`,
99+
`equation|count_if(\`${SpanFields.SPAN_STATUS}:internal_error\`) + count_if(\`${SpanFields.SPAN_STATUS}:error\`)`,
100100
`avg(${SpanFields.SPAN_DURATION})`,
101101
`p95(${SpanFields.SPAN_DURATION})`,
102102
],
103103
aggregates: [
104104
'count()',
105105
`${SpanFunction.FAILURE_RATE}()`,
106-
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error) + count_if(${SpanFields.SPAN_STATUS},equals,error)`,
106+
`equation|count_if(\`${SpanFields.SPAN_STATUS}:internal_error\`) + count_if(\`${SpanFields.SPAN_STATUS}:error\`)`,
107107
`avg(${SpanFields.SPAN_DURATION})`,
108108
`p95(${SpanFields.SPAN_DURATION})`,
109109
],

static/app/views/dashboards/utils/prebuiltConfigs/ai/mcpResources.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ const RESOURCES_TABLE: PrebuiltWidget = {
9696
SpanFields.MCP_RESOURCE_URI,
9797
'count()',
9898
`${SpanFunction.FAILURE_RATE}()`,
99-
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error) + count_if(${SpanFields.SPAN_STATUS},equals,error)`,
99+
`equation|count_if(\`${SpanFields.SPAN_STATUS}:internal_error\`) + count_if(\`${SpanFields.SPAN_STATUS}:error\`)`,
100100
`avg(${SpanFields.SPAN_DURATION})`,
101101
`p95(${SpanFields.SPAN_DURATION})`,
102102
],
103103
aggregates: [
104104
'count()',
105105
`${SpanFunction.FAILURE_RATE}()`,
106-
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error) + count_if(${SpanFields.SPAN_STATUS},equals,error)`,
106+
`equation|count_if(\`${SpanFields.SPAN_STATUS}:internal_error\`) + count_if(\`${SpanFields.SPAN_STATUS}:error\`)`,
107107
`avg(${SpanFields.SPAN_DURATION})`,
108108
`p95(${SpanFields.SPAN_DURATION})`,
109109
],

static/app/views/dashboards/utils/prebuiltConfigs/ai/mcpTools.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ const TOOLS_TABLE: PrebuiltWidget = {
9696
SpanFields.MCP_TOOL_NAME,
9797
'count()',
9898
`${SpanFunction.FAILURE_RATE}()`,
99-
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error) + count_if(${SpanFields.SPAN_STATUS},equals,error)`,
99+
`equation|count_if(\`${SpanFields.SPAN_STATUS}:internal_error\`) + count_if(\`${SpanFields.SPAN_STATUS}:error\`)`,
100100
`avg(${SpanFields.SPAN_DURATION})`,
101101
`p95(${SpanFields.SPAN_DURATION})`,
102102
],
103103
aggregates: [
104104
'count()',
105105
`${SpanFunction.FAILURE_RATE}()`,
106-
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error) + count_if(${SpanFields.SPAN_STATUS},equals,error)`,
106+
`equation|count_if(\`${SpanFields.SPAN_STATUS}:internal_error\`) + count_if(\`${SpanFields.SPAN_STATUS}:error\`)`,
107107
`avg(${SpanFields.SPAN_DURATION})`,
108108
`p95(${SpanFields.SPAN_DURATION})`,
109109
],

static/app/views/dashboards/utils/prebuiltConfigs/backendOverview/backendOverview.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ export const BACKEND_OVERVIEW_FIRST_ROW_WIDGETS = spaceWidgetsEquallyOnRow(
5757
name: 'Requests',
5858
fields: [
5959
`count(${SpanFields.SPAN_DURATION})`,
60-
`equation|(count_if(${SpanFields.TRACE_STATUS},equals,internal_error) + count_if(${SpanFields.TRACE_STATUS},equals,error)) / count(${SpanFields.SPAN_DURATION})`,
60+
`equation|(count_if(\`${SpanFields.TRACE_STATUS}:internal_error\`) + count_if(\`${SpanFields.TRACE_STATUS}:error\`)) / count(${SpanFields.SPAN_DURATION})`,
6161
],
6262
aggregates: [
6363
`count(${SpanFields.SPAN_DURATION})`,
64-
`equation|(count_if(${SpanFields.TRACE_STATUS},equals,internal_error) + count_if(${SpanFields.TRACE_STATUS},equals,error)) / count(${SpanFields.SPAN_DURATION})`,
64+
`equation|(count_if(\`${SpanFields.TRACE_STATUS}:internal_error\`) + count_if(\`${SpanFields.TRACE_STATUS}:error\`)) / count(${SpanFields.SPAN_DURATION})`,
6565
],
6666
columns: [],
6767
fieldAliases: [],
@@ -133,11 +133,11 @@ export const BACKEND_OVERVIEW_SECOND_ROW_WIDGETS = spaceWidgetsEquallyOnRow(
133133
name: '',
134134
fields: [
135135
`count(${SpanFields.SPAN_DURATION})`,
136-
`equation|(count_if(${SpanFields.TRACE_STATUS},equals,internal_error) + count_if(${SpanFields.TRACE_STATUS},equals,error)) / count(${SpanFields.SPAN_DURATION})`,
136+
`equation|(count_if(\`${SpanFields.TRACE_STATUS}:internal_error\`) + count_if(\`${SpanFields.TRACE_STATUS}:error\`)) / count(${SpanFields.SPAN_DURATION})`,
137137
],
138138
aggregates: [
139139
`count(${SpanFields.SPAN_DURATION})`,
140-
`equation|(count_if(${SpanFields.TRACE_STATUS},equals,internal_error) + count_if(${SpanFields.TRACE_STATUS},equals,error)) / count(${SpanFields.SPAN_DURATION})`,
140+
`equation|(count_if(\`${SpanFields.TRACE_STATUS}:internal_error\`) + count_if(\`${SpanFields.TRACE_STATUS}:error\`)) / count(${SpanFields.SPAN_DURATION})`,
141141
],
142142
columns: [],
143143
fieldAliases: [],
@@ -188,15 +188,15 @@ export const BACKEND_OVERVIEW_SECOND_ROW_WIDGETS = spaceWidgetsEquallyOnRow(
188188
{
189189
name: '',
190190
fields: [
191-
`equation|count_if(${SpanFields.CACHE_HIT},equals,false) / count(${SpanFields.SPAN_DURATION})`,
191+
`equation|count_if(\`${SpanFields.CACHE_HIT}:false\`) / count(${SpanFields.SPAN_DURATION})`,
192192
],
193193
aggregates: [
194-
`equation|count_if(${SpanFields.CACHE_HIT},equals,false) / count(${SpanFields.SPAN_DURATION})`,
194+
`equation|count_if(\`${SpanFields.CACHE_HIT}:false\`) / count(${SpanFields.SPAN_DURATION})`,
195195
],
196196
columns: [SpanFields.TRANSACTION],
197197
fieldAliases: [''],
198198
conditions: `${SpanFields.SPAN_OP}:[cache.get,cache.get_item]`,
199-
orderby: `-equation|count_if(${SpanFields.CACHE_HIT},equals,false) / count(${SpanFields.SPAN_DURATION})`,
199+
orderby: `-equation|count_if(\`${SpanFields.CACHE_HIT}:false\`) / count(${SpanFields.SPAN_DURATION})`,
200200
},
201201
],
202202
limit: 3,

static/app/views/dashboards/utils/prebuiltConfigs/caches/caches.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ const FIRST_ROW_WIDGETS = spaceWidgetsEquallyOnRow(
2929
{
3030
name: '',
3131
aggregates: [
32-
`equation|count_if(${SpanFields.CACHE_HIT},equals,false) / count(${SpanFields.SPAN_DURATION})`,
32+
`equation|count_if(\`${SpanFields.CACHE_HIT}:false\`) / count(${SpanFields.SPAN_DURATION})`,
3333
],
3434
columns: [],
3535
fields: [
36-
`equation|count_if(${SpanFields.CACHE_HIT},equals,false) / count(${SpanFields.SPAN_DURATION})`,
36+
`equation|count_if(\`${SpanFields.CACHE_HIT}:false\`) / count(${SpanFields.SPAN_DURATION})`,
3737
],
3838
conditions: BASE_CONDITION,
39-
orderby: `equation|count_if(${SpanFields.CACHE_HIT},equals,false) / count(${SpanFields.SPAN_DURATION})`,
39+
orderby: `equation|count_if(\`${SpanFields.CACHE_HIT}:false\`) / count(${SpanFields.SPAN_DURATION})`,
4040
},
4141
],
4242
},
@@ -75,13 +75,13 @@ const TRANSACTION_TABLE: PrebuiltWidget = {
7575
SpanFields.PROJECT,
7676
`avg(${SpanFields.CACHE_ITEM_SIZE})`,
7777
'epm()',
78-
`equation|count_if(${SpanFields.CACHE_HIT},equals,false) / count(${SpanFields.SPAN_DURATION})`,
78+
`equation|count_if(\`${SpanFields.CACHE_HIT}:false\`) / count(${SpanFields.SPAN_DURATION})`,
7979
`sum(${SpanFields.SPAN_DURATION})`,
8080
],
8181
aggregates: [
8282
`avg(${SpanFields.CACHE_ITEM_SIZE})`,
8383
'epm()',
84-
`equation|count_if(${SpanFields.CACHE_HIT},equals,false) / count(${SpanFields.SPAN_DURATION})`,
84+
`equation|count_if(\`${SpanFields.CACHE_HIT}:false\`) / count(${SpanFields.SPAN_DURATION})`,
8585
`sum(${SpanFields.SPAN_DURATION})`,
8686
],
8787
columns: [SpanFields.TRANSACTION, SpanFields.PROJECT],

static/app/views/dashboards/utils/prebuiltConfigs/frontendOverview/frontendOverview.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ const TABLE_FIELDS = [
183183
SpanFields.TRANSACTION,
184184
SpanFields.PROJECT,
185185
'equation|tpm()',
186-
`equation|p50_if(${SpanFields.SPAN_DURATION},${SpanFields.IS_TRANSACTION},equals,true)`,
187-
`equation|p75_if(${SpanFields.SPAN_DURATION},${SpanFields.IS_TRANSACTION},equals,true)`,
188-
`equation|p95_if(${SpanFields.SPAN_DURATION},${SpanFields.IS_TRANSACTION},equals,true)`,
189-
`equation|failure_rate_if(${SpanFields.IS_TRANSACTION},equals,true)`,
186+
`equation|p50_if(\`${SpanFields.IS_TRANSACTION}:true\`,${SpanFields.SPAN_DURATION})`,
187+
`equation|p75_if(\`${SpanFields.IS_TRANSACTION}:true\`,${SpanFields.SPAN_DURATION})`,
188+
`equation|p95_if(\`${SpanFields.IS_TRANSACTION}:true\`,${SpanFields.SPAN_DURATION})`,
189+
`equation|failure_rate_if(\`${SpanFields.IS_TRANSACTION}:true\`)`,
190190
`count_unique(${SpanFields.USER})`,
191-
`equation|sum_if(${SpanFields.SPAN_DURATION},${SpanFields.IS_TRANSACTION},equals,true)`,
191+
`equation|sum_if(\`${SpanFields.IS_TRANSACTION}:true\`,${SpanFields.SPAN_DURATION})`,
192192
'performance_score(measurements.score.total)',
193193
];
194194

@@ -205,12 +205,12 @@ const TRANSACTIONS_TABLE: PrebuiltWidget = {
205205
conditions: TABLE_QUERY.formatString(),
206206
aggregates: [
207207
'equation|tpm()',
208-
`equation|p50_if(${SpanFields.SPAN_DURATION},${SpanFields.IS_TRANSACTION},equals,true)`,
209-
`equation|p75_if(${SpanFields.SPAN_DURATION},${SpanFields.IS_TRANSACTION},equals,true)`,
210-
`equation|p95_if(${SpanFields.SPAN_DURATION},${SpanFields.IS_TRANSACTION},equals,true)`,
211-
`equation|failure_rate_if(${SpanFields.IS_TRANSACTION},equals,true)`,
208+
`equation|p50_if(\`${SpanFields.IS_TRANSACTION}:true\`,${SpanFields.SPAN_DURATION})`,
209+
`equation|p75_if(\`${SpanFields.IS_TRANSACTION}:true\`,${SpanFields.SPAN_DURATION})`,
210+
`equation|p95_if(\`${SpanFields.IS_TRANSACTION}:true\`,${SpanFields.SPAN_DURATION})`,
211+
`equation|failure_rate_if(\`${SpanFields.IS_TRANSACTION}:true\`)`,
212212
`count_unique(${SpanFields.USER})`,
213-
`equation|sum_if(${SpanFields.SPAN_DURATION},${SpanFields.IS_TRANSACTION},equals,true)`,
213+
`equation|sum_if(\`${SpanFields.IS_TRANSACTION}:true\`,${SpanFields.SPAN_DURATION})`,
214214
'performance_score(measurements.score.total)',
215215
],
216216
fields: TABLE_FIELDS,
@@ -232,7 +232,7 @@ const TRANSACTIONS_TABLE: PrebuiltWidget = {
232232
SpanFields.TRANSACTION,
233233
SpanFields.PROJECT,
234234
],
235-
orderby: `-equation|sum_if(${SpanFields.SPAN_DURATION},${SpanFields.IS_TRANSACTION},equals,true)`,
235+
orderby: `-equation|sum_if(\`${SpanFields.IS_TRANSACTION}:true\`,${SpanFields.SPAN_DURATION})`,
236236
},
237237
],
238238
layout: {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {SpanFields} from 'sentry/views/insights/types';
22

3-
export const PERCENTAGE_3XX = `equation|count_if(${SpanFields.SPAN_STATUS_CODE},between,300,399) / count(${SpanFields.SPAN_DURATION})`;
4-
export const PERCENTAGE_4XX = `equation|count_if(${SpanFields.SPAN_STATUS_CODE},between,400,499) / count(${SpanFields.SPAN_DURATION})`;
5-
export const PERCENTAGE_5XX = `equation|count_if(${SpanFields.SPAN_STATUS_CODE},between,500,599) / count(${SpanFields.SPAN_DURATION})`;
3+
export const PERCENTAGE_3XX = `equation|count_if(\`${SpanFields.SPAN_STATUS_CODE}:>=300 AND ${SpanFields.SPAN_STATUS_CODE}:<=399\`) / count(${SpanFields.SPAN_DURATION})`;
4+
export const PERCENTAGE_4XX = `equation|count_if(\`${SpanFields.SPAN_STATUS_CODE}:>=400 AND ${SpanFields.SPAN_STATUS_CODE}:<=499\`) / count(${SpanFields.SPAN_DURATION})`;
5+
export const PERCENTAGE_5XX = `equation|count_if(\`${SpanFields.SPAN_STATUS_CODE}:>=500 AND ${SpanFields.SPAN_STATUS_CODE}:<=599\`) / count(${SpanFields.SPAN_DURATION})`;

0 commit comments

Comments
 (0)