The only tool you need to know what is happening and how to fix it.
Go alertingexception-trackerissue-trackinglogsmetricsmonitoringobservability-platformopen-telemetryotelsession-replaytelemetrytraces
import{r as wt}from"../chunks/hp4PFHFv.js";import{a as xt}from"../chunks/h7yRWCtK.js";import"../chunks/DsnmJJEf.js";import{p as yt,j as R,k as we,y as Pt,z as Lt,e as b,f as d,d as r,a as Ft,h as j,t as re,m as o,l as g,g as e,u as L,n as B,r as A,c as $,o as C,q as O}from"../chunks/BKFspo1J.js";import{i as F}from"../chunks/COK9M2N0.js";import{e as kt}from"../chunks/DpeZtIXD.js";import{c as v}from"../chunks/CWm9VMfX.js";import{a as Xe,b as Tt}from"../chunks/DwMHXN8q.js";import{g as Dt}from"../chunks/CqMCVSVw.js";import{f as Rt,p as ae,a as Ct}from"../chunks/BrdmM8Kw.js";import{b as Ze,T as et,a as I,c as Ot}from"../chunks/v9anb0q3.js";import{T as It}from"../chunks/BWW_Bja4.js";import{B as Nt}from"../chunks/DY5VVhnr.js";import{L as Et}from"../chunks/CN84UmjY.js";import{E as jt}from"../chunks/NVaYW5lc.js";import{T as N}from"../chunks/D2DsoUX_.js";import{T as Bt}from"../chunks/h9ZJ0sRx.js";import{S as At}from"../chunks/fuvv1XUh.js";import{I as Kt}from"../chunks/DuzWbv8u.js";import{E as tt}from"../chunks/Cyk_em_h.js";import{T as Mt}from"../chunks/amHA2p2Y.js";import{P as zt}from"../chunks/N0z9j_AG.js";import{S as Ut,a as Wt,b as qt}from"../chunks/CoqOZxrY.js";import{F as Vt,B as Gt,S as Ht,s as Yt}from"../chunks/BSOLzmdY.js";import{c as Qt}from"../chunks/BHvJp7nu.js";import{r as Jt}from"../chunks/UDuKBjKQ.js";import{u as Xt}from"../chunks/BYJ4QaOY.js";import{s as rt,f as Zt,a as er,t as Oe,b as tr,c as rr,d as ar,e as or}from"../chunks/B-kFjqtk.js";import{g as sr,h as nr,s as ir}from"../chunks/X-i49s3k.js";import{P as lr}from"../chunks/MS5-RPlv.js";const dr=()=>{if(!xt.isAuthenticated)throw wt(302,"/login")},Xr=Object.freeze(Object.defineProperty({__proto__:null,load:dr},Symbol.toStringTag,{value:"Module"}));var ur=b("<!> New SLO",1),cr=b('<div class="flex h-48 items-center justify-center"><!></div>'),mr=b("<!> <!> <!> <!> <!> <!> <!> <!>",1),fr=b('<div class="mt-0.5 max-w-[420px] truncate text-xs font-normal text-muted-foreground"> </div>'),vr=b(' <!> <div class="mt-0.5 max-w-[420px] truncate font-mono text-xs font-normal text-muted-foreground"> </div>',1),pr=b('<span class="text-muted-foreground">—</span>'),gr=b("<div></div>"),_r=b('<div class="flex items-center gap-2"><span> </span> <div class="h-1.5 w-14 shrink-0 overflow-hidden rounded-full bg-muted"><!></div></div>'),hr=b("<!> <!> <!> <!> <!> <!> <!> <!>",1),Sr=b("<!> <!>",1),$r=b('<div class="space-y-4"><!> <!> <!> <!></div> <!>',1);function Zr(at,ot){yt(ot,!0);let oe=R(we([])),se=R(!0),ne=R(""),ie=R(!1);const Ie=L(()=>!!ae.currentProject&&Rt(ae.currentProject.framework)),st=L(()=>[{value:"",label:"All kinds"},...(e(Ie)?Vt:Gt).map(t=>({value:t,label:Ht[t]}))]);let le=R("");function Ne(){return new URLSearchParams(window.location.search).get("search")||""}let W=R(we(Ne()));function Ee(t=!0){Xt({search:e(W).trim()||null},{pushToHistory:t})}function je(){g(W,Ne(),!0),de(!1)}const Be="slos",Ae=sr(Be,{field:"status",direction:"asc"});let h=R(we(Ae.field)),S=R(we(Ae.direction));async function de(t=!0){g(se,!0),g(ne,""),Ee(t);try{const a=await Ct.get("/slos",{projectId:ae.currentProjectId??void 0});g(oe,a.slos||[],!0),Yt.refreshBreachedCount()}catch(a){console.error(a),g(ne,Dt(a)||"Failed to load SLOs",!0)}finally{g(se,!1)}}function k(t){const a=nr(t,e(h),e(S));g(h,a.field,!0),g(S,a.direction,!0),ir(Be,a)}function nt(){Ee(!0)}const Ke={breached:0,no_data:1,ok:2};function K(t){return t===null?Number.NEGATIVE_INFINITY:t}const xe=L(()=>{const t=e(W).trim().toLowerCase();let a=e(le)?e(oe).filter(n=>n.sliKind===e(le)):e(oe);t&&(a=a.filter(n=>n.name.toLowerCase().includes(t)||n.description.toLowerCase().includes(t)||rt(n).toLowerCase().includes(t)));const l=e(S)==="asc"?1:-1;return[...a].sort((n,f)=>{switch(e(h)){case"kind":return l*n.sliKind.localeCompare(f.sliKind);case"target":return l*(n.targetPercent-f.targetPercent);case"window":return l*(n.windowDays-f.windowDays);case"current_sli":return l*(K(n.currentSli)-K(f.currentSli));case"budget":return l*(K(n.budgetRemaining)-K(f.budgetRemaining));case"burn_1h":return l*(K(n.burnRate1h)-K(f.burnRate1h));case"status":{const _=n.enabled?Ke[n.status]:3,M=f.enabled?Ke[f.status]:3;return l*(_-M)||n.name.localeCompare(f.name)}default:return l*n.name.localeCompare(f.name)}})});Pt(()=>{window.addEventListener("popstate",je),de(!1)}),Lt(()=>{typeof window<"u"&&window.removeEventListener("popstate",je)});var Me=$r(),ye=d(Me),ze=j(ye);zt(ze,{title:"SLOs",actions:a=>{var l=$(),n=d(l);{var f=_=>{Nt(_,{variant:"success",size:"sm",onclick:()=>g(ie,!0),children:(M,qe)=>{var ue=ur(),Pe=d(ue);lr(Pe,{class:"mr-2 h-4 w-4"}),B(),r(M,ue)},$$slots:{default:!0}})};F(n,_=>{ae.canWriteCurrentProject&&_(f)})}r(a,l)}});var Ue=o(ze,2);Kt(Ue,{children:(t,a)=>{B();var l=re(`A service level objective holds an indicator, the share of good requests, spans, task runs,
probes, metric slices or crash-free sessions, to a target over a rolling window. The error
budget is what the target leaves over, and the burn rate says how fast it is being spent.`);r(t,l)},$$slots:{default:!0}});var We=o(Ue,2);At(We,{placeholder:"Search SLOs...",get typeOptions(){return e(st)},onSearch:nt,get disabled(){return e(se)},get value(){return e(W)},set value(t){g(W,t,!0)},get typeValue(){return e(le)},set typeValue(t){g(le,t,!0)}});var it=o(We,2);{var lt=t=>{var a=cr(),l=j(a);Et(l,{size:"xlg"}),A(a),r(t,a)},dt=t=>{var a=$(),l=d(a);{var n=_=>{jt(_,{status:400,title:"Error",get description(){return e(ne)},onRetry:()=>de(!1)})},f=_=>{var M=$(),qe=d(M);{var ue=z=>{var ce=$(),Le=d(ce);{var Ve=T=>{{let Fe=L(()=>e(Ie)?"No SLOs yet. Define a crash-free sessions target to start tracking its error budget.":"No SLOs yet. Define a target for an endpoint, span, task, monitor or metric to start tracking its error budget.");tt(T,{get message(){return e(Fe)},actionLabel:"Create your first SLO",onAction:()=>g(ie,!0)})}},me=T=>{tt(T,{message:"No SLOs yet."})};F(Le,T=>{ae.canWriteCurrentProject?T(Ve):T(me,!1)})}r(z,ce)},Pe=z=>{{let ce=L(()=>e(xe).length===0);Mt(z,{minWidth:"960px",get empty(){return e(ce)},children:(Le,Ve)=>{var me=$(),T=d(me);v(T,()=>Ot,(Fe,ct)=>{ct(Fe,{children:(mt,br)=>{var Ge=$(),ft=d(Ge);{var vt=U=>{var q=$(),fe=d(q);v(fe,()=>Ze,(ke,V)=>{V(ke,{children:(G,ve)=>{Bt(G,{colspan:8,message:"No SLOs match your search."})},$$slots:{default:!0}})}),r(U,q)},pt=U=>{var q=Sr(),fe=d(q);v(fe,()=>It,(V,G)=>{G(V,{children:(ve,gt)=>{var H=$(),Te=d(H);v(Te,()=>et,(Y,s)=>{s(Y,{children:(Q,De)=>{var pe=mr(),ge=d(pe);N(ge,{label:"Name",sortField:"name",get currentSortField(){return e(h)},get sortDirection(){return e(S)},onSort:i=>k(i)});var _e=o(ge,2);N(_e,{label:"SLI",sortField:"kind",get currentSortField(){return e(h)},get sortDirection(){return e(S)},onSort:i=>k(i),class:"w-[110px]"});var he=o(_e,2);N(he,{label:"Target",sortField:"target",get currentSortField(){return e(h)},get sortDirection(){return e(S)},onSort:i=>k(i),class:"w-[90px]"});var Se=o(he,2);N(Se,{label:"Window",sortField:"window",get currentSortField(){return e(h)},get sortDirection(){return e(S)},onSort:i=>k(i),class:"w-[90px]"});var Re=o(Se,2);N(Re,{label:"Current SLI",tooltip:"Share of good events over the whole window",sortField:"current_sli",get currentSortField(){return e(h)},get sortDirection(){return e(S)},onSort:i=>k(i),class:"w-[120px]"});var J=o(Re,2);N(J,{label:"Budget left",tooltip:"Share of the error budget not yet spent; negative once the target is missed",sortField:"budget",get currentSortField(){return e(h)},get sortDirection(){return e(S)},onSort:i=>k(i),class:"w-[170px]"});var X=o(J,2);N(X,{label:"Burn 1h",tooltip:"How fast the budget burned over the last hour; 1x spends it exactly over the window",sortField:"burn_1h",get currentSortField(){return e(h)},get sortDirection(){return e(S)},onSort:i=>k(i),class:"w-[100px]"});var $e=o(X,2);N($e,{label:"Status",sortField:"status",get currentSortField(){return e(h)},get sortDirection(){return e(S)},onSort:i=>k(i),align:"right",class:"w-[120px]"}),r(Q,pe)},$$slots:{default:!0}})}),r(ve,H)},$$slots:{default:!0}})});var ke=o(fe,2);v(ke,()=>Ze,(V,G)=>{G(V,{children:(ve,gt)=>{var H=$(),Te=d(H);kt(Te,17,()=>e(xe),Y=>Y.id,(Y,s)=>{const Q=L(()=>ar(e(s).budgetRemaining));var De=$(),pe=d(De);{let ge=L(()=>Qt(Jt(`/slos/${e(s).id}`)));v(pe,()=>et,(_e,he)=>{he(_e,{class:"cursor-pointer",get onclick(){return e(ge)},children:(Se,Re)=>{var J=hr(),X=d(J);v(X,()=>I,(u,c)=>{c(u,{class:"font-medium whitespace-normal",children:(m,y)=>{B();var p=vr(),w=d(p),D=o(w);{var Ce=x=>{var Z=fr(),be=j(Z,!0);A(Z),C(()=>O(be,e(s).description)),r(x,Z)};F(D,x=>{e(s).description&&x(Ce)})}var P=o(D,2),E=j(P,!0);A(P),C(x=>{O(w,`${e(s).name??""} `),O(E,x)},[()=>rt(e(s))]),r(m,p)},$$slots:{default:!0}})});var $e=o(X,2);v($e,()=>I,(u,c)=>{c(u,{children:(m,y)=>{Wt(m,{get kind(){return e(s).sliKind}})},$$slots:{default:!0}})});var i=o($e,2);v(i,()=>I,(u,c)=>{c(u,{class:"font-mono text-sm tabular-nums",children:(m,y)=>{B();var p=re();C(()=>O(p,`${e(s).targetPercent??""}%`)),r(m,p)},$$slots:{default:!0}})});var He=o(i,2);v(He,()=>I,(u,c)=>{c(u,{class:"text-sm text-muted-foreground",children:(m,y)=>{B();var p=re();C(()=>O(p,`${e(s).windowDays??""}d`)),r(m,p)},$$slots:{default:!0}})});var Ye=o(He,2);{let u=L(()=>Oe(e(Q)));v(Ye,()=>I,(c,m)=>{m(c,{get class(){return`font-mono text-sm tabular-nums ${e(u)??""}`},children:(y,p)=>{B();var w=re();C(D=>O(w,D),[()=>Zt(e(s).currentSli,e(s).targetPercent)]),r(y,w)},$$slots:{default:!0}})})}var Qe=o(Ye,2);v(Qe,()=>I,(u,c)=>{c(u,{children:(m,y)=>{var p=$(),w=d(p);{var D=P=>{var E=pr();r(P,E)},Ce=P=>{var E=_r(),x=j(E),Z=j(x,!0);A(x);var be=o(x,2),ht=j(be);{var St=ee=>{var te=gr();C(($t,bt)=>{Xe(te,1,`h-full rounded-full ${$t??""}`),Tt(te,`width: ${bt??""}%`)},[()=>or(e(Q)),()=>Math.max(Math.min(e(s).budgetRemaining,100),4)]),r(ee,te)};F(ht,ee=>{e(s).budgetRemaining>0&&ee(St)})}A(be),A(E),C((ee,te)=>{Xe(x,1,`w-16 shrink-0 font-mono text-sm tabular-nums ${ee??""}`),O(Z,te)},[()=>Oe(e(Q)),()=>tr(e(s).budgetRemaining)]),r(P,E)};F(w,P=>{e(s).budgetRemaining===null?P(D):P(Ce,!1)})}r(m,p)},$$slots:{default:!0}})});var Je=o(Qe,2);{let u=L(()=>Oe(rr(e(s).burnRate1h)));v(Je,()=>I,(c,m)=>{m(c,{get class(){return`font-mono text-sm tabular-nums ${e(u)??""}`},children:(y,p)=>{B();var w=re();C(D=>O(w,D),[()=>er(e(s).burnRate1h)]),r(y,w)},$$slots:{default:!0}})})}var _t=o(Je,2);v(_t,()=>I,(u,c)=>{c(u,{class:"text-right",children:(m,y)=>{qt(m,{get status(){return e(s).status},get enabled(){return e(s).enabled}})},$$slots:{default:!0}})}),r(Se,J)},$$slots:{default:!0}})})}r(Y,De)}),r(ve,H)},$$slots:{default:!0}})}),r(U,q)};F(ft,U=>{e(xe).length===0?U(vt):U(pt,!1)})}r(mt,Ge)},$$slots:{default:!0}})}),r(Le,me)},$$slots:{default:!0}})}};F(qe,z=>{e(oe).length===0?z(ue):z(Pe,!1)},!0)}r(_,M)};F(l,_=>{e(ne)?_(n):_(f,!1)},!0)}r(t,a)};F(it,t=>{e(se)?t(lt):t(dt,!1)})}A(ye);var ut=o(ye,2);Ut(ut,{slo:null,onSaved:()=>de(!1),get open(){return e(ie)},set open(t){g(ie,t,!0)}}),r(at,Me),Ft()}export{Zr as component,Xr as universal};