"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[6034],{25982:(Ve,M,u)=>{u.r(M),u.d(M,{default:()=>Ye,getHomeApp:()=>$});var r=u(39953),W=u(32688),e=u(74502),G=u(63011),L=u(48474),T=u(76716),l=u(41407),k=u(66883),X=u(27366),p=u(82803),N=u(12190);const H=()=>new e.U4({body:new e.QY({children:[new e.fy({body:new e.he({component:Q})})]})});function Q({showWelcomeHeader:n}){const t=(0,p.l4)(),a=(0,p.wW)(Y);return r.createElement("div",{className:a.grid},n&&r.createElement(D,{className:a.ctaContainer}),r.createElement(C,{className:a.flowBlock},r.createElement("div",null,r.createElement("h3",null,"How it works"),r.createElement("ul",{className:a.list},r.createElement("li",null,"Grafana alerting periodically queries data sources and evaluates the condition defined in the alert rule"),r.createElement("li",null,"If the condition is breached, an alert instance fires"),r.createElement("li",null,"Firing instances are routed to notification policies based on matching labels"),r.createElement("li",null,"Notifications are sent out to the contact points specified in the notification policy"))),r.createElement(k.default,{src:`public/img/alerting/at_a_glance_${t.name.toLowerCase()}.svg`,width:void 0,height:void 0})),r.createElement(C,{className:a.gettingStartedBlock},r.createElement("h3",null,"Get started"),r.createElement(X.K,{direction:"column",alignItems:"space-between"},r.createElement("ul",{className:a.list},r.createElement("li",null,r.createElement("strong",null,"Create an alert rule")," by adding queries and expressions from multiple data sources."),r.createElement("li",null,r.createElement("strong",null,"Add labels")," to your alert rules ",r.createElement("strong",null,"to connect them to notification policies")),r.createElement("li",null,r.createElement("strong",null,"Configure contact points")," to define where to send your notifications to."),r.createElement("li",null,r.createElement("strong",null,"Configure notification policies")," to route your alert instances to contact points.")),r.createElement("div",null,r.createElement(z,{href:"https://grafana.com/docs/grafana/latest/alerting/",title:"Read more in the Docs"})))),r.createElement(C,{className:a.videoBlock},r.createElement("iframe",{title:"Alerting - Introductory video",src:"https://player.vimeo.com/video/720001629?h=c6c1732f92",width:"960",height:"540",allow:"autoplay; fullscreen",allowFullScreen:!0,frameBorder:"0",style:{colorScheme:"light dark"}})))}const Y=n=>({grid:(0,l.css)`
    display: grid;
    grid-template-rows: min-content auto auto;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: ${n.spacing(2)};
  `,ctaContainer:(0,l.css)`
    grid-column: 1 / span 5;
  `,flowBlock:(0,l.css)`
    grid-column: 1 / span 5;

    display: flex;
    flex-wrap: wrap;
    gap: ${n.spacing(1)};

    & > div {
      flex: 2;
      min-width: 350px;
    }
    & > svg {
      flex: 3;
      min-width: 500px;
    }
  `,videoBlock:(0,l.css)`
    grid-column: 3 / span 3;

    // Video required
    position: relative;
    padding: 56.25% 0 0 0; /* 16:9 */

    iframe {
      position: absolute;
      top: ${n.spacing(2)};
      left: ${n.spacing(2)};
      width: calc(100% - ${n.spacing(4)});
      height: calc(100% - ${n.spacing(4)});
      border: none;
    }
  `,gettingStartedBlock:(0,l.css)`
    grid-column: 1 / span 2;
    justify-content: space-between;
  `,list:(0,l.css)`
    margin: ${n.spacing(0,2)};
    & > li {
      margin-bottom: ${n.spacing(1)};
    }
  `});function D({className:n}){const t=(0,p.wW)(P);return r.createElement("div",{className:t.welcomeHeaderWrapper},r.createElement("div",{className:t.subtitle},"Learn about problems in your systems moments after they occur"),r.createElement(C,{className:(0,l.cx)(t.ctaContainer,n)},r.createElement(I,{title:"Alert rules",description:"Define the condition that must be met before an alert rule fires",href:"/alerting/list",hrefText:"Manage alert rules"}),r.createElement("div",{className:t.separator}),r.createElement(I,{title:"Contact points",description:"Configure who receives notifications and how they are sent",href:"/alerting/notifications",hrefText:"Manage contact points"}),r.createElement("div",{className:t.separator}),r.createElement(I,{title:"Notification policies",description:"Configure how firing alert instances are routed to contact points",href:"/alerting/routes",hrefText:"Manage notification policies"})))}const P=n=>({welcomeHeaderWrapper:(0,l.css)({color:n.colors.text.primary}),subtitle:(0,l.css)({color:n.colors.text.secondary,paddingBottom:n.spacing(2)}),ctaContainer:(0,l.css)`
    padding: ${n.spacing(4,2)};
    display: flex;
    gap: ${n.spacing(4)};
    justify-content: space-between;
    flex-wrap: wrap;

    ${n.breakpoints.down("lg")} {
      flex-direction: column;
    }
  `,separator:(0,l.css)`
    width: 1px;
    background-color: ${n.colors.border.medium};

    ${n.breakpoints.down("lg")} {
      display: none;
    }
  `});function I({title:n,description:t,href:a,hrefText:s}){const m=(0,p.wW)(U);return r.createElement("div",{className:m.container},r.createElement("h3",{className:m.title},n),r.createElement("div",{className:m.desc},t),r.createElement("div",{className:m.actionRow},r.createElement("a",{href:a,className:m.link},s)))}const U=n=>({container:(0,l.css)`
    flex: 1;
    min-width: 240px;
    display: grid;
    gap: ${n.spacing(1)};
    grid-template-columns: min-content 1fr 1fr 1fr;
    grid-template-rows: min-content auto min-content;
  `,title:(0,l.css)`
    margin-bottom: 0;
    grid-column: 2 / span 3;
    grid-row: 1;
  `,desc:(0,l.css)`
    grid-column: 2 / span 3;
    grid-row: 2;
  `,actionRow:(0,l.css)`
    grid-column: 2 / span 3;
    grid-row: 3;
    max-width: 240px;
  `,link:(0,l.css)`
    color: ${n.colors.text.link};
  `});function C({children:n,className:t}){const a=(0,p.wW)(V);return r.createElement("div",{className:(0,l.cx)(a.box,t)},n)}const V=n=>({box:(0,l.css)`
    padding: ${n.spacing(2)};
    background-color: ${n.colors.background.secondary};
    border-radius: ${n.shape.radius.default};
  `});function z({href:n,title:t}){const a=(0,p.wW)(j);return r.createElement("a",{href:n,className:a.link,rel:"noreferrer"},t," ",r.createElement(N.J,{name:"angle-right",size:"xl"}))}const j=n=>({link:(0,l.css)`
    display: block;
    color: ${n.colors.text.link};
  `});var J=u(26205);function E({children:n}){const t=(0,p.wW)(K);return r.createElement("div",{className:t.sectionFooter},n&&r.createElement("div",null,n))}const K=n=>({sectionFooter:(0,l.css)({marginBottom:n.spacing(2)})});function Z({datasources:n}){const t=(0,p.wW)(ee),a=n.map(s=>r.createElement("div",{key:s.uid},s.settings?.meta.info.logos.small&&r.createElement("img",{className:t.dsImage,src:s.settings?.meta.info.logos.small,alt:s.settings?.name||s.uid}),r.createElement("span",null,s.settings?.name||s.uid)));return r.createElement("div",{className:t.dsContainer},a)}const ee=n=>({dsImage:(0,l.css)({label:"ds-image",width:"16px",marginRight:"3px"}),dsContainer:(0,l.css)({display:"flex",flexDirection:"row",fontSize:n.typography.bodySmall.fontSize,gap:"10px",marginBottom:"10px",justifyContent:"flex-end"})});function x({children:n,datasources:t}){const a=(0,p.wW)(te);return r.createElement("div",{className:a.container},n,t&&r.createElement(Z,{datasources:t}))}const te=n=>({container:(0,l.css)({display:"flex",flexDirection:"row",justifyContent:"space-between"})});var i=u(34547),ne=u(73075),B=u(4919),O=u(13767),re=u(58047),ae=u(68497),se=u(79517);function c({panel:n}){const t=(0,p.wW)(ie),[a,s]=(0,r.useState)(!1),m=()=>{s(!1)},h=f=>{(0,se.Ej)({useful:f,panel:n}),m()},w=r.createElement(ne.u,{title:"Rate this panel",isOpen:a,onDismiss:m,onClickBackdrop:m,className:t.container},r.createElement("div",null,r.createElement("p",null,"Help us improve this page by telling us whether this panel is useful to you!"),r.createElement("div",{className:t.buttonsContainer},r.createElement(B.zx,{variant:"secondary",className:t.buttonContainer,onClick:()=>h(!1)},r.createElement("div",{className:t.button},r.createElement(N.J,{name:"thumbs-up",className:t.thumbsdown,size:"xxxl"}),r.createElement("span",null,"I don't like it"))),r.createElement(B.zx,{variant:"secondary",className:t.buttonContainer,onClick:()=>h(!0)},r.createElement("div",{className:t.button},r.createElement(N.J,{name:"thumbs-up",size:"xxxl"}),r.createElement("span",null,"I like it")))))),y=r.createElement(O.v,null,r.createElement(O.v.Item,{label:"Rate this panel",icon:"comment-alt-message",onClick:()=>s(!0)}));return r.createElement("div",null,r.createElement(re.L,{overlay:y,placement:"bottom-start"},r.createElement(ae.h,{name:"ellipsis-v",variant:"secondary",className:t.menu,"aria-label":"Rate this panel"})),w)}const ie=n=>({buttonsContainer:(0,l.css)({display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"stretch",gap:"25px"}),buttonContainer:(0,l.css)({height:"150px",width:"150px",cursor:"pointer",justifyContent:"center"}),button:(0,l.css)({display:"flex",flexDirection:"column"}),container:(0,l.css)({maxWidth:"370px"}),menu:(0,l.css)({height:"25px",margin:"0"}),thumbsdown:(0,l.css)({transform:"scale(-1, -1);"})});function oe(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by (state) (grafanacloud_grafana_instance_alerting_alerts)",range:!0,legendFormat:"{{state}}"}]}),s=new e.bM({$data:a,transformations:[{id:"renameByRegex",options:{regex:"alerting",renamePattern:"firing"}}]});return new e.fy({...d,height:"400px",body:e.wX.timeseries().setTitle(t).setDescription("A breakdown of all of your alert rule instances based on state").setData(s).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setOverrides(m=>m.matchFieldsWithName("firing").overrideColor(g("firing")).matchFieldsWithName("normal").overrideColor(g("normal")).matchFieldsWithName("pending").overrideColor(g("pending")).matchFieldsWithName("error").overrideColor(g("error")).matchFieldsWithName("nodata").overrideColor(g("nodata"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}function le(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum(grafanacloud_grafana_instance_alerting_rule_evaluations_total:rate5m) - sum(grafanacloud_grafana_instance_alerting_rule_evaluation_failures_total:rate5m)",range:!0,legendFormat:"success"},{refId:"B",expr:"sum(grafanacloud_grafana_instance_alerting_rule_evaluation_failures_total:rate5m)",range:!0,legendFormat:"failed"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("The number of successful and failed alert rule evaluations").setData(a).setOption("tooltip",{mode:i.f3.Multi}).setCustomFieldConfig("drawStyle",i.l8.Line).setOverrides(s=>s.matchFieldsWithName("success").overrideColor(g("success")).matchFieldsWithName("failed").overrideColor(g("failed"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}var A=u(60695);function ce(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",instant:!0,expr:'sum by (state) (grafanacloud_grafana_instance_alerting_rule_group_rules{state="active"})'}]});return new e.fy({...d,body:e.wX.stat().setTitle(t).setDescription("The number of currently firing alert rules").setData(a).setThresholds({mode:A.H.Absolute,steps:[{color:"red",value:0},{color:"red",value:80}]}).setNoValue("0").setHeaderActions(r.createElement(c,{panel:t})).build()})}function F(n,t,a,s){const m=new e.uq({datasource:n,queries:[{refId:"A",instant:!0,expr:`sum by (state) (grafanacloud_grafana_instance_alerting_alerts{state="${s}"})`,legendFormat:"{{state}}"}]});return new e.fy({height:"100%",body:e.wX.stat().setTitle(t).setDescription(a).setData(m).setOverrides(h=>h.matchFieldsWithName(s).overrideColor(g(s))).setNoValue("0").setHeaderActions(r.createElement(c,{panel:t})).build()})}var R=u(71476);function ue(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by (rule_group) (grafanacloud_instance_rule_group_iterations_missed_total:rate5m)",range:!0,legendFormat:"{{rule_group}}"}]}),s=()=>h=>h.pipe((0,R.U)(w=>w.map(y=>({...y,fields:y.fields.map(f=>{const _=(f.config.displayNameFromDS||"").match(/\/rules\/\d+\/(\w+);(\w+)/);return _&&(f.config.displayName=`Folder: ${_[1]} - Group: ${_[2]}`),f})})))),m=new e.bM({$data:a,transformations:[s]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("The number of missed iterations per evaluation group").setData(m).setOption("tooltip",{mode:i.f3.Multi}).setCustomFieldConfig("drawStyle",i.l8.Line).setHeaderActions(r.createElement(c,{panel:t})).build()})}var de=u(18950),me=u(24597);function ge(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:'topk(10, sum by(labels_alertname, ruleUID) (count_over_time({from="state-history"} | json | current = `Alerting` [1w])))',instant:!0}]}),s=(w,y)=>({...w,values:w.values.map((f,b)=>{const Pe=y.fields.find(Ue=>Ue.name==="ruleUID")?.values[b];return r.createElement(fe,{key:f,value:f,ruleUID:Pe})})}),m=()=>w=>w.pipe((0,R.U)(y=>y.map(f=>({...f,fields:f.fields.map(b=>b.name==="labels_alertname"?s(b,f):b)})))),h=new e.bM({$data:a,transformations:[m,{id:"sortBy",options:{fields:{},sort:[{field:"Value #A",desc:!0}]}},{id:"organize",options:{excludeByName:{Time:!0,ruleUID:!0},indexByName:{labels_alertname:0,"Value #A":1},renameByName:{labels_alertname:"Alert rule name","Value #A":"Number of fires"}}}]});return new e.fy({...d,body:e.wX.table().setTitle(t).setDescription("The alert rule instances that have fired the most").setData(h).setNoValue("No new alerts fired last week").setHeaderActions(r.createElement(c,{panel:t})).build()})}function fe({value:n,ruleUID:t}){const a=m=>({link:(0,l.css)({"& > a":{color:m.colors.text.link}})}),s=(0,p.wW)(a);return r.createElement("div",{className:s.link},r.createElement(de.r,{target:"_blank",href:(0,me.u)(`/alerting/grafana/${t}/view`)},n))}function pe(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",instant:!0,expr:'sum by (state) (grafanacloud_grafana_instance_alerting_rule_group_rules{state="paused"})'}]});return new e.fy({...d,body:e.wX.stat().setTitle(t).setDescription("The number of current paused alert rules").setData(a).setThresholds({mode:A.H.Absolute,steps:[{color:"yellow",value:0},{color:"red",value:80}]}).setNoValue("0").setHeaderActions(r.createElement(c,{panel:t})).build()})}function ye(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by (state) (grafanacloud_grafana_instance_alerting_rule_group_rules)",range:!0,legendFormat:"{{state}} evaluation"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("See how many of your alert rules are paused or active").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setOverrides(s=>s.matchFieldsWithName("active evaluation").overrideColor(g("active evaluation"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}function he(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by (state) (grafanacloud_grafana_instance_alerting_rule_group_rules) / ignoring(state) group_left sum(grafanacloud_grafana_instance_alerting_rule_group_rules)",range:!0,legendFormat:"{{state}} evaluation"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("See what percentage of your alert rules are paused or active").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setCustomFieldConfig("fillOpacity",45).setUnit("percentunit").setOption("tooltip",{mode:i.f3.Multi}).setMax(1).setOverrides(s=>s.matchFieldsWithName("active evaluation").overrideColor(g("active evaluation"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}function we(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by (state) (grafanacloud_grafana_instance_alerting_alertmanager_alerts)",range:!0,legendFormat:"{{state}}"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("A breakdown of all of your firing alert rule instances based on state").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setOverrides(s=>s.matchFieldsWithName("active").overrideColor(g("active"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}function ve(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by (state) (grafanacloud_grafana_instance_alerting_silences)",range:!0,legendFormat:"{{state}}"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("The number of silences by state").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setHeaderActions(r.createElement(c,{panel:t})).build()})}function be(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by (state) (grafanacloud_instance_alertmanager_alerts)",range:!0,legendFormat:"{{state}}"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("A breakdown of all of your firing alert rule instances based on state").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setOverrides(s=>s.matchFieldsWithName("active").overrideColor(g("active"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}function Ee(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by (cluster)(grafanacloud_instance_alertmanager_invalid_config)",range:!0,legendFormat:"{{cluster}}"}]});return new e.fy({...d,body:e.wX.stat().setTitle(t).setDescription("The current state of your alertmanager configuration").setData(a).setUnit("bool_yes_no").setOption("graphMode",i.IG.None).setHeaderActions(r.createElement(c,{panel:t})).build()})}function Se(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by(cluster)(grafanacloud_instance_alertmanager_notifications_per_second) - sum by (cluster)(grafanacloud_instance_alertmanager_notifications_failed_per_second)",range:!0,legendFormat:"success"},{refId:"B",expr:"sum by(cluster)(grafanacloud_instance_alertmanager_notifications_failed_per_second)",range:!0,legendFormat:"failed"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("The number of successful and failed notifications").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setOverrides(s=>s.matchFieldsWithName("success").overrideColor(g("success")).matchFieldsWithName("failed").overrideColor(g("failed"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}function Ce(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by (state) (grafanacloud_instance_alertmanager_silences)",range:!0,legendFormat:"{{state}}"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("The number of silences by state").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setHeaderActions(r.createElement(c,{panel:t})).build()})}var xe=u(41406);function Ae(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:'grafanacloud_instance_rule_group_last_duration_seconds{rule_group="$rule_group"} / grafanacloud_instance_rule_group_interval_seconds{rule_group="$rule_group"}',range:!0,legendFormat:"duration / interval"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("The percentage of interval time spent evaluating").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setOption("legend",{showLegend:!1}).setUnit("percentunit").setThresholds({mode:xe.H3.Percentage,steps:[{color:"green",value:0},{color:"red",value:80},{color:"yellow",value:60}]}).setHeaderActions(r.createElement(c,{panel:t})).build()})}function Fe(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:'grafanacloud_instance_rule_group_last_duration_seconds{rule_group="$rule_group"}',range:!0,legendFormat:"{{rule_group}}"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("How long it took to evaluate the rule group").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setUnit("s").setOption("tooltip",{mode:i.f3.Multi}).setOption("legend",{showLegend:!1}).setOverrides(s=>s.matchFieldsByQuery("A").overrideColor({mode:"fixed",fixedColor:"blue"})).setHeaderActions(r.createElement(c,{panel:t})).build()})}function _e(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:'grafanacloud_instance_rule_evaluations_total:rate5m{rule_group="$rule_group"} - grafanacloud_instance_rule_evaluation_failures_total:rate5m{rule_group=~"$rule_group"}',range:!0,legendFormat:"success"},{refId:"B",expr:'grafanacloud_instance_rule_evaluation_failures_total:rate5m{rule_group=~"$rule_group"}',range:!0,legendFormat:"failed"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("The number of successful and failed evaluations for the rule group").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setOverrides(s=>s.matchFieldsWithName("success").overrideColor(g("success")).matchFieldsWithName("failed").overrideColor(g("failed"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}function Ne(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:'grafanacloud_instance_rule_group_interval_seconds{rule_group="$rule_group"}',range:!0,legendFormat:"interval"}]});return new e.fy({...d,body:e.wX.stat().setTitle(t).setDescription("The current and historical rule group evaluation interval").setData(a).setUnit("s").setOption("graphMode",i.IG.Area).setHeaderActions(r.createElement(c,{panel:t})).build()})}function De(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:'sum(grafanacloud_instance_rule_group_rules{rule_group="$rule_group"})',range:!0,legendFormat:"number of rules"}]});return new e.fy({...d,body:e.wX.stat().setTitle(t).setDescription("The current and historical number of alert rules in the rule group").setData(a).setUnit("none").setOption("graphMode",i.IG.Area).setOverrides(s=>s.matchFieldsByQuery("A").overrideColor({mode:"fixed",fixedColor:"blue"})).setNoValue("0").setHeaderActions(r.createElement(c,{panel:t})).build()})}function Ie(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum(grafanacloud_instance_rule_evaluations_total:rate5m) - sum(grafanacloud_instance_rule_evaluation_failures_total:rate5m)",range:!0,legendFormat:"success"},{refId:"B",expr:"sum(grafanacloud_instance_rule_evaluation_failures_total:rate5m)",range:!0,legendFormat:"failed"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("The number of successful and failed alert rule evaluations").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setOverrides(s=>s.matchFieldsWithName("failed").overrideColor(g("failed"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}function qe(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",instant:!0,expr:'sum by (alertstate) (ALERTS{alertstate="firing"})'}]});return new e.fy({...d,body:e.wX.stat().setTitle(t).setDescription("The number of currently firing alert rule instances").setData(a).setThresholds({mode:A.H.Absolute,steps:[{color:"red",value:0},{color:"red",value:80}]}).setNoValue("0").setHeaderActions(r.createElement(c,{panel:t})).build()})}function Me(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by (alertstate) (ALERTS)",range:!0,legendFormat:"{{state}}"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("The number of firing and pending alert rule instances").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setOverrides(s=>s.matchFieldsWithName("firing").overrideColor(g("firing"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}function Te(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum by (alertstate) (ALERTS) / ignoring(alertstate) group_left sum(ALERTS)",range:!0,legendFormat:"{{alertstate}}"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("See what percentage of your alert rules are firing versus pending").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setCustomFieldConfig("fillOpacity",45).setUnit("percentunit").setMax(1).setOption("tooltip",{mode:i.f3.Multi}).setOverrides(s=>s.matchFieldsWithName("firing").overrideColor(g("firing"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}function He(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:"sum(grafanacloud_instance_rule_group_iterations_missed_total:rate5m)",range:!0,legendFormat:"missed"}]});return new e.fy({...d,body:e.wX.timeseries().setTitle(t).setDescription("The number of evaluations missed").setData(a).setCustomFieldConfig("drawStyle",i.l8.Line).setOption("tooltip",{mode:i.f3.Multi}).setOption("legend",{showLegend:!1}).setOverrides(s=>s.matchFieldsWithName("missed").overrideColor(g("missed"))).setHeaderActions(r.createElement(c,{panel:t})).build()})}function Be(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",expr:'topk(10, sum by(alertname) (ALERTS{alertstate="firing"}))',instant:!0,range:!1,format:"table"}]}),s=new e.bM({$data:a,transformations:[{id:"organize",options:{excludeByName:{Time:!0},indexByName:{},renameByName:{Value:"Number of fires",alertname:"Alert Rule Name"}}}]});return new e.fy({...d,body:e.wX.table().setTitle(t).setDescription("The alert rules that have fired the most").setData(s).setHeaderActions(r.createElement(c,{panel:t})).build()})}function Oe(n,t){const a=new e.uq({datasource:n,queries:[{refId:"A",instant:!0,expr:'sum by (alertstate) (ALERTS{alertstate="pending"})'}]});return new e.fy({...d,body:e.wX.stat().setTitle(t).setDescription("The number of currently pending alert rule instances").setData(a).setThresholds({mode:A.H.Absolute,steps:[{color:"yellow",value:0},{color:"red",value:80}]}).setNoValue("0").setHeaderActions(r.createElement(c,{panel:t})).build()})}const q={type:"loki",uid:"grafanacloud-alert-state-history",settings:void 0},o={type:"prometheus",uid:"grafanacloud-usage",settings:void 0},v={type:"prometheus",uid:"grafanacloud-prom",settings:void 0},Re={alerting:"red",firing:"red",active:"red",missed:"red",failed:"red",pending:"yellow",nodata:"blue","active evaluation":"blue",normal:"green",success:"green",error:"orange"};function g(n){return{mode:"fixed",fixedColor:Re[n]}}const d={minHeight:300},$e=new e.gg({from:"now-1w",to:"now"});function We(){const n=(0,J.F)();[q,o,v].forEach(y=>{y.settings=n.getInstanceSettings(y.uid)});const t=[],a=q.settings&&o.settings,s=!!o.settings,m=!!o.settings,h=o.settings&&v.settings,w=!!o.settings;return a&&t.push(new e.fy({ySizing:"content",body:Ge()})),s&&t.push(new e.fy({ySizing:"content",body:Le()})),h&&t.push(new e.fy({ySizing:"content",body:Xe()})),w&&t.push(new e.fy({ySizing:"content",body:Qe()})),m&&t.push(new e.fy({ySizing:"content",body:ke()})),new e.U4({$timeRange:$e,controls:[new e.he({component:x,props:{children:r.createElement("div",null,"Monitor the status of your system.")}}),new e.o$,new e.n7({}),new e.vf({})],body:new e.QY({direction:"column",children:t})})}function Ge(){return new e.Gb({title:"Grafana-managed rules",canCollapse:!0,isCollapsed:!1,body:new e.QY({direction:"column",children:[new e.QY({direction:"column",children:[new e.QY({children:[ge(q,"Top 10 firing instances"),ce(o,"Firing rules"),pe(o,"Paused rules")]}),new e.QY({children:[oe(o,"Alert instances by state"),new e.QY({height:"400px",direction:"column",children:[new e.QY({height:"400px",children:[F(o,"Firing instances","The number of currently firing alert rule instances","alerting"),F(o,"Pending instances","The number of currently pending alert rule instances","pending")]}),new e.QY({children:[F(o,"No data instances","The current number of alert rule instances in No data state","nodata"),F(o,"Error instances","The current number of alert rule instances in Error state","error")]})]})]}),new e.QY({children:[ye(o,"Alert rule evaluation"),he(o,"% of alert rule evaluation")]}),new e.QY({children:[le(o,"Evaluation success vs failures"),ue(o,"Iterations missed per evaluation group")]})]}),new e.he({component:E})]})})}function Le(){return new e.Gb({title:"Grafana Alertmanager",canCollapse:!0,isCollapsed:!1,body:new e.QY({direction:"column",children:[new e.QY({children:[we(o,"Firing alerts by state"),ve(o,"Silences")]}),new e.he({component:E})]})})}function ke(){return new e.Gb({title:"Mimir alertmanager",canCollapse:!0,isCollapsed:!1,body:new e.QY({direction:"column",children:[new e.fy({body:new e.he({component:x,props:{datasources:[o]}})}),new e.QY({children:[be(o,"Firing alerts by state"),Se(o,"Notification delivery")]}),new e.QY({children:[Ce(o,"Silences"),Ee(o,"Invalid configuration")]}),new e.he({component:E})]})})}function Xe(){return new e.Gb({title:"Mimir-managed rules",canCollapse:!0,isCollapsed:!1,body:new e.QY({direction:"column",children:[new e.fy({body:new e.he({component:x,props:{datasources:[v,o]}})}),new e.QY({children:[Be(v,"Top 10 firing rules"),qe(v,"Firing instances"),Oe(v,"Pending instances")]}),new e.QY({children:[Me(v,"Firing and pending alert instances"),Te(v,"% of alert instances by state")]}),new e.QY({children:[Ie(o,"Evaluation success vs failures"),He(o,"Missed evaluations")]}),new e.he({component:E})]})})}function Qe(){const n=new e.$1({label:"Rule Group",name:"rule_group",datasource:o,query:"label_values(grafanacloud_instance_rule_group_rules,rule_group)"});return new e.Gb({title:"Mimir-managed Rules - Per Rule Group",canCollapse:!0,isCollapsed:!1,body:new e.QY({direction:"column",children:[new e.fy({body:new e.he({component:x,props:{datasources:[o]}})}),new e.QY({children:[_e(o,"Rule group evaluation"),Ne(o,"Rule group interval")]}),new e.QY({children:[Fe(o,"Rule group evaluation duration"),De(o,"Rules per group"),Ae(o,"Evaluation duration / interval ratio")]}),new e.he({component:E})]}),$variables:new e.hT({variables:[n]}),controls:[new e.dn({})]})}let S;function $(n){return S||(n?S=new e.mt({pages:[new e.yH({title:"Alerting",subTitle:r.createElement(D,null),url:"/alerting",hideFromBreadcrumbs:!0,tabs:[new e.yH({title:"Insights",url:"/alerting/home/insights",getScene:We}),new e.yH({title:"Get started",url:"/alerting/home/overview",getScene:H})]})]}):S=new e.mt({pages:[new e.yH({title:"Alerting",subTitle:r.createElement(D,null),url:"/alerting",hideFromBreadcrumbs:!0,getScene:H})]}),S)}function Ye(){const n=(!(0,T.Vj)()||(0,T.mt)())&&!!W.config.featureToggles.alertingInsights,t=$(n),a=(0,G.P)("alerting"),[s]=(0,r.useState)({sectionNav:a});return r.createElement(L.v.Provider,{value:s},r.createElement(t.Component,{model:t}))}}}]);

//# sourceMappingURL=AlertingHome.3e12fe3d9d1314e8861e.js.map