Skip to content

Commit bbf7629

Browse files
authored
chore(logs): Add feature badge, update copy (#95683)
Updates the feature flag to also consider `ourlogs-enabled`
1 parent a7204f9 commit bbf7629

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed

static/app/views/alerts/rules/metric/ruleForm.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ describe('Incident Rules Form', () => {
437437
'performance-view',
438438
'visibility-explore-view',
439439
'ourlogs-alerts',
440+
'ourlogs-enabled',
440441
];
441442
const rule = MetricRuleFixture();
442443
createWrapper({

static/app/views/alerts/wizard/index.spec.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ describe('AlertWizard', () => {
222222
'performance-view',
223223
'visibility-explore-view',
224224
'ourlogs-alerts',
225+
'ourlogs-enabled',
225226
],
226227
access: ['org:write', 'alerts:write'],
227228
},

static/app/views/alerts/wizard/options.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export const AlertWizardAlertNames: Record<AlertType, string> = {
120120
*/
121121
export const AlertWizardExtraContent: Partial<Record<AlertType, React.ReactNode>> = {
122122
uptime_monitor: <FeatureBadge type="new" />,
123+
trace_item_logs: <FeatureBadge type="beta" />,
123124
};
124125

125126
type AlertWizardCategory = {

static/app/views/alerts/wizard/panelContent.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,10 @@ export const AlertWizardPanelContent: Record<AlertType, PanelContent> = {
242242
illustration: diagramCLS,
243243
},
244244
trace_item_logs: {
245-
description: t('Alert on logs.'),
246-
examples: [t('When the number of logs exceeds 100.')],
245+
description: t(
246+
'Alert on logs counts and log attributes such as severity, message and log level.'
247+
),
248+
examples: [t('When the number of error level logs exceeds 10 in 5 minutes.')],
247249
illustration: diagramThroughput,
248250
},
249251
};

static/app/views/alerts/wizard/utils.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ export function getAlertTypeFromAggregateDataset({
9595
}
9696

9797
export function hasLogAlerts(organization: Organization): boolean {
98-
return organization.features.includes('ourlogs-alerts');
98+
return (
99+
organization.features.includes('ourlogs-alerts') &&
100+
organization.features.includes('ourlogs-enabled')
101+
);
99102
}
100103

101104
export function getTraceItemTypeForDatasetAndEventType(

static/app/views/detectors/components/forms/metric/metric.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
AlertRuleSensitivity,
2626
AlertRuleThresholdType,
2727
} from 'sentry/views/alerts/rules/metric/types';
28+
import {hasLogAlerts} from 'sentry/views/alerts/wizard/utils';
2829
import {AssigneeField} from 'sentry/views/detectors/components/forms/assigneeField';
2930
import {AutomateSection} from 'sentry/views/detectors/components/forms/automateSection';
3031
import {EditDetectorLayout} from 'sentry/views/detectors/components/forms/editDetectorLayout';
@@ -193,7 +194,7 @@ function useDatasetChoices() {
193194
...(organization.features.includes('visibility-explore-view')
194195
? [{value: DetectorDataset.SPANS, label: t('Spans')}]
195196
: []),
196-
...(organization.features.includes('ourlogs-alerts')
197+
...(hasLogAlerts(organization)
197198
? [
198199
{
199200
value: DetectorDataset.LOGS,

0 commit comments

Comments
 (0)