The only tool you need to know what is happening and how to fix it.
Go alertingexception-trackerissue-trackinglogsmetricsmonitoringobservability-platformopen-telemetryotelsession-replaytelemetrytraces
import{t as O}from"./Siulznyt.js";import"./DsnmJJEf.js";import{p as z,c as A,f as T,d as f,a as K,e as W,m as B,g as q,u as D,t as v,o as H,q as U}from"./BKFspo1J.js";import{i as _}from"./COK9M2N0.js";import{W as j}from"./DxDqniE2.js";const F=2,G=500,J=50;function C(n,a){return a?"trace":n.projectId}function Q(n,a=!1){return`${C(n,a)}:${n.traceId}:${n.spanId}`}function V(n,a,l=!1){const o=new Map;for(const e of n){const s=Q(e,l),t=o.get(s);(!t||e.duration>t.duration)&&o.set(s,e)}const r=new Map,d=new Set;for(const[e,s]of o){if(!s.parentSpanId)continue;const t=`${C(s,l)}:${s.traceId}:${s.parentSpanId}`;t!==e&&o.has(t)?r.set(e,t):s.parentSpanId!==a&&d.add(e)}const u=new Set;for(const e of o.keys()){const s=new Set;let t=e;for(;t&&!u.has(t);){if(s.has(t)){r.delete(t),d.add(t);break}s.add(t),t=r.get(t)}for(const i of s)u.add(i)}const c=new Map,y=[];for(const e of o.keys()){const s=r.get(e);if(!s)y.push(e);else{const t=c.get(s)??[];t.push(e),c.set(s,t)}}const h=new Map;for(const[e,s]of o)h.set(e,O(s.startTime));const w=(e,s)=>{const t=h.get(e)-h.get(s);return t<0n?-1:t>0n?1:e.localeCompare(s)};y.sort(w);for(const e of c.values())e.sort(w);const b=new Map,S=new Set,p=[],k=[...y];for(;k.length;){const e=k.pop();p.push(e);for(const s of c.get(e)??[])k.push(s)}for(let e=p.length-1;e>=0;e--){const s=p[e];let t=0;for(const i of c.get(s)??[])t+=1+(b.get(i)??0),(S.has(i)||o.get(i).statusCode===F)&&S.add(s);b.set(s,t)}return{byId:o,childrenById:c,roots:y,missing:d,descendants:b,errorBelow:S}}function at(n){const a=new Set;if(n.byId.size<=G)return a;for(const[l,o]of n.childrenById)o.length>J&&a.add(l);return a}function X(n,a){const l=[],o=n.roots.map(r=>({key:r,depth:0})).reverse();for(;o.length;){const{key:r,depth:d}=o.pop(),u=n.childrenById.get(r)??[];if(l.push({key:r,span:n.byId.get(r),depth:d,hasChildren:u.length>0,missingParent:n.missing.has(r),descendants:n.descendants.get(r)??0,errorBelow:n.errorBelow.has(r)}),!a.has(r))for(let c=u.length-1;c>=0;c--)o.push({key:u[c],depth:d+1})}return l}function nt(n,a,l){return X(V(n,a),l)}var Y=W("<!> <!> <!>",1);function ot(n,a){z(a,!0);var l=A(),o=T(l);{var r=d=>{{let u=D(()=>a.status.state==="unavailable"?"Spans are temporarily unavailable":a.status.reasons?.includes("row_limit")?"This trace is too large to show in full":"Some trace details could not be loaded");j(d,{get title(){return q(u)},children:(c,y)=>{var h=Y(),w=T(h);{var b=t=>{var i=v("The trace could not be loaded within the read limits. Refresh to try again.");f(t,i)},S=t=>{var i=A(),M=T(i);{var N=m=>{var I=v(`The available spans prioritize errors, entry points and slowest spans. Other spans may be
missing.`);f(m,I)},E=m=>{var I=A(),L=T(I);{var P=g=>{var x=v("The spans shown are only part of the trace.");f(g,x)},R=g=>{var x=v("The available spans are shown, but some attributes could not be loaded.");f(g,x)};_(L,g=>{a.status.reasons?.includes("row_limit")?g(P):g(R,!1)},!0)}f(m,I)};_(M,m=>{a.status.reasons?.includes("most_important")?m(N):m(E,!1)},!0)}f(t,i)};_(w,t=>{a.status.state==="unavailable"?t(b):t(S,!1)})}var p=B(w,2);{var k=t=>{var i=v("Exceptions attached to missing spans may also be absent from this view.");f(t,i)};_(p,t=>{(a.status.state==="unavailable"||a.status.reasons?.includes("row_limit"))&&t(k)})}var e=B(p,2);{var s=t=>{var i=v();H(()=>U(i,`Attributes are missing from ${a.status.omittedAttributes??""}
${a.status.omittedAttributes===1?"span":"spans"}.`)),f(t,i)};_(e,t=>{a.status.omittedAttributes&&t(s)})}f(c,h)},$$slots:{default:!0}})}};_(o,d=>{a.status&&a.status.state!=="complete"&&d(r)})}f(n,l),K()}export{ot as S,X as a,V as b,nt as f,at as i,Q as s};