Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions static/app/utils/metrics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ export function getAbsoluteDateTimeRange(params: PageFilters['datetime']) {
return {start: startObj.toISOString(), end: now.toISOString()};
}

// TODO(metrics): remove this when we switch tags to the new meta
export function getMetaDateTimeParams(datetime?: PageFilters['datetime']) {
if (datetime?.period) {
if (statsPeriodToDays(datetime.period) < 14) {
Expand Down
8 changes: 2 additions & 6 deletions static/app/utils/metrics/useMetricsMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@ import useOrganization from 'sentry/utils/useOrganization';

import type {MetricMeta, MRI, UseCase} from '../../types/metrics';

import {getMetaDateTimeParams} from './index';

const DEFAULT_USE_CASES: UseCase[] = ['sessions', 'transactions', 'custom', 'spans'];

export function getMetricsMetaQueryKey(
orgSlug: string,
{projects, datetime}: Partial<PageFilters>,
{projects}: Partial<PageFilters>,
useCase?: UseCase[]
): ApiQueryKey {
const queryParams = projects?.length
? {useCase, project: projects, ...getMetaDateTimeParams(datetime)}
: {useCase, ...getMetaDateTimeParams(datetime)};
const queryParams = projects?.length ? {useCase, project: projects} : {useCase};
return [`/organizations/${orgSlug}/metrics/meta/`, {query: queryParams}];
}

Expand Down