Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(revenue): Add back metrics for stats page #70695

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix(revenue): Add back metrics for stats page
instead of using metric hours, use metrics. The stats page and billing will likely not line up here
  • Loading branch information
scttcper committed May 10, 2024
commit 14cb9f2f9f68adc27a30766fe6f5a4d85be7f1e5
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
4 changes: 4 additions & 0 deletions static/app/types/core.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ export enum DataCategoryExact {
MONITOR_SEAT = 'monitorSeat',
PROFILE_DURATION = 'profileDuration',
SPAN = 'span',
/**
* Metrics does not actually exist, placeholder until metricSecond is implemented
*/
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
Loading