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
12 changes: 12 additions & 0 deletions static/app/constants/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,18 @@ export const DATA_CATEGORY_INFO = {
titleName: t('Profile Seconds'),
uid: 17,
},
/**
* Used to display metrics on the stats page
*/
[DataCategoryExact.METRICS]: {
name: DataCategoryExact.METRICS,
apiName: 'metrics',
plural: 'metrics',
displayName: 'metrics',
titleName: t('Metrics'),
// Metrics has no uid, is only used on stats page
uid: -1,
},
[DataCategoryExact.METRIC_SECOND]: {
name: DataCategoryExact.METRIC_SECOND,
apiName: 'metricSecond',
Expand Down
5 changes: 5 additions & 0 deletions static/app/types/core.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ export enum DataCategoryExact {
MONITOR_SEAT = 'monitorSeat',
PROFILE_DURATION = 'profileDuration',
SPAN = 'span',
/**
* Metrics does not actually exist as a data category, but is used on the stats page.
* See metricSecond instead.
*/
METRICS = 'metrics',
METRIC_SECOND = 'metricSecond',
}

Expand Down
4 changes: 2 additions & 2 deletions static/app/views/organizationStats/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export class OrganizationStats extends Component<OrganizationStatsProps> {
if (opt.value === DATA_CATEGORY_INFO.replay.plural) {
return organization.features.includes('session-replay');
}
if (opt.value === DATA_CATEGORY_INFO.metricSecond.plural) {
if (opt.value === DATA_CATEGORY_INFO.metrics.plural) {
return hasMetricStats(organization);
}
return true;
Expand Down Expand Up @@ -321,7 +321,7 @@ export class OrganizationStats extends Component<OrganizationStatsProps> {
if (opt.value === DATA_CATEGORY_INFO.replay.plural) {
return organization.features.includes('session-replay');
}
if (opt.value === DATA_CATEGORY_INFO.metricSecond.plural) {
if (opt.value === DATA_CATEGORY_INFO.metrics.plural) {
return hasMetricStats(organization);
}
return true;
Expand Down
6 changes: 3 additions & 3 deletions static/app/views/organizationStats/usageChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ export const CHART_OPTIONS_DATACATEGORY: CategoryOption[] = [
yAxisMinInterval: 100,
},
{
label: DATA_CATEGORY_INFO.metricSecond.titleName,
value: DATA_CATEGORY_INFO.metricSecond.plural,
label: DATA_CATEGORY_INFO.metrics.titleName,
value: DATA_CATEGORY_INFO.metrics.plural,
disabled: false,
yAxisMinInterval: 100,
},
Expand Down Expand Up @@ -360,7 +360,7 @@ function UsageChartBody({

const filteredOptions = useMemo(() => {
return categoryOptions.filter(option => {
if (option.value !== DATA_CATEGORY_INFO.metricSecond.plural) {
if (option.value !== DATA_CATEGORY_INFO.metrics.plural) {
return true;
}
return (
Expand Down
6 changes: 3 additions & 3 deletions static/app/views/organizationStats/usageStatsOrg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class UsageStatsOrganization<
{
query: {
...this.endpointQuery,
category: DATA_CATEGORY_INFO.metricSecond.apiName,
category: DATA_CATEGORY_INFO.metrics.apiName,
groupBy: ['outcome'],
},
},
Expand All @@ -159,7 +159,7 @@ class UsageStatsOrganization<
...group,
by: {
...group.by,
category: DATA_CATEGORY_INFO.metricSecond.apiName,
category: DATA_CATEGORY_INFO.metrics.apiName,
},
};
});
Expand Down Expand Up @@ -345,7 +345,7 @@ class UsageStatsOrganization<
filtered: {
title: tct('Filtered [dataCategory]', {dataCategory: dataCategoryName}),
help:
dataCategory === DATA_CATEGORY_INFO.metricSecond.plural
dataCategory === DATA_CATEGORY_INFO.metrics.plural
? tct(
'Filtered metrics were blocked due to your disabled metrics [settings: settings]',
{
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/organizationStats/usageStatsPerMin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function UsageStatsPerMin({dataCategory, organization, projectIds}: Props) {
};

// Metrics stats ingestion is delayed, so we can't show this for metrics right now
if (dataCategory === DATA_CATEGORY_INFO.metricSecond.plural) {
if (dataCategory === DATA_CATEGORY_INFO.metrics.plural) {
return null;
}

Expand Down