mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Fix firing alerts title when showing active in Insights panel (#80414)
* Fix firing alerts title when showing active alerts in Insights panel * Update red to green and change the component name to Active.tsx instead of Firing.tsx
This commit is contained in:
parent
cb419e799b
commit
4ea997b595
@ -20,9 +20,9 @@ import {
|
||||
import { config } from '../../../../core/config';
|
||||
import { SectionFooter } from '../insights/SectionFooter';
|
||||
import { SectionSubheader } from '../insights/SectionSubheader';
|
||||
import { getActiveGrafanaAlertsScene } from '../insights/grafana/Active';
|
||||
import { getGrafanaInstancesByStateScene } from '../insights/grafana/AlertsByStateScene';
|
||||
import { getGrafanaEvalSuccessVsFailuresScene } from '../insights/grafana/EvalSuccessVsFailuresScene';
|
||||
import { getFiringGrafanaAlertsScene } from '../insights/grafana/Firing';
|
||||
import { getInstanceStatByStatusScene } from '../insights/grafana/InstanceStatusScene';
|
||||
import { getGrafanaMissedIterationsScene } from '../insights/grafana/MissedIterationsScene';
|
||||
import { getMostFiredInstancesScene } from '../insights/grafana/MostFiredInstancesTable';
|
||||
@ -192,7 +192,7 @@ function getGrafanaManagedScenes() {
|
||||
new SceneFlexLayout({
|
||||
children: [
|
||||
getMostFiredInstancesScene(ashDs, 'Top 10 firing instances'),
|
||||
getFiringGrafanaAlertsScene(cloudUsageDs, 'Firing rules'),
|
||||
getActiveGrafanaAlertsScene(cloudUsageDs, 'Active rules'),
|
||||
getPausedGrafanaAlertsScene(cloudUsageDs, 'Paused rules'),
|
||||
],
|
||||
}),
|
||||
|
@ -7,7 +7,7 @@ import { DataSourceRef } from '@grafana/schema';
|
||||
import { INSTANCE_ID, PANEL_STYLES } from '../../home/Insights';
|
||||
import { InsightsRatingModal } from '../RatingModal';
|
||||
|
||||
export function getFiringGrafanaAlertsScene(datasource: DataSourceRef, panelTitle: string) {
|
||||
export function getActiveGrafanaAlertsScene(datasource: DataSourceRef, panelTitle: string) {
|
||||
const expr = INSTANCE_ID
|
||||
? `sum by (state) (grafanacloud_grafana_instance_alerting_rule_group_rules{state="active", id="${INSTANCE_ID}"})`
|
||||
: `sum by (state) (grafanacloud_grafana_instance_alerting_rule_group_rules{state="active"})`;
|
||||
@ -27,17 +27,17 @@ export function getFiringGrafanaAlertsScene(datasource: DataSourceRef, panelTitl
|
||||
...PANEL_STYLES,
|
||||
body: PanelBuilders.stat()
|
||||
.setTitle(panelTitle)
|
||||
.setDescription('The number of currently firing alert rules')
|
||||
.setDescription('The number of currently active alert rules')
|
||||
.setData(query)
|
||||
.setThresholds({
|
||||
mode: ThresholdsMode.Absolute,
|
||||
steps: [
|
||||
{
|
||||
color: 'red',
|
||||
color: 'green',
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
color: 'red',
|
||||
color: 'green',
|
||||
value: 80,
|
||||
},
|
||||
],
|
Loading…
Reference in New Issue
Block a user