errorsAndTransactions.tsx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. import * as Sentry from '@sentry/react';
  2. import trimStart from 'lodash/trimStart';
  3. import {doEventsRequest} from 'sentry/actionCreators/events';
  4. import {Client, ResponseMeta} from 'sentry/api';
  5. import {isMultiSeriesStats} from 'sentry/components/charts/utils';
  6. import Link from 'sentry/components/links/link';
  7. import {Tooltip} from 'sentry/components/tooltip';
  8. import {t} from 'sentry/locale';
  9. import {
  10. EventsStats,
  11. MultiSeriesEventsStats,
  12. Organization,
  13. PageFilters,
  14. SelectValue,
  15. TagCollection,
  16. } from 'sentry/types';
  17. import {Series} from 'sentry/types/echarts';
  18. import {defined} from 'sentry/utils';
  19. import {CustomMeasurementCollection} from 'sentry/utils/customMeasurements/customMeasurements';
  20. import {EventsTableData, TableData} from 'sentry/utils/discover/discoverQuery';
  21. import {MetaType} from 'sentry/utils/discover/eventView';
  22. import {
  23. getFieldRenderer,
  24. RenderFunctionBaggage,
  25. } from 'sentry/utils/discover/fieldRenderers';
  26. import {
  27. AggregationOutputType,
  28. errorsAndTransactionsAggregateFunctionOutputType,
  29. getAggregateAlias,
  30. isEquation,
  31. isEquationAlias,
  32. isLegalYAxisType,
  33. QueryFieldValue,
  34. SPAN_OP_BREAKDOWN_FIELDS,
  35. stripEquationPrefix,
  36. } from 'sentry/utils/discover/fields';
  37. import {
  38. DiscoverQueryExtras,
  39. DiscoverQueryRequestParams,
  40. doDiscoverQuery,
  41. } from 'sentry/utils/discover/genericDiscoverQuery';
  42. import {Container} from 'sentry/utils/discover/styles';
  43. import {TOP_N} from 'sentry/utils/discover/types';
  44. import {
  45. eventDetailsRouteWithEventView,
  46. generateEventSlug,
  47. } from 'sentry/utils/discover/urls';
  48. import {getShortEventId} from 'sentry/utils/events';
  49. import {FieldKey} from 'sentry/utils/fields';
  50. import {getMeasurements} from 'sentry/utils/measurements/measurements';
  51. import {MEPState} from 'sentry/utils/performance/contexts/metricsEnhancedSetting';
  52. import {
  53. OnDemandControlContext,
  54. shouldUseOnDemandMetrics,
  55. } from 'sentry/utils/performance/contexts/onDemandControl';
  56. import {FieldValueOption} from 'sentry/views/discover/table/queryField';
  57. import {FieldValue, FieldValueKind} from 'sentry/views/discover/table/types';
  58. import {generateFieldOptions} from 'sentry/views/discover/utils';
  59. import {getTraceDetailsUrl} from 'sentry/views/performance/traceDetails/utils';
  60. import {
  61. createUnnamedTransactionsDiscoverTarget,
  62. DiscoverQueryPageSource,
  63. UNPARAMETERIZED_TRANSACTION,
  64. } from 'sentry/views/performance/utils';
  65. import {DisplayType, Widget, WidgetQuery} from '../types';
  66. import {
  67. eventViewFromWidget,
  68. getDashboardsMEPQueryParams,
  69. getNumEquations,
  70. getWidgetInterval,
  71. } from '../utils';
  72. import {EventsSearchBar} from '../widgetBuilder/buildSteps/filterResultsStep/eventsSearchBar';
  73. import {CUSTOM_EQUATION_VALUE} from '../widgetBuilder/buildSteps/sortByStep';
  74. import {
  75. flattenMultiSeriesDataWithGrouping,
  76. transformSeries,
  77. } from '../widgetCard/widgetQueries';
  78. import {DatasetConfig, handleOrderByReset} from './base';
  79. const DEFAULT_WIDGET_QUERY: WidgetQuery = {
  80. name: '',
  81. fields: ['count()'],
  82. columns: [],
  83. fieldAliases: [],
  84. aggregates: ['count()'],
  85. conditions: '',
  86. orderby: '-count()',
  87. };
  88. export type SeriesWithOrdering = [order: number, series: Series];
  89. export const ErrorsAndTransactionsConfig: DatasetConfig<
  90. EventsStats | MultiSeriesEventsStats,
  91. TableData | EventsTableData
  92. > = {
  93. defaultWidgetQuery: DEFAULT_WIDGET_QUERY,
  94. enableEquations: true,
  95. getCustomFieldRenderer: getCustomEventsFieldRenderer,
  96. SearchBar: EventsSearchBar,
  97. filterSeriesSortOptions,
  98. filterYAxisAggregateParams,
  99. filterYAxisOptions,
  100. getTableFieldOptions: getEventsTableFieldOptions,
  101. getTimeseriesSortOptions,
  102. getTableSortOptions,
  103. getGroupByFieldOptions: getEventsTableFieldOptions,
  104. handleOrderByReset,
  105. supportedDisplayTypes: [
  106. DisplayType.AREA,
  107. DisplayType.BAR,
  108. DisplayType.BIG_NUMBER,
  109. DisplayType.LINE,
  110. DisplayType.TABLE,
  111. DisplayType.TOP_N,
  112. ],
  113. getTableRequest: (
  114. api: Client,
  115. widget: Widget,
  116. query: WidgetQuery,
  117. organization: Organization,
  118. pageFilters: PageFilters,
  119. onDemandControlContext?: OnDemandControlContext,
  120. limit?: number,
  121. cursor?: string,
  122. referrer?: string,
  123. mepSetting?: MEPState | null
  124. ) => {
  125. const url = `/organizations/${organization.slug}/events/`;
  126. const queryExtras = {
  127. useOnDemandMetrics: shouldUseOnDemandMetrics(
  128. organization,
  129. widget,
  130. onDemandControlContext
  131. ),
  132. onDemandType: 'dynamic_query',
  133. };
  134. return getEventsRequest(
  135. url,
  136. api,
  137. query,
  138. organization,
  139. pageFilters,
  140. limit,
  141. cursor,
  142. referrer,
  143. mepSetting,
  144. queryExtras
  145. );
  146. },
  147. getSeriesRequest: getEventsSeriesRequest,
  148. transformSeries: transformEventsResponseToSeries,
  149. transformTable: transformEventsResponseToTable,
  150. filterAggregateParams,
  151. getSeriesResultType,
  152. };
  153. function getTableSortOptions(_organization: Organization, widgetQuery: WidgetQuery) {
  154. const {columns, aggregates} = widgetQuery;
  155. const options: SelectValue<string>[] = [];
  156. let equations = 0;
  157. [...aggregates, ...columns]
  158. .filter(field => !!field)
  159. .forEach(field => {
  160. let alias;
  161. const label = stripEquationPrefix(field);
  162. // Equations are referenced via a standard alias following this pattern
  163. if (isEquation(field)) {
  164. alias = `equation[${equations}]`;
  165. equations += 1;
  166. }
  167. options.push({label, value: alias ?? field});
  168. });
  169. return options;
  170. }
  171. function filterSeriesSortOptions(columns: Set<string>) {
  172. return (option: FieldValueOption) => {
  173. if (
  174. option.value.kind === FieldValueKind.FUNCTION ||
  175. option.value.kind === FieldValueKind.EQUATION
  176. ) {
  177. return true;
  178. }
  179. return (
  180. columns.has(option.value.meta.name) ||
  181. option.value.meta.name === CUSTOM_EQUATION_VALUE
  182. );
  183. };
  184. }
  185. function getTimeseriesSortOptions(
  186. organization: Organization,
  187. widgetQuery: WidgetQuery,
  188. tags?: TagCollection
  189. ) {
  190. const options: Record<string, SelectValue<FieldValue>> = {};
  191. options[`field:${CUSTOM_EQUATION_VALUE}`] = {
  192. label: 'Custom Equation',
  193. value: {
  194. kind: FieldValueKind.EQUATION,
  195. meta: {name: CUSTOM_EQUATION_VALUE},
  196. },
  197. };
  198. let equations = 0;
  199. [...widgetQuery.aggregates, ...widgetQuery.columns]
  200. .filter(field => !!field)
  201. .forEach(field => {
  202. let alias;
  203. const label = stripEquationPrefix(field);
  204. // Equations are referenced via a standard alias following this pattern
  205. if (isEquation(field)) {
  206. alias = `equation[${equations}]`;
  207. equations += 1;
  208. options[`equation:${alias}`] = {
  209. label,
  210. value: {
  211. kind: FieldValueKind.EQUATION,
  212. meta: {
  213. name: alias ?? field,
  214. },
  215. },
  216. };
  217. }
  218. });
  219. const fieldOptions = getEventsTableFieldOptions(organization, tags);
  220. return {...options, ...fieldOptions};
  221. }
  222. function getEventsTableFieldOptions(
  223. organization: Organization,
  224. tags?: TagCollection,
  225. customMeasurements?: CustomMeasurementCollection
  226. ) {
  227. const measurements = getMeasurements();
  228. return generateFieldOptions({
  229. organization,
  230. tagKeys: Object.values(tags ?? {}).map(({key}) => key),
  231. measurementKeys: Object.values(measurements).map(({key}) => key),
  232. spanOperationBreakdownKeys: SPAN_OP_BREAKDOWN_FIELDS,
  233. customMeasurements: Object.values(customMeasurements ?? {}).map(
  234. ({key, functions}) => ({
  235. key,
  236. functions,
  237. })
  238. ),
  239. });
  240. }
  241. function transformEventsResponseToTable(
  242. data: TableData | EventsTableData,
  243. _widgetQuery: WidgetQuery
  244. ): TableData {
  245. let tableData = data;
  246. // events api uses a different response format so we need to construct tableData differently
  247. const {fields, ...otherMeta} = (data as EventsTableData).meta ?? {};
  248. tableData = {
  249. ...data,
  250. meta: {...fields, ...otherMeta},
  251. } as TableData;
  252. return tableData as TableData;
  253. }
  254. function filterYAxisAggregateParams(
  255. fieldValue: QueryFieldValue,
  256. displayType: DisplayType
  257. ) {
  258. return (option: FieldValueOption) => {
  259. // Only validate function parameters for timeseries widgets and
  260. // world map widgets.
  261. if (displayType === DisplayType.BIG_NUMBER) {
  262. return true;
  263. }
  264. if (fieldValue.kind !== FieldValueKind.FUNCTION) {
  265. return true;
  266. }
  267. const functionName = fieldValue.function[0];
  268. const primaryOutput = errorsAndTransactionsAggregateFunctionOutputType(
  269. functionName as string,
  270. option.value.meta.name
  271. );
  272. if (primaryOutput) {
  273. return isLegalYAxisType(primaryOutput);
  274. }
  275. if (
  276. option.value.kind === FieldValueKind.FUNCTION ||
  277. option.value.kind === FieldValueKind.EQUATION
  278. ) {
  279. // Functions and equations are not legal options as an aggregate/function parameter.
  280. return false;
  281. }
  282. return isLegalYAxisType(option.value.meta.dataType);
  283. };
  284. }
  285. function filterYAxisOptions(displayType: DisplayType) {
  286. return (option: FieldValueOption) => {
  287. // Only validate function names for timeseries widgets and
  288. // world map widgets.
  289. if (
  290. !(displayType === DisplayType.BIG_NUMBER) &&
  291. option.value.kind === FieldValueKind.FUNCTION
  292. ) {
  293. const primaryOutput = errorsAndTransactionsAggregateFunctionOutputType(
  294. option.value.meta.name,
  295. undefined
  296. );
  297. if (primaryOutput) {
  298. // If a function returns a specific type, then validate it.
  299. return isLegalYAxisType(primaryOutput);
  300. }
  301. }
  302. return option.value.kind === FieldValueKind.FUNCTION;
  303. };
  304. }
  305. function transformEventsResponseToSeries(
  306. data: EventsStats | MultiSeriesEventsStats,
  307. widgetQuery: WidgetQuery
  308. ): Series[] {
  309. let output: Series[] = [];
  310. const queryAlias = widgetQuery.name;
  311. if (isMultiSeriesStats(data)) {
  312. let seriesWithOrdering: SeriesWithOrdering[] = [];
  313. const isMultiSeriesDataWithGrouping =
  314. widgetQuery.aggregates.length > 1 && widgetQuery.columns.length;
  315. // Convert multi-series results into chartable series. Multi series results
  316. // are created when multiple yAxis are used. Convert the timeseries
  317. // data into a multi-series data set. As the server will have
  318. // replied with a map like: {[titleString: string]: EventsStats}
  319. if (isMultiSeriesDataWithGrouping) {
  320. seriesWithOrdering = flattenMultiSeriesDataWithGrouping(data, queryAlias);
  321. } else {
  322. seriesWithOrdering = Object.keys(data).map((seriesName: string) => {
  323. const prefixedName = queryAlias ? `${queryAlias} : ${seriesName}` : seriesName;
  324. const seriesData: EventsStats = data[seriesName];
  325. return [
  326. seriesData.order || 0,
  327. transformSeries(seriesData, prefixedName, seriesName),
  328. ];
  329. });
  330. }
  331. output = [
  332. ...seriesWithOrdering
  333. .sort((itemA, itemB) => itemA[0] - itemB[0])
  334. .map(item => item[1]),
  335. ];
  336. } else {
  337. const field = widgetQuery.aggregates[0];
  338. const prefixedName = queryAlias ? `${queryAlias} : ${field}` : field;
  339. const transformed = transformSeries(data, prefixedName, field);
  340. output.push(transformed);
  341. }
  342. return output;
  343. }
  344. // Get the series result type from the EventsStats meta
  345. function getSeriesResultType(
  346. data: EventsStats | MultiSeriesEventsStats,
  347. widgetQuery: WidgetQuery
  348. ): Record<string, AggregationOutputType> {
  349. const field = widgetQuery.aggregates[0];
  350. const resultTypes = {};
  351. // Need to use getAggregateAlias since events-stats still uses aggregate alias format
  352. if (isMultiSeriesStats(data)) {
  353. Object.keys(data).forEach(
  354. key => (resultTypes[key] = data[key].meta?.fields[getAggregateAlias(key)])
  355. );
  356. } else {
  357. resultTypes[field] = data.meta?.fields[getAggregateAlias(field)];
  358. }
  359. return resultTypes;
  360. }
  361. function renderEventIdAsLinkable(data, {eventView, organization}: RenderFunctionBaggage) {
  362. const id: string | unknown = data?.id;
  363. if (!eventView || typeof id !== 'string') {
  364. return null;
  365. }
  366. const eventSlug = generateEventSlug(data);
  367. const target = eventDetailsRouteWithEventView({
  368. orgSlug: organization.slug,
  369. eventSlug,
  370. eventView,
  371. });
  372. return (
  373. <Tooltip title={t('View Event')}>
  374. <Link data-test-id="view-event" to={target}>
  375. <Container>{getShortEventId(id)}</Container>
  376. </Link>
  377. </Tooltip>
  378. );
  379. }
  380. function renderTraceAsLinkable(
  381. data,
  382. {eventView, organization, location}: RenderFunctionBaggage
  383. ) {
  384. const id: string | unknown = data?.trace;
  385. if (!eventView || typeof id !== 'string') {
  386. return null;
  387. }
  388. const dateSelection = eventView.normalizeDateSelection(location);
  389. const target = getTraceDetailsUrl(organization, String(data.trace), dateSelection, {});
  390. return (
  391. <Tooltip title={t('View Trace')}>
  392. <Link data-test-id="view-trace" to={target}>
  393. <Container>{getShortEventId(id)}</Container>
  394. </Link>
  395. </Tooltip>
  396. );
  397. }
  398. export function getCustomEventsFieldRenderer(field: string, meta: MetaType) {
  399. if (field === 'id') {
  400. return renderEventIdAsLinkable;
  401. }
  402. if (field === 'trace') {
  403. return renderTraceAsLinkable;
  404. }
  405. // When title or transaction are << unparameterized >>, link out to discover showing unparameterized transactions
  406. if (['title', 'transaction'].includes(field)) {
  407. return function (data, baggage) {
  408. if (data[field] === UNPARAMETERIZED_TRANSACTION) {
  409. return (
  410. <Container>
  411. <Link
  412. to={createUnnamedTransactionsDiscoverTarget({
  413. location: baggage.location,
  414. organization: baggage.organization,
  415. source: DiscoverQueryPageSource.DISCOVER,
  416. })}
  417. >
  418. {data[field]}
  419. </Link>
  420. </Container>
  421. );
  422. }
  423. return getFieldRenderer(field, meta, false)(data, baggage);
  424. };
  425. }
  426. return getFieldRenderer(field, meta, false);
  427. }
  428. function getEventsRequest(
  429. url: string,
  430. api: Client,
  431. query: WidgetQuery,
  432. _organization: Organization,
  433. pageFilters: PageFilters,
  434. limit?: number,
  435. cursor?: string,
  436. referrer?: string,
  437. mepSetting?: MEPState | null,
  438. queryExtras?: DiscoverQueryExtras
  439. ) {
  440. const isMEPEnabled = defined(mepSetting) && mepSetting !== MEPState.TRANSACTIONS_ONLY;
  441. const eventView = eventViewFromWidget('', query, pageFilters);
  442. const params: DiscoverQueryRequestParams = {
  443. per_page: limit,
  444. cursor,
  445. referrer,
  446. ...getDashboardsMEPQueryParams(isMEPEnabled),
  447. ...queryExtras,
  448. };
  449. if (query.orderby) {
  450. params.sort = typeof query.orderby === 'string' ? [query.orderby] : query.orderby;
  451. }
  452. // TODO: eventually need to replace this with just EventsTableData as we deprecate eventsv2
  453. return doDiscoverQuery<TableData | EventsTableData>(
  454. api,
  455. url,
  456. {
  457. ...eventView.generateQueryStringObject(),
  458. ...params,
  459. },
  460. // Tries events request up to 3 times on rate limit
  461. {
  462. retry: {
  463. statusCodes: [429],
  464. tries: 3,
  465. },
  466. }
  467. );
  468. }
  469. function getEventsSeriesRequest(
  470. api: Client,
  471. widget: Widget,
  472. queryIndex: number,
  473. organization: Organization,
  474. pageFilters: PageFilters,
  475. onDemandControlContext?: OnDemandControlContext,
  476. referrer?: string,
  477. mepSetting?: MEPState | null
  478. ) {
  479. const widgetQuery = widget.queries[queryIndex];
  480. const {displayType, limit} = widget;
  481. const {environments, projects} = pageFilters;
  482. const {start, end, period: statsPeriod} = pageFilters.datetime;
  483. const interval = getWidgetInterval(displayType, {start, end, period: statsPeriod});
  484. const isMEPEnabled = defined(mepSetting) && mepSetting !== MEPState.TRANSACTIONS_ONLY;
  485. let requestData;
  486. if (displayType === DisplayType.TOP_N) {
  487. requestData = {
  488. organization,
  489. interval,
  490. start,
  491. end,
  492. project: projects,
  493. environment: environments,
  494. period: statsPeriod,
  495. query: widgetQuery.conditions,
  496. yAxis: widgetQuery.aggregates[widgetQuery.aggregates.length - 1],
  497. includePrevious: false,
  498. referrer,
  499. partial: true,
  500. field: [...widgetQuery.columns, ...widgetQuery.aggregates],
  501. queryExtras: getDashboardsMEPQueryParams(isMEPEnabled),
  502. includeAllArgs: true,
  503. topEvents: TOP_N,
  504. };
  505. if (widgetQuery.orderby) {
  506. requestData.orderby = widgetQuery.orderby;
  507. }
  508. } else {
  509. requestData = {
  510. organization,
  511. interval,
  512. start,
  513. end,
  514. project: projects,
  515. environment: environments,
  516. period: statsPeriod,
  517. query: widgetQuery.conditions,
  518. yAxis: widgetQuery.aggregates,
  519. orderby: widgetQuery.orderby,
  520. includePrevious: false,
  521. referrer,
  522. partial: true,
  523. queryExtras: getDashboardsMEPQueryParams(isMEPEnabled),
  524. includeAllArgs: true,
  525. };
  526. if (widgetQuery.columns?.length !== 0) {
  527. requestData.topEvents = limit ?? TOP_N;
  528. requestData.field = [...widgetQuery.columns, ...widgetQuery.aggregates];
  529. // Compare field and orderby as aliases to ensure requestData has
  530. // the orderby selected
  531. // If the orderby is an equation alias, do not inject it
  532. const orderby = trimStart(widgetQuery.orderby, '-');
  533. if (
  534. widgetQuery.orderby &&
  535. !isEquationAlias(orderby) &&
  536. !requestData.field.includes(orderby)
  537. ) {
  538. requestData.field.push(orderby);
  539. }
  540. // The "Other" series is only included when there is one
  541. // y-axis and one widgetQuery
  542. requestData.excludeOther =
  543. widgetQuery.aggregates.length !== 1 || widget.queries.length !== 1;
  544. if (isEquation(trimStart(widgetQuery.orderby, '-'))) {
  545. const nextEquationIndex = getNumEquations(widgetQuery.aggregates);
  546. const isDescending = widgetQuery.orderby.startsWith('-');
  547. const prefix = isDescending ? '-' : '';
  548. // Construct the alias form of the equation and inject it into the request
  549. requestData.orderby = `${prefix}equation[${nextEquationIndex}]`;
  550. requestData.field = [
  551. ...widgetQuery.columns,
  552. ...widgetQuery.aggregates,
  553. trimStart(widgetQuery.orderby, '-'),
  554. ];
  555. }
  556. }
  557. }
  558. if (shouldUseOnDemandMetrics(organization, widget, onDemandControlContext)) {
  559. return doOnDemandMetricsRequest(api, requestData);
  560. }
  561. return doEventsRequest<true>(api, requestData);
  562. }
  563. async function doOnDemandMetricsRequest(
  564. api,
  565. requestData
  566. ): Promise<
  567. [EventsStats | MultiSeriesEventsStats, string | undefined, ResponseMeta | undefined]
  568. > {
  569. try {
  570. const isEditing = location.pathname.endsWith('/edit/');
  571. const fetchEstimatedStats = () =>
  572. `/organizations/${requestData.organization.slug}/metrics-estimation-stats/`;
  573. const response = await doEventsRequest<false>(api, {
  574. ...requestData,
  575. queryExtras: {
  576. ...requestData.queryExtras,
  577. useOnDemandMetrics: true,
  578. onDemandType: 'dynamic_query',
  579. },
  580. dataset: 'metricsEnhanced',
  581. generatePathname: isEditing ? fetchEstimatedStats : undefined,
  582. });
  583. response[0] = {...response[0], isMetricsData: true, isExtrapolatedData: isEditing};
  584. return [response[0], response[1], response[2]];
  585. } catch (err) {
  586. Sentry.captureMessage('Failed to fetch metrics estimation stats', {extra: err});
  587. return doEventsRequest<true>(api, requestData);
  588. }
  589. }
  590. // Checks fieldValue to see what function is being used and only allow supported custom measurements
  591. function filterAggregateParams(option: FieldValueOption, fieldValue?: QueryFieldValue) {
  592. if (
  593. (option.value.kind === FieldValueKind.CUSTOM_MEASUREMENT &&
  594. fieldValue?.kind === 'function' &&
  595. fieldValue?.function &&
  596. !option.value.meta.functions.includes(fieldValue.function[0])) ||
  597. option.value.meta.name === FieldKey.TOTAL_COUNT
  598. ) {
  599. return false;
  600. }
  601. return true;
  602. }