Alerting UI: Update help button and descriptions for recording rules (#96047)
* Hide `Instances` field in RuleDetails view for recording rules * Alerting UI: add `helpLink` to Recording Rules docs * Make the Metric input placeholder more explicit for recording rules
This commit is contained in:
@@ -72,7 +72,7 @@ export const AlertRuleNameAndMetric = () => {
|
||||
pattern: recordingRuleNameValidationPattern(RuleFormType.grafanaRecording),
|
||||
})}
|
||||
aria-label="metric"
|
||||
placeholder={`Give your metric a name`}
|
||||
placeholder={`Give the name of the new recorded metric`}
|
||||
/>
|
||||
</Field>
|
||||
)}
|
||||
|
||||
+2
-2
@@ -13,14 +13,14 @@ export const DESCRIPTIONS: Record<RuleFormType, FormDescriptions> = {
|
||||
helpLabel: 'Define your recording rule',
|
||||
helpContent:
|
||||
'Pre-compute frequently needed or computationally expensive expressions and save their result as a new set of time series.',
|
||||
helpLink: '',
|
||||
helpLink: 'https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-recording-rules/',
|
||||
},
|
||||
[RuleFormType.grafanaRecording]: {
|
||||
sectionTitle: 'Define recording rule',
|
||||
helpLabel: 'Define your recording rule',
|
||||
helpContent:
|
||||
'Pre-compute frequently needed or computationally expensive expressions and save their result as a new set of time series.',
|
||||
helpLink: '',
|
||||
helpLink: 'https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-recording-rules/',
|
||||
},
|
||||
[RuleFormType.grafana]: {
|
||||
sectionTitle: 'Define query and alert condition',
|
||||
|
||||
@@ -7,7 +7,7 @@ import { CombinedRule } from 'app/types/unified-alerting';
|
||||
|
||||
import { usePendingPeriod } from '../../hooks/rules/usePendingPeriod';
|
||||
import { useCleanAnnotations } from '../../utils/annotations';
|
||||
import { isGrafanaRecordingRule } from '../../utils/rules';
|
||||
import { isGrafanaRecordingRule, isRecordingRule, isRecordingRulerRule } from '../../utils/rules';
|
||||
import { isNullDate } from '../../utils/time';
|
||||
import { AlertLabels } from '../AlertLabels';
|
||||
import { DetailsField } from '../DetailsField';
|
||||
@@ -53,9 +53,15 @@ export const RuleDetails = ({ rule }: Props) => {
|
||||
<RuleDetailsDataSources rulesSource={rulesSource} rule={rule} />
|
||||
</div>
|
||||
</div>
|
||||
<DetailsField label="Instances" horizontal={true}>
|
||||
<RuleDetailsMatchingInstances rule={rule} itemsDisplayLimit={INSTANCES_DISPLAY_LIMIT} />
|
||||
</DetailsField>
|
||||
{!(
|
||||
isRecordingRulerRule(rule.rulerRule) ||
|
||||
isRecordingRule(rule.promRule) ||
|
||||
isGrafanaRecordingRule(rule.rulerRule)
|
||||
) && (
|
||||
<DetailsField label="Instances" horizontal={true}>
|
||||
<RuleDetailsMatchingInstances rule={rule} itemsDisplayLimit={INSTANCES_DISPLAY_LIMIT} />
|
||||
</DetailsField>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user