From dd5cb03d1e23d6014ea3657d9bf4f43a7807e711 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Wed, 19 Nov 2025 15:32:55 -0800 Subject: [PATCH 1/8] fix(aci): Hide failure rate and hide string options for p50 - hides failure rate and failure count options from metric monitors - hides string tags for aggregate functions like p50, p90 --- .../components/forms/metric/visualize.tsx | 52 +++++++++++++++---- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/static/app/views/detectors/components/forms/metric/visualize.tsx b/static/app/views/detectors/components/forms/metric/visualize.tsx index 16bb8bd8925774..91de7b1f8c40a2 100644 --- a/static/app/views/detectors/components/forms/metric/visualize.tsx +++ b/static/app/views/detectors/components/forms/metric/visualize.tsx @@ -15,6 +15,8 @@ import {parseFunction} from 'sentry/utils/discover/fields'; import { AggregationKey, ALLOWED_EXPLORE_VISUALIZE_AGGREGATES, + FieldValueType, + getFieldDefinition, prettifyTagKey, } from 'sentry/utils/fields'; import {unreachable} from 'sentry/utils/unreachable'; @@ -91,13 +93,24 @@ function renderTag(kind: FieldValueKind): React.ReactNode { return {text}; } +const SPAN_LOGS_NOT_ALLOWED_AGGREGATES = [ + AggregationKey.FAILURE_RATE, + AggregationKey.FAILURE_COUNT, +]; + +function getEAPAllowedAggregates(): Array<[string, string]> { + return ALLOWED_EXPLORE_VISUALIZE_AGGREGATES.filter( + aggregate => !SPAN_LOGS_NOT_ALLOWED_AGGREGATES.includes(aggregate) + ).map(aggregate => [aggregate, aggregate]); +} + function getAggregateOptions( dataset: DetectorDataset, tableFieldOptions: Record> ): Array<[string, string]> { // For spans dataset, use the predefined aggregates if (dataset === DetectorDataset.SPANS || dataset === DetectorDataset.LOGS) { - return ALLOWED_EXPLORE_VISUALIZE_AGGREGATES.map(aggregate => [aggregate, aggregate]); + return getEAPAllowedAggregates(); } // For other datasets, extract function-type options from tableFieldOptions @@ -107,7 +120,7 @@ function getAggregateOptions( // If no function options available, fall back to the predefined aggregates if (functionOptions.length === 0) { - return ALLOWED_EXPLORE_VISUALIZE_AGGREGATES.map(aggregate => [aggregate, aggregate]); + return getEAPAllowedAggregates(); } return functionOptions.sort((a, b) => a[1].localeCompare(b[1])); @@ -218,15 +231,32 @@ export function Visualize() { const fieldOptions = useMemo(() => { // For Spans dataset, use span-specific options from the provider if (dataset === DetectorDataset.SPANS || dataset === DetectorDataset.LOGS) { + // Use field definition to determine what options should be displayed + const fieldDefinition = getFieldDefinition( + aggregate, + dataset === DetectorDataset.SPANS ? 'span' : 'log' + ); + let isTypeAllowed = (_valueType: FieldValueType) => true; + if (fieldDefinition?.parameters?.[0]?.kind === 'column') { + const columnTypes = fieldDefinition?.parameters[0]?.columnTypes; + isTypeAllowed = (valueType: FieldValueType) => + typeof columnTypes === 'function' + ? columnTypes({key: '', valueType}) + : columnTypes.includes(valueType); + } const spanColumnOptions: Array<[string, string]> = [ - ...Object.values(stringSpanTags).map((tag): [string, string] => [ - tag.key, - prettifyTagKey(tag.name), - ]), - ...Object.values(numericSpanTags).map((tag): [string, string] => [ - tag.key, - prettifyTagKey(tag.name), - ]), + ...(isTypeAllowed(FieldValueType.STRING) + ? Object.values(stringSpanTags).map((tag): [string, string] => [ + tag.key, + prettifyTagKey(tag.name), + ]) + : []), + ...(isTypeAllowed(FieldValueType.NUMBER) + ? Object.values(numericSpanTags).map((tag): [string, string] => [ + tag.key, + prettifyTagKey(tag.name), + ]) + : []), ]; return spanColumnOptions.sort((a, b) => a[1].localeCompare(b[1])); } @@ -239,7 +269,7 @@ export function Visualize() { ) .map((option): [string, string] => [option.value.meta.name, option.value.meta.name]) .sort((a, b) => a[1].localeCompare(b[1])); - }, [dataset, stringSpanTags, numericSpanTags, aggregateOptions]); + }, [dataset, stringSpanTags, numericSpanTags, aggregateOptions, aggregate]); const fieldOptionsDropdown = useMemo(() => { return fieldOptions.map(([value, label]) => ({ From 6e9ced793be1771f42d44ab51950289f762cb005 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Thu, 20 Nov 2025 11:15:16 -0800 Subject: [PATCH 2/8] only disallow aggregates for logs --- .../components/forms/metric/visualize.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/static/app/views/detectors/components/forms/metric/visualize.tsx b/static/app/views/detectors/components/forms/metric/visualize.tsx index 91de7b1f8c40a2..57f3f245e31e52 100644 --- a/static/app/views/detectors/components/forms/metric/visualize.tsx +++ b/static/app/views/detectors/components/forms/metric/visualize.tsx @@ -93,15 +93,18 @@ function renderTag(kind: FieldValueKind): React.ReactNode { return {text}; } -const SPAN_LOGS_NOT_ALLOWED_AGGREGATES = [ +const LOGS_NOT_ALLOWED_AGGREGATES = [ AggregationKey.FAILURE_RATE, AggregationKey.FAILURE_COUNT, ]; -function getEAPAllowedAggregates(): Array<[string, string]> { - return ALLOWED_EXPLORE_VISUALIZE_AGGREGATES.filter( - aggregate => !SPAN_LOGS_NOT_ALLOWED_AGGREGATES.includes(aggregate) - ).map(aggregate => [aggregate, aggregate]); +function getEAPAllowedAggregates(dataset: DetectorDataset): Array<[string, string]> { + return ALLOWED_EXPLORE_VISUALIZE_AGGREGATES.filter(aggregate => { + if (dataset === DetectorDataset.LOGS) { + return !LOGS_NOT_ALLOWED_AGGREGATES.includes(aggregate); + } + return true; + }).map(aggregate => [aggregate, aggregate]); } function getAggregateOptions( @@ -110,7 +113,7 @@ function getAggregateOptions( ): Array<[string, string]> { // For spans dataset, use the predefined aggregates if (dataset === DetectorDataset.SPANS || dataset === DetectorDataset.LOGS) { - return getEAPAllowedAggregates(); + return getEAPAllowedAggregates(dataset); } // For other datasets, extract function-type options from tableFieldOptions @@ -120,7 +123,7 @@ function getAggregateOptions( // If no function options available, fall back to the predefined aggregates if (functionOptions.length === 0) { - return getEAPAllowedAggregates(); + return getEAPAllowedAggregates(dataset); } return functionOptions.sort((a, b) => a[1].localeCompare(b[1])); From f85a038f29e6cd1e208f1edc6736338e0693b0cd Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Thu, 20 Nov 2025 15:34:28 -0800 Subject: [PATCH 3/8] feat(aci): Display apdex option for spans Adds back the apdex option and a test so it doesn't disappear. --- .../components/forms/metric/visualize.tsx | 72 +++++++++++------ .../views/detectors/datasetConfig/spans.tsx | 59 +++++++++++++- .../app/views/detectors/new-setting.spec.tsx | 79 +++++++++++++++++++ 3 files changed, 186 insertions(+), 24 deletions(-) diff --git a/static/app/views/detectors/components/forms/metric/visualize.tsx b/static/app/views/detectors/components/forms/metric/visualize.tsx index 57f3f245e31e52..cb4853203d2227 100644 --- a/static/app/views/detectors/components/forms/metric/visualize.tsx +++ b/static/app/views/detectors/components/forms/metric/visualize.tsx @@ -39,11 +39,6 @@ import {FieldValueKind} from 'sentry/views/discover/table/types'; import {DEFAULT_VISUALIZATION_FIELD} from 'sentry/views/explore/contexts/pageParamsContext/visualizes'; import {TraceItemDataset} from 'sentry/views/explore/types'; -const LOCKED_SPAN_COUNT_OPTION = { - value: DEFAULT_VISUALIZATION_FIELD, - label: t('spans'), -}; - /** * Render a tag badge for field types, similar to dashboard widget builder */ @@ -93,18 +88,43 @@ function renderTag(kind: FieldValueKind): React.ReactNode { return {text}; } +/** + * Aggregate options not allowed for the logs dataset + */ const LOGS_NOT_ALLOWED_AGGREGATES = [ AggregationKey.FAILURE_RATE, AggregationKey.FAILURE_COUNT, + AggregationKey.APDEX, ]; +/** + * Additional aggregate options for the spans dataset + */ +const EXTRA_AGGREGATES = [AggregationKey.APDEX]; + +/** + * Locks the options because they usually need to count something specific + */ +const LOCKED_SPAN_AGGREGATES = { + [AggregationKey.APDEX]: { + value: DEFAULT_VISUALIZATION_FIELD, + label: t('span.duration'), + }, + [AggregationKey.COUNT]: { + value: DEFAULT_VISUALIZATION_FIELD, + label: t('spans'), + }, +}; + function getEAPAllowedAggregates(dataset: DetectorDataset): Array<[string, string]> { - return ALLOWED_EXPLORE_VISUALIZE_AGGREGATES.filter(aggregate => { - if (dataset === DetectorDataset.LOGS) { - return !LOGS_NOT_ALLOWED_AGGREGATES.includes(aggregate); - } - return true; - }).map(aggregate => [aggregate, aggregate]); + return [...ALLOWED_EXPLORE_VISUALIZE_AGGREGATES, ...EXTRA_AGGREGATES] + .filter(aggregate => { + if (dataset === DetectorDataset.LOGS) { + return !LOGS_NOT_ALLOWED_AGGREGATES.includes(aggregate); + } + return true; + }) + .map(aggregate => [aggregate, aggregate]); } function getAggregateOptions( @@ -226,10 +246,9 @@ export function Visualize() { const datasetConfig = useMemo(() => getDatasetConfig(dataset), [dataset]); - const aggregateOptions = useMemo( - () => datasetConfig.getAggregateOptions(organization, tags, customMeasurements), - [organization, tags, datasetConfig, customMeasurements] - ); + const aggregateOptions = useMemo(() => { + return datasetConfig.getAggregateOptions(organization, tags, customMeasurements); + }, [organization, tags, datasetConfig, customMeasurements]); const fieldOptions = useMemo(() => { // For Spans dataset, use span-specific options from the provider @@ -333,8 +352,18 @@ export function Visualize() { updateAggregateFunction(aggregate, newParameters); }; + // Type guard for locked span aggregates + const isLockedSpanAggregate = ( + agg: string + ): agg is keyof typeof LOCKED_SPAN_AGGREGATES => { + return agg in LOCKED_SPAN_AGGREGATES; + }; + const lockSpanOptions = - dataset === DetectorDataset.SPANS && aggregate === AggregationKey.COUNT; + dataset === DetectorDataset.SPANS && isLockedSpanAggregate(aggregate); + + // Get locked option if applicable, with proper type narrowing + const lockedOption = lockSpanOptions ? LOCKED_SPAN_AGGREGATES[aggregate] : null; return ( @@ -368,15 +397,13 @@ export function Visualize() { ) : ( { diff --git a/static/app/views/detectors/datasetConfig/spans.tsx b/static/app/views/detectors/datasetConfig/spans.tsx index c1e53d71b45322..08bb566def69d2 100644 --- a/static/app/views/detectors/datasetConfig/spans.tsx +++ b/static/app/views/detectors/datasetConfig/spans.tsx @@ -1,6 +1,11 @@ import {t} from 'sentry/locale'; -import type {EventsStats} from 'sentry/types/organization'; +import type {SelectValue} from 'sentry/types/core'; +import type {TagCollection} from 'sentry/types/group'; +import type {EventsStats, Organization} from 'sentry/types/organization'; +import type {CustomMeasurementCollection} from 'sentry/utils/customMeasurements/customMeasurements'; +import type {AggregateParameter} from 'sentry/utils/discover/fields'; import {DiscoverDatasets} from 'sentry/utils/discover/types'; +import {AggregationKey, getFieldDefinition} from 'sentry/utils/fields'; import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {EventTypes} from 'sentry/views/alerts/rules/metric/types'; import {SpansConfig} from 'sentry/views/dashboards/datasetConfig/spans'; @@ -20,6 +25,8 @@ import { translateAggregateTag, translateAggregateTagBack, } from 'sentry/views/detectors/datasetConfig/utils/translateAggregateTag'; +import type {FieldValue} from 'sentry/views/discover/table/types'; +import {FieldValueKind} from 'sentry/views/discover/table/types'; import type {DetectorDatasetConfig} from './base'; @@ -27,12 +34,60 @@ type SpansSeriesResponse = EventsStats; const DEFAULT_EVENT_TYPES = [EventTypes.TRACE_ITEM_SPAN]; +function getAggregateOptions( + organization: Organization, + tags?: TagCollection, + customMeasurements?: CustomMeasurementCollection +): Record> { + const base = SpansConfig.getTableFieldOptions(organization, tags, customMeasurements); + + const apdexDefinition = getFieldDefinition(AggregationKey.APDEX, 'span'); + + if (apdexDefinition?.parameters) { + // Convert field definition parameters to discover field format + const convertedParameters = apdexDefinition.parameters.map( + param => { + if (param.kind === 'value') { + return { + kind: 'value' as const, + dataType: param.dataType as any, + required: param.required, + defaultValue: param.defaultValue, + placeholder: param.placeholder, + }; + } + return { + kind: 'column' as const, + columnTypes: Array.isArray(param.columnTypes) + ? (param.columnTypes as any) + : ([param.columnTypes] as any), + required: param.required, + defaultValue: param.defaultValue, + }; + } + ); + + base['function:apdex'] = { + label: 'apdex', + value: { + kind: FieldValueKind.FUNCTION, + meta: { + name: 'apdex', + parameters: convertedParameters, + }, + }, + }; + } + + return base; +} + export const DetectorSpansConfig: DetectorDatasetConfig = { name: t('Spans'), SearchBar: TraceSearchBar, defaultEventTypes: DEFAULT_EVENT_TYPES, defaultField: SpansConfig.defaultField, - getAggregateOptions: SpansConfig.getTableFieldOptions, + getAggregateOptions, getSeriesQueryOptions: options => { return getDiscoverSeriesQueryOptions({ ...options, diff --git a/static/app/views/detectors/new-setting.spec.tsx b/static/app/views/detectors/new-setting.spec.tsx index 69a4b52da0f91c..17300794baa12f 100644 --- a/static/app/views/detectors/new-setting.spec.tsx +++ b/static/app/views/detectors/new-setting.spec.tsx @@ -658,6 +658,85 @@ describe('DetectorEdit', () => { ); }); }); + + it('can submit a new metric detector with apdex aggregate', async () => { + const mockCreateDetector = MockApiClient.addMockResponse({ + url: `/organizations/${organization.slug}/detectors/`, + method: 'POST', + body: MetricDetectorFixture({id: '789'}), + }); + + render(, { + organization, + initialRouterConfig: metricRouterConfig, + }); + + const title = await screen.findByText('New Monitor'); + await userEvent.click(title); + await userEvent.keyboard('Apdex{enter}'); + + // Change aggregate from count to apdex + await userEvent.click(screen.getByRole('button', {name: 'count'})); + await userEvent.click(await screen.findByRole('option', {name: 'apdex'})); + + // The first parameter (span.duration) should be locked and not editable + expect(await screen.findByText('span.duration')).toBeInTheDocument(); + // Change to apdex(100) + await userEvent.clear(screen.getByPlaceholderText('300')); + await userEvent.type(screen.getByPlaceholderText('300'), '100'); + + // Set the high threshold for alerting + await userEvent.type( + screen.getByRole('spinbutton', {name: 'High threshold'}), + '100' + ); + + await userEvent.click(screen.getByRole('button', {name: 'Create Monitor'})); + + await waitFor(() => { + expect(mockCreateDetector).toHaveBeenCalledWith( + `/organizations/${organization.slug}/detectors/`, + expect.objectContaining({ + data: expect.objectContaining({ + name: 'Apdex', + type: 'metric_issue', + projectId: project.id, + owner: null, + workflowIds: [], + conditionGroup: { + conditions: [ + { + comparison: 100, + conditionResult: 75, + type: 'gt', + }, + { + comparison: 100, + conditionResult: 0, + type: 'lte', + }, + ], + logicType: 'any', + }, + config: { + detectionType: 'static', + }, + dataSources: [ + { + aggregate: 'apdex(span.duration,100)', + dataset: 'events_analytics_platform', + eventTypes: ['trace_item_span'], + query: '', + queryType: 1, + timeWindow: 3600, + environment: null, + }, + ], + }), + }) + ); + }); + }); }); describe('Uptime Detector', () => { From 00b02d3ae16b15096e219f3243928ade1f6d3bff Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Thu, 20 Nov 2025 15:36:01 -0800 Subject: [PATCH 4/8] move --- .../components/forms/metric/visualize.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/static/app/views/detectors/components/forms/metric/visualize.tsx b/static/app/views/detectors/components/forms/metric/visualize.tsx index cb4853203d2227..acbeb91f1ef8ba 100644 --- a/static/app/views/detectors/components/forms/metric/visualize.tsx +++ b/static/app/views/detectors/components/forms/metric/visualize.tsx @@ -116,6 +116,13 @@ const LOCKED_SPAN_AGGREGATES = { }, }; +// Type guard for locked span aggregates +const isLockedSpanAggregate = ( + agg: string +): agg is keyof typeof LOCKED_SPAN_AGGREGATES => { + return agg in LOCKED_SPAN_AGGREGATES; +}; + function getEAPAllowedAggregates(dataset: DetectorDataset): Array<[string, string]> { return [...ALLOWED_EXPLORE_VISUALIZE_AGGREGATES, ...EXTRA_AGGREGATES] .filter(aggregate => { @@ -352,13 +359,6 @@ export function Visualize() { updateAggregateFunction(aggregate, newParameters); }; - // Type guard for locked span aggregates - const isLockedSpanAggregate = ( - agg: string - ): agg is keyof typeof LOCKED_SPAN_AGGREGATES => { - return agg in LOCKED_SPAN_AGGREGATES; - }; - const lockSpanOptions = dataset === DetectorDataset.SPANS && isLockedSpanAggregate(aggregate); From 3747cec8cdb06db72ed5bc434a9b0ede45733460 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Thu, 20 Nov 2025 16:03:53 -0800 Subject: [PATCH 5/8] remove casting to any --- static/app/views/detectors/datasetConfig/spans.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/app/views/detectors/datasetConfig/spans.tsx b/static/app/views/detectors/datasetConfig/spans.tsx index 08bb566def69d2..3fdc9c8723c33e 100644 --- a/static/app/views/detectors/datasetConfig/spans.tsx +++ b/static/app/views/detectors/datasetConfig/spans.tsx @@ -50,7 +50,7 @@ function getAggregateOptions( if (param.kind === 'value') { return { kind: 'value' as const, - dataType: param.dataType as any, + dataType: param.dataType as 'number', required: param.required, defaultValue: param.defaultValue, placeholder: param.placeholder, @@ -59,8 +59,8 @@ function getAggregateOptions( return { kind: 'column' as const, columnTypes: Array.isArray(param.columnTypes) - ? (param.columnTypes as any) - : ([param.columnTypes] as any), + ? param.columnTypes + : [param.columnTypes], required: param.required, defaultValue: param.defaultValue, }; From 26bdda156f0ee5f8406917d6cda5b4b4542fda69 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Thu, 20 Nov 2025 16:40:22 -0800 Subject: [PATCH 6/8] remove translation --- .../app/views/detectors/components/forms/metric/visualize.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/app/views/detectors/components/forms/metric/visualize.tsx b/static/app/views/detectors/components/forms/metric/visualize.tsx index 3a3066bdf03ecd..536485e9c579d5 100644 --- a/static/app/views/detectors/components/forms/metric/visualize.tsx +++ b/static/app/views/detectors/components/forms/metric/visualize.tsx @@ -108,11 +108,11 @@ const EXTRA_AGGREGATES = [AggregationKey.APDEX]; const LOCKED_SPAN_AGGREGATES = { [AggregationKey.APDEX]: { value: DEFAULT_VISUALIZATION_FIELD, - label: t('span.duration'), + label: 'span.duration', }, [AggregationKey.COUNT]: { value: DEFAULT_VISUALIZATION_FIELD, - label: t('spans'), + label: 'spans', }, }; From dc96fdae1d3fa6e76bfab044aa104a22079f1f4b Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Thu, 20 Nov 2025 17:06:43 -0800 Subject: [PATCH 7/8] update non disabled dropdown test --- static/app/views/detectors/edit.spec.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/static/app/views/detectors/edit.spec.tsx b/static/app/views/detectors/edit.spec.tsx index c1eda6197ae26e..1aabd3757ddc79 100644 --- a/static/app/views/detectors/edit.spec.tsx +++ b/static/app/views/detectors/edit.spec.tsx @@ -569,7 +569,7 @@ describe('DetectorEdit', () => { expect(screen.queryByText('Dynamic')).not.toBeInTheDocument(); }); - it('disables column select when spans + count()', async () => { + it('limited options when selecting spans + count()', async () => { const spansDetector = MetricDetectorFixture({ dataSources: [ SnubaQueryDataSourceFixture({ @@ -604,9 +604,14 @@ describe('DetectorEdit', () => { await screen.findByRole('link', {name: spansDetector.name}) ).toBeInTheDocument(); - // Column parameter should be locked to "spans" and disabled + // Column parameter should be locked to "spans" - verify only "spans" option is available const button = screen.getByRole('button', {name: 'spans'}); - expect(button).toBeDisabled(); + await userEvent.click(button); + + // Verify only "spans" option exists in the dropdown + const options = screen.getAllByRole('option'); + expect(options).toHaveLength(1); + expect(options[0]).toHaveTextContent('spans'); }); it('resets 1 day interval to 15 minutes when switching to dynamic detection', async () => { From e625d69baff53fec7f9e1d303ff2fb1b2c499f34 Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Fri, 21 Nov 2025 15:04:16 -0800 Subject: [PATCH 8/8] rename constants --- .../components/forms/metric/visualize.tsx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/static/app/views/detectors/components/forms/metric/visualize.tsx b/static/app/views/detectors/components/forms/metric/visualize.tsx index 536485e9c579d5..125b39cb48a8f1 100644 --- a/static/app/views/detectors/components/forms/metric/visualize.tsx +++ b/static/app/views/detectors/components/forms/metric/visualize.tsx @@ -89,21 +89,18 @@ function renderTag(kind: FieldValueKind): React.ReactNode { } /** - * Aggregate options not allowed for the logs dataset + * Aggregate options excluded for the logs dataset */ -const LOGS_NOT_ALLOWED_AGGREGATES = [ +const LOGS_EXCLUDED_AGGREGATES = [ AggregationKey.FAILURE_RATE, AggregationKey.FAILURE_COUNT, AggregationKey.APDEX, ]; -/** - * Additional aggregate options for the spans dataset - */ -const EXTRA_AGGREGATES = [AggregationKey.APDEX]; +const ADDITIONAL_EAP_AGGREGATES = [AggregationKey.APDEX]; /** - * Locks the options because they usually need to count something specific + * Locks the primary dropdown to the single option */ const LOCKED_SPAN_AGGREGATES = { [AggregationKey.APDEX]: { @@ -124,10 +121,10 @@ const isLockedSpanAggregate = ( }; function getEAPAllowedAggregates(dataset: DetectorDataset): Array<[string, string]> { - return [...ALLOWED_EXPLORE_VISUALIZE_AGGREGATES, ...EXTRA_AGGREGATES] + return [...ALLOWED_EXPLORE_VISUALIZE_AGGREGATES, ...ADDITIONAL_EAP_AGGREGATES] .filter(aggregate => { if (dataset === DetectorDataset.LOGS) { - return !LOGS_NOT_ALLOWED_AGGREGATES.includes(aggregate); + return !LOGS_EXCLUDED_AGGREGATES.includes(aggregate); } return true; })