@ -17,6 +17,7 @@ import {
VariableValueSelectors ,
} from '@grafana/scenes' ;
import { SectionFooter } from '../insights/SectionFooter' ;
import { SectionSubheader } from '../insights/SectionSubheader' ;
import { getGrafanaInstancesByStateScene } from '../insights/grafana/AlertsByStateScene' ;
import { getGrafanaEvalSuccessVsFailuresScene } from '../insights/grafana/EvalSuccessVsFailuresScene' ;
@ -127,29 +128,29 @@ export function getInsightsScenes() {
) ;
}
if ( showMimirAlertmanager ) {
if ( showMimirManaged ) {
categories . push (
new SceneFlexItem ( {
ySizing : 'content' ,
body : getCloud Scenes ( ) ,
body : getMimirManagedRules Scenes ( ) ,
} )
) ;
}
if ( showMimirManaged ) {
if ( showMimirManagedPerGroup ) {
categories . push (
new SceneFlexItem ( {
ySizing : 'content' ,
body : getMimirManagedRulesScenes ( ) ,
body : getMimirManagedRulesPerGroup Scenes ( ) ,
} )
) ;
}
if ( showMimirManagedPerGroup ) {
if ( showMimirAlertmanager ) {
categories . push (
new SceneFlexItem ( {
ySizing : 'content' ,
body : getMimirManagedRulesPerGroup Scenes ( ) ,
body : getCloud Scenes ( ) ,
} )
) ;
}
@ -159,7 +160,7 @@ export function getInsightsScenes() {
controls : [
new SceneReactObject ( {
component : SectionSubheader ,
props : { children : < div > Monitor the status of your system . < / div > , datasources : [ ] } ,
props : { children : < div > Monitor the status of your system . < / div > } ,
} ) ,
new SceneControlsSpacer ( ) ,
new SceneTimePicker ( { } ) ,
@ -180,18 +181,12 @@ function getGrafanaManagedScenes() {
body : new SceneFlexLayout ( {
direction : 'column' ,
children : [
new SceneFlexItem ( {
body : new SceneReactObject ( {
component : SectionSubheader ,
props : { children : < div > Grafana - managed rules < / div > , datasources : [ ] } ,
} ) ,
} ) ,
new SceneFlexLayout ( {
direction : 'column' ,
children : [
new SceneFlexLayout ( {
children : [
getMostFiredInstancesScene ( ashDs , 'Top 10 firing instances this week ' ) ,
getMostFiredInstancesScene ( ashDs , 'Top 10 firing instances' ) ,
getFiringGrafanaAlertsScene ( cloudUsageDs , 'Firing rules' ) ,
getPausedGrafanaAlertsScene ( cloudUsageDs , 'Paused rules' ) ,
] ,
@ -206,14 +201,34 @@ function getGrafanaManagedScenes() {
new SceneFlexLayout ( {
height : '400px' ,
children : [
getInstanceStatByStatusScene ( cloudUsageDs , 'Alerting instances' , 'alerting' ) ,
getInstanceStatByStatusScene ( cloudUsageDs , 'Pending instances' , 'pending' ) ,
getInstanceStatByStatusScene (
cloudUsageDs ,
'Firing instances' ,
'The number of currently firing alert rule instances' ,
'alerting'
) ,
getInstanceStatByStatusScene (
cloudUsageDs ,
'Pending instances' ,
'The number of currently pending alert rule instances' ,
'pending'
) ,
] ,
} ) ,
new SceneFlexLayout ( {
children : [
getInstanceStatByStatusScene ( cloudUsageDs , 'No data instances' , 'nodata' ) ,
getInstanceStatByStatusScene ( cloudUsageDs , 'Error instances' , 'error' ) ,
getInstanceStatByStatusScene (
cloudUsageDs ,
'No data instances' ,
'The current number of alert rule instances in No data state' ,
'nodata'
) ,
getInstanceStatByStatusScene (
cloudUsageDs ,
'Error instances' ,
'The current number of alert rule instances in Error state' ,
'error'
) ,
] ,
} ) ,
] ,
@ -234,6 +249,9 @@ function getGrafanaManagedScenes() {
} ) ,
] ,
} ) ,
new SceneReactObject ( {
component : SectionFooter ,
} ) ,
] ,
} ) ,
} ) ;
@ -247,18 +265,15 @@ function getGrafanaAlertmanagerScenes() {
body : new SceneFlexLayout ( {
direction : 'column' ,
children : [
new SceneFlexItem ( {
body : new SceneReactObject ( {
component : SectionSubheader ,
props : { children : < div > Grafana Alertmanager < / div > , datasources : [ ] } ,
} ) ,
} ) ,
new SceneFlexLayout ( {
children : [
getGrafanaAlertmanagerNotificationsScene ( cloudUsageDs , 'Notifications ' ) ,
getGrafanaAlertmanagerNotificationsScene ( cloudUsageDs , 'Notification delivery' ) ,
getGrafanaAlertmanagerSilencesScene ( cloudUsageDs , 'Silences' ) ,
] ,
} ) ,
new SceneReactObject ( {
component : SectionFooter ,
} ) ,
] ,
} ) ,
} ) ;
@ -275,13 +290,13 @@ function getCloudScenes() {
new SceneFlexItem ( {
body : new SceneReactObject ( {
component : SectionSubheader ,
props : { children : < div > Mimir Alertmanager < / div > , datasources : [ cloudUsageDs ] } ,
props : { datasources : [ cloudUsageDs ] } ,
} ) ,
} ) ,
new SceneFlexLayout ( {
children : [
getAlertsByStateScene ( cloudUsageDs , 'A lerts by state' ) ,
getNotificationsScene ( cloudUsageDs , 'Notifications ' ) ,
getAlertsByStateScene ( cloudUsageDs , 'Firing a lerts by state' ) ,
getNotificationsScene ( cloudUsageDs , 'Notification delivery ' ) ,
] ,
} ) ,
new SceneFlexLayout ( {
@ -290,6 +305,9 @@ function getCloudScenes() {
getInvalidConfigScene ( cloudUsageDs , 'Invalid configuration' ) ,
] ,
} ) ,
new SceneReactObject ( {
component : SectionFooter ,
} ) ,
] ,
} ) ,
} ) ;
@ -306,28 +324,31 @@ function getMimirManagedRulesScenes() {
new SceneFlexItem ( {
body : new SceneReactObject ( {
component : SectionSubheader ,
props : { children : < div > Mimir - managed rules < / div > , datasources : [ grafanaCloudPromDs , cloudUsageDs ] } ,
props : { datasources : [ grafanaCloudPromDs , cloudUsageDs ] } ,
} ) ,
} ) ,
new SceneFlexLayout ( {
children : [
getMostFiredRulesScene ( grafanaCloudPromDs , 'Top 10 firing rules this week ' ) ,
getMostFiredRulesScene ( grafanaCloudPromDs , 'Top 10 firing rules' ) ,
getFiringCloudAlertsScene ( grafanaCloudPromDs , 'Firing instances' ) ,
getPendingCloudAlertsScene ( grafanaCloudPromDs , 'Pending instances' ) ,
] ,
} ) ,
new SceneFlexLayout ( {
children : [
getInstancesByStateScene ( grafanaCloudPromDs , 'Count of alert instances by state ' ) ,
getInstancesPercentageByStateScene ( grafanaCloudPromDs , '% of alert instances by S tate' ) ,
getInstancesByStateScene ( grafanaCloudPromDs , 'Firing and pending alert instances ' ) ,
getInstancesPercentageByStateScene ( grafanaCloudPromDs , '% of alert instances by s tate' ) ,
] ,
} ) ,
new SceneFlexLayout ( {
children : [
getEvalSuccessVsFailuresScene ( cloudUsageDs , 'Evaluation success vs failures' ) ,
getMissedIterationsScene ( cloudUsageDs , 'Iterations missed ' ) ,
getMissedIterationsScene ( cloudUsageDs , 'Missed evaluations ' ) ,
] ,
} ) ,
new SceneReactObject ( {
component : SectionFooter ,
} ) ,
] ,
} ) ,
} ) ;
@ -351,7 +372,7 @@ function getMimirManagedRulesPerGroupScenes() {
new SceneFlexItem ( {
body : new SceneReactObject ( {
component : SectionSubheader ,
props : { children : < div > Mimir - managed Rules - Per Rule Group < / div > , datasources : [ cloudUsageDs ] } ,
props : { datasources : [ cloudUsageDs ] } ,
} ) ,
} ) ,
new SceneFlexLayout ( {
@ -367,6 +388,9 @@ function getMimirManagedRulesPerGroupScenes() {
getRuleGroupEvaluationDurationIntervalRatioScene ( cloudUsageDs , 'Evaluation duration / interval ratio' ) ,
] ,
} ) ,
new SceneReactObject ( {
component : SectionFooter ,
} ) ,
] ,
} ) ,
$variables : new SceneVariableSet ( {