|
@@ -9,6 +9,7 @@ import SmartSearchBar from 'sentry/components/smartSearchBar';
|
|
import {NEGATION_OPERATOR, SEARCH_WILDCARD} from 'sentry/constants';
|
|
import {NEGATION_OPERATOR, SEARCH_WILDCARD} from 'sentry/constants';
|
|
import {Organization, SavedSearchType, Tag, TagCollection} from 'sentry/types';
|
|
import {Organization, SavedSearchType, Tag, TagCollection} from 'sentry/types';
|
|
import {defined} from 'sentry/utils';
|
|
import {defined} from 'sentry/utils';
|
|
|
|
+import {CustomMeasurementCollection} from 'sentry/utils/customMeasurements/customMeasurements';
|
|
import {
|
|
import {
|
|
Field,
|
|
Field,
|
|
FIELD_TAGS,
|
|
FIELD_TAGS,
|
|
@@ -87,6 +88,7 @@ const getSemverTags = () =>
|
|
export type SearchBarProps = Omit<React.ComponentProps<typeof SmartSearchBar>, 'tags'> & {
|
|
export type SearchBarProps = Omit<React.ComponentProps<typeof SmartSearchBar>, 'tags'> & {
|
|
organization: Organization;
|
|
organization: Organization;
|
|
tags: TagCollection;
|
|
tags: TagCollection;
|
|
|
|
+ customMeasurements?: CustomMeasurementCollection;
|
|
fields?: Readonly<Field[]>;
|
|
fields?: Readonly<Field[]>;
|
|
includeSessionTagsValues?: boolean;
|
|
includeSessionTagsValues?: boolean;
|
|
/**
|
|
/**
|
|
@@ -108,6 +110,7 @@ function SearchBar(props: SearchBarProps) {
|
|
projectIds,
|
|
projectIds,
|
|
includeSessionTagsValues,
|
|
includeSessionTagsValues,
|
|
maxMenuHeight,
|
|
maxMenuHeight,
|
|
|
|
+ customMeasurements,
|
|
} = props;
|
|
} = props;
|
|
|
|
|
|
const api = useApi();
|
|
const api = useApi();
|
|
@@ -206,7 +209,7 @@ function SearchBar(props: SearchBarProps) {
|
|
hasRecentSearches
|
|
hasRecentSearches
|
|
savedSearchType={SavedSearchType.EVENT}
|
|
savedSearchType={SavedSearchType.EVENT}
|
|
onGetTagValues={getEventFieldValues}
|
|
onGetTagValues={getEventFieldValues}
|
|
- supportedTags={getTagList(measurements)}
|
|
+ supportedTags={getTagList({...measurements, ...(customMeasurements ?? {})})}
|
|
prepareQuery={query => {
|
|
prepareQuery={query => {
|
|
// Prepare query string (e.g. strip special characters like negation operator)
|
|
// Prepare query string (e.g. strip special characters like negation operator)
|
|
return query.replace(SEARCH_SPECIAL_CHARS_REGEXP, '');
|
|
return query.replace(SEARCH_SPECIAL_CHARS_REGEXP, '');
|