Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions static/app/views/dashboards/datasetConfig/spans.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {EventData} from 'sentry/utils/discover/eventView';
import type {RenderFunctionBaggage} from 'sentry/utils/discover/fieldRenderers';
import {emptyStringValue, getFieldRenderer} from 'sentry/utils/discover/fieldRenderers';
import {
stripEquationPrefix,
type Aggregation,
type AggregationOutputType,
type DataUnit,
Expand Down Expand Up @@ -314,7 +315,11 @@ export const SpansConfig: DatasetConfig<
) {
return renderTransactionAsLinkable;
}
if (field === INTERNAL_ERROR_COUNT_FIELD) {
const strippedField = stripEquationPrefix(field);
if (
field === INTERNAL_ERROR_COUNT_FIELD ||
strippedField === INTERNAL_ERROR_COUNT_FIELD
) {
return renderInternalErrorCount(widget, dashboardFilters);
}
return getFieldRenderer(field, meta, false, widget, dashboardFilters);
Expand Down Expand Up @@ -497,7 +502,8 @@ function renderInternalErrorCount(widget?: Widget, dashboardFilters?: DashboardF
return function (data: EventData, baggage: RenderFunctionBaggage) {
const {organization, eventView} = baggage;
const selection = eventView?.getPageFilters();
const value = data[INTERNAL_ERROR_COUNT_FIELD];
const value =
data[INTERNAL_ERROR_COUNT_FIELD] ?? data[`equation|${INTERNAL_ERROR_COUNT_FIELD}`];
const count = typeof value === 'number' ? value : 0;

if (count === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const MODELS_TABLE = {
fields: [
SpanFields.GEN_AI_REQUEST_MODEL,
'count()',
'count_if(span.status,equals,internal_error)',
'equation|count_if(span.status,equals,internal_error)',
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
`sum(${SpanFields.GEN_AI_COST_TOTAL_TOKENS})`,
Expand All @@ -120,7 +120,7 @@ const MODELS_TABLE = {
],
aggregates: [
'count()',
'count_if(span.status,equals,internal_error)',
'equation|count_if(span.status,equals,internal_error)',
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
`sum(${SpanFields.GEN_AI_COST_TOTAL_TOKENS})`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ const TOOLS_TABLE = {
fields: [
SpanFields.GEN_AI_TOOL_NAME,
'count()',
'count_if(span.status,equals,internal_error)',
'equation|count_if(span.status,equals,internal_error)',
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
],
aggregates: [
'count()',
'count_if(span.status,equals,internal_error)',
'equation|count_if(span.status,equals,internal_error)',
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ const OVERVIEW_TABLE = {
SpanFields.SPAN_DESCRIPTION,
'count()',
`${SpanFunction.FAILURE_RATE}()`,
`count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
],
aggregates: [
'count()',
`${SpanFunction.FAILURE_RATE}()`,
`count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ const PROMPTS_TABLE = {
SpanFields.MCP_PROMPT_NAME,
'count()',
`${SpanFunction.FAILURE_RATE}()`,
`count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
],
aggregates: [
'count()',
`${SpanFunction.FAILURE_RATE}()`,
`count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ const RESOURCES_TABLE = {
SpanFields.MCP_RESOURCE_URI,
'count()',
`${SpanFunction.FAILURE_RATE}()`,
`count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
],
aggregates: [
'count()',
`${SpanFunction.FAILURE_RATE}()`,
`count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ const TOOLS_TABLE = {
SpanFields.MCP_TOOL_NAME,
'count()',
`${SpanFunction.FAILURE_RATE}()`,
`count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
],
aggregates: [
'count()',
`${SpanFunction.FAILURE_RATE}()`,
`count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`equation|count_if(${SpanFields.SPAN_STATUS},equals,internal_error)`,
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ const JOBS_TABLE: Widget = {
'count()',
'failure_rate()',
`avg(${SpanFields.MESSAGING_MESSAGE_RECEIVE_LATENCY})`,
`avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`sum(${SpanFields.SPAN_DURATION})`,
],
columns: [SpanFields.MESSAGING_MESSAGE_DESTINATION_NAME, 'transaction'],
aggregates: [
'count()',
'failure_rate()',
`avg(${SpanFields.MESSAGING_MESSAGE_RECEIVE_LATENCY})`,
`avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`sum(${SpanFields.SPAN_DURATION})`,
],
fieldAliases: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const CLIENT_TRANSACTIONS_TABLE_FIELDS = [
'failure_rate()',
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
`performance_score(${SpanFields.TOTAL_SCORE})`,
`equation|performance_score(${SpanFields.TOTAL_SCORE})`,
];

const CLIENT_TRANSACTIONS_TABLE: Widget = {
Expand All @@ -155,7 +155,7 @@ const CLIENT_TRANSACTIONS_TABLE: Widget = {
'failure_rate()',
`avg(${SpanFields.SPAN_DURATION})`,
`p95(${SpanFields.SPAN_DURATION})`,
`performance_score(${SpanFields.TOTAL_SCORE})`,
`equation|performance_score(${SpanFields.TOTAL_SCORE})`,
],
columns: [SpanFields.TRANSACTION, SpanFields.SPAN_OP, SpanFields.PROJECT],
fields: CLIENT_TRANSACTIONS_TABLE_FIELDS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ const FIRST_ROW_WIDGTS = spaceWidgetsEquallyOnRow(
queries: [
{
name: '',
fields: [`count_if(${SpanFields.SPAN_OP},equals,queue.publish)`],
aggregates: [`count_if(${SpanFields.SPAN_OP},equals,queue.publish)`],
fields: [`equation|count_if(${SpanFields.SPAN_OP},equals,queue.publish)`],
aggregates: [`equation|count_if(${SpanFields.SPAN_OP},equals,queue.publish)`],
columns: [],
conditions: SPAN_OP_FILTER,
orderby: `count_if(${SpanFields.SPAN_OP},equals,queue.publish)`,
orderby: `equation|count_if(${SpanFields.SPAN_OP},equals,queue.publish)`,
},
],
},
Expand All @@ -96,11 +96,11 @@ const FIRST_ROW_WIDGTS = spaceWidgetsEquallyOnRow(
queries: [
{
name: '',
fields: [`count_if(${SpanFields.SPAN_OP},equals,queue.process)`],
aggregates: [`count_if(${SpanFields.SPAN_OP},equals,queue.process)`],
fields: [`equation|count_if(${SpanFields.SPAN_OP},equals,queue.process)`],
aggregates: [`equation|count_if(${SpanFields.SPAN_OP},equals,queue.process)`],
columns: [],
conditions: SPAN_OP_FILTER,
orderby: `count_if(${SpanFields.SPAN_OP},equals,queue.process)`,
orderby: `equation|count_if(${SpanFields.SPAN_OP},equals,queue.process)`,
},
],
},
Expand Down Expand Up @@ -140,12 +140,12 @@ const PRODUCER_TABLE: Widget = {
fields: [
SpanFields.TRANSACTION,
`equation|1 - (count_if(${SpanFields.TRACE_STATUS},equals,ok) / count(${SpanFields.SPAN_DURATION}))`,
`count_if(${SpanFields.SPAN_OP},equals,queue.publish)`,
`equation|count_if(${SpanFields.SPAN_OP},equals,queue.publish)`,
`sum(${SpanFields.SPAN_DURATION})`,
],
aggregates: [
`equation|1 - (count_if(${SpanFields.TRACE_STATUS},equals,ok) / count(${SpanFields.SPAN_DURATION}))`,
`count_if(${SpanFields.SPAN_OP},equals,queue.publish)`,
`equation|count_if(${SpanFields.SPAN_OP},equals,queue.publish)`,
`sum(${SpanFields.SPAN_DURATION})`,
],
columns: [SpanFields.TRANSACTION],
Expand Down Expand Up @@ -176,16 +176,16 @@ const CONSUMER_TABLE: Widget = {
fields: [
SpanFields.TRANSACTION,
`avg(${SpanFields.MESSAGING_MESSAGE_RECEIVE_LATENCY})`,
`avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|1 - (count_if(${SpanFields.TRACE_STATUS},equals,ok) / count(${SpanFields.SPAN_DURATION}))`,
`count_if(${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|count_if(${SpanFields.SPAN_OP},equals,queue.process)`,
`sum(${SpanFields.SPAN_DURATION})`,
],
aggregates: [
`avg(${SpanFields.MESSAGING_MESSAGE_RECEIVE_LATENCY})`,
`avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|1 - (count_if(${SpanFields.TRACE_STATUS},equals,ok) / count(${SpanFields.SPAN_DURATION}))`,
`count_if(${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|count_if(${SpanFields.SPAN_OP},equals,queue.process)`,
`sum(${SpanFields.SPAN_DURATION})`,
],
columns: [SpanFields.TRANSACTION],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ const DESTINATION_TABLE: Widget = {
fields: [
SpanFields.MESSAGING_MESSAGE_DESTINATION_NAME,
`avg(${SpanFields.MESSAGING_MESSAGE_RECEIVE_LATENCY})`,
`avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|1 - (count_if(${SpanFields.TRACE_STATUS},equals,ok) / count(${SpanFields.SPAN_DURATION}))`,
`count_if(${SpanFields.SPAN_OP},equals,queue.publish)`,
`count_if(${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|count_if(${SpanFields.SPAN_OP},equals,queue.publish)`,
`equation|count_if(${SpanFields.SPAN_OP},equals,queue.process)`,
`sum(${SpanFields.SPAN_DURATION})`,
],
columns: [SpanFields.MESSAGING_MESSAGE_DESTINATION_NAME],
aggregates: [
`avg(${SpanFields.MESSAGING_MESSAGE_RECEIVE_LATENCY})`,
`avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|avg_if(${SpanFields.SPAN_DURATION},${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|1 - (count_if(${SpanFields.TRACE_STATUS},equals,ok) / count(${SpanFields.SPAN_DURATION}))`,
`count_if(${SpanFields.SPAN_OP},equals,queue.publish)`,
`count_if(${SpanFields.SPAN_OP},equals,queue.process)`,
`equation|count_if(${SpanFields.SPAN_OP},equals,queue.publish)`,
`equation|count_if(${SpanFields.SPAN_OP},equals,queue.process)`,
`sum(${SpanFields.SPAN_DURATION})`,
],
fieldAliases: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ export const WEB_VITALS_PREBUILT_CONFIG: PrebuiltDashboard = {
'p75(measurements.cls)',
'p75(measurements.ttfb)',
'p75(measurements.inp)',
'performance_score(measurements.score.total)',
'opportunity_score(measurements.score.total)',
'equation|performance_score(measurements.score.total)',
'equation|opportunity_score(measurements.score.total)',
],
aggregates: [],
columns: [
Expand All @@ -291,10 +291,10 @@ export const WEB_VITALS_PREBUILT_CONFIG: PrebuiltDashboard = {
'p75(measurements.cls)',
'p75(measurements.ttfb)',
'p75(measurements.inp)',
'performance_score(measurements.score.total)',
'opportunity_score(measurements.score.total)',
'equation|performance_score(measurements.score.total)',
'equation|opportunity_score(measurements.score.total)',
],
orderby: `-opportunity_score(measurements.score.total)`,
orderby: `-equation|opportunity_score(measurements.score.total)`,
fieldAliases: [
t('Pages'),
t('Project'),
Expand Down
Loading