Tempo: Add deprecation notice for Aggregate By (#94050)

Add deprecation notice
This commit is contained in:
Joey 2024-10-03 12:13:56 +01:00 committed by GitHub
parent c04027919b
commit eb60773073
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,7 +4,7 @@ import { v4 as uuidv4 } from 'uuid';
import { GrafanaTheme2 } from '@grafana/data'; import { GrafanaTheme2 } from '@grafana/data';
import { AccessoryButton } from '@grafana/experimental'; import { AccessoryButton } from '@grafana/experimental';
import { HorizontalGroup, InputActionMeta, Select, useStyles2 } from '@grafana/ui'; import { Alert, HorizontalGroup, InputActionMeta, Select, useStyles2 } from '@grafana/ui';
import { TraceqlFilter, TraceqlSearchScope } from '../dataquery.gen'; import { TraceqlFilter, TraceqlSearchScope } from '../dataquery.gen';
import { TempoDatasource } from '../datasource'; import { TempoDatasource } from '../datasource';
@ -81,7 +81,7 @@ export const GroupByField = (props: Props) => {
const scopeOptions = Object.values(TraceqlSearchScope).map((t) => ({ label: t, value: t })); const scopeOptions = Object.values(TraceqlSearchScope).map((t) => ({ label: t, value: t }));
return ( return (
<InlineSearchField label="Aggregate by" tooltip="Select one or more tags to see the metrics summary."> <InlineSearchField label="Aggregate by" tooltip={`${notice} Select one or more tags to see the metrics summary.`}>
<> <>
{query.groupBy?.map((f, i) => { {query.groupBy?.map((f, i) => {
const tags = tagOptions(f) const tags = tagOptions(f)
@ -146,13 +146,22 @@ export const GroupByField = (props: Props) => {
</div> </div>
); );
})} })}
{query.groupBy && query.groupBy.length > 0 && query.groupBy[0].tag && (
<Alert title={notice} severity="warning" className={styles.notice}></Alert>
)}
</> </>
</InlineSearchField> </InlineSearchField>
); );
}; };
export const notice = 'The aggregate by feature is deprecated and will be removed in the future.';
const getStyles = (theme: GrafanaTheme2) => ({ const getStyles = (theme: GrafanaTheme2) => ({
addTag: css({ addTag: css({
marginLeft: theme.spacing(1), marginLeft: theme.spacing(1),
}), }),
notice: css({
width: '500px',
marginTop: theme.spacing(0.75),
}),
}); });