diff --git a/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/TraceTypeField.test.tsx b/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/TraceTypeField.test.tsx index e5a7e076e56..f590f6dc413 100644 --- a/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/TraceTypeField.test.tsx +++ b/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/TraceTypeField.test.tsx @@ -24,11 +24,10 @@ describe('TraceTypeField', () => { ...props.query, azureTraces: { ...props.query.azureTraces, - traceTypes: [], }, }; + render(); - expect(screen.getByText('Choose event types')).toBeInTheDocument(); const menu = screen.getByLabelText(selectors.components.queryEditor.tracesQueryEditor.traceTypes.select); openMenu(menu); diff --git a/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/TraceTypeField.tsx b/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/TraceTypeField.tsx index 9d5ca517013..bd4303b5d57 100644 --- a/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/TraceTypeField.tsx +++ b/public/app/plugins/datasource/azuremonitor/components/TracesQueryEditor/TraceTypeField.tsx @@ -30,12 +30,23 @@ const TraceTypeField = ({ query, variableOptionGroup, onQueryChange }: AzureQuer const options = useMemo(() => [...tables, variableOptionGroup], [tables, variableOptionGroup]); + // Select all trace event ypes by default + const getDefaultOptions = () => { + const allEventTypes = tables.map((t) => t.value); + const defaultQuery = setTraceTypes(query, allEventTypes); + onQueryChange(defaultQuery); + return allEventTypes; + }; + return (