Skip to content

Commit 12e47d4

Browse files
authored
feat(ourlogs): Change period limits based on plan (#90778)
### Summary High visibility plans get longer periods for logs. Closes LOGS-75
1 parent 12fa100 commit 12e47d4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

static/app/views/explore/logs/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ function FeedbackButton() {
4444

4545
export default function LogsPage() {
4646
const organization = useOrganization();
47-
const {defaultPeriod, maxPickableDays, relativeOptions} = logsPickableDays();
47+
const {defaultPeriod, maxPickableDays, relativeOptions} =
48+
logsPickableDays(organization);
4849

4950
const prefersStackedNav = usePrefersStackedNav();
5051

static/app/views/explore/logs/utils.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as Sentry from '@sentry/react';
22

33
import {t} from 'sentry/locale';
44
import type {TagCollection} from 'sentry/types/group';
5+
import type {Organization} from 'sentry/types/organization';
56
import {defined} from 'sentry/utils';
67
import type {EventsMetaType} from 'sentry/utils/discover/eventView';
78
import {
@@ -190,14 +191,17 @@ export function adjustLogTraceID(traceID: string) {
190191
return traceID.replace(/-/g, '');
191192
}
192193

193-
export function logsPickableDays(): PickableDays {
194+
export function logsPickableDays(organization: Organization): PickableDays {
194195
const relativeOptions: Array<[string, React.ReactNode]> = [
195196
['1h', t('Last hour')],
196197
['24h', t('Last 24 hours')],
197198
['7d', t('Last 7 days')],
198-
['14d', t('Last 14 days')],
199199
];
200200

201+
if (organization.features.includes('visibility-explore-range-high')) {
202+
relativeOptions.push(['14d', t('Last 14 days')]);
203+
}
204+
201205
return {
202206
defaultPeriod: '24h',
203207
maxPickableDays: 14,

0 commit comments

Comments
 (0)