"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[4301],{3627(C,d,t){t.r(d),t.d(d,{plugin:()=>j});var i=t(16207),a=t(47184),n=t(92745),u=t(65445),p=t(88535),l=t(74848),o=t(96540),T=t(69192),B=t(2513);const F=({value:e,onChange:r,context:s})=>{const c=(0,o.useMemo)(()=>(0,p.L)(s.data[0]),[s.data]),[h,m]=(0,o.useState)(),[k,z]=(0,o.useState)({});return(0,o.useEffect)(()=>{e.tags||r({...e,tags:[B.Tl]})},[r,e]),c?(0,l.jsx)(T.T,{search:e,setSearch:r,trace:c,tagKeys:h,setTagKeys:m,tagValues:k,setTagValues:z}):null};var L=t(22803),y=t(16817),S=t(78282),x=t(41783),P=t(77806);const f={wrapper:(0,L.css)({height:"100%",overflow:"scroll"})},V=({data:e,options:r,replaceVariables:s})=>{const c=(0,o.createRef)(),h=(0,o.useMemo)(()=>(0,p.L)(e.series[0]),[e.series]),m=(0,y.A)(async()=>await(0,S.l)().get(e.request?.targets[0].datasource?.uid));return!e||!e.series.length||!h?(0,l.jsx)("div",{className:"panel-empty",children:(0,l.jsx)("p",{children:(0,l.jsx)(n.x6,{i18nKey:"traces.traces-panel.no-data-found-in-response",children:"No data found in response"})})}):(0,l.jsxs)("div",{className:f.wrapper,children:[(0,l.jsx)("div",{ref:c}),(0,l.jsx)(x.V,{dataFrames:e.series,scrollElementClass:f.wrapper,traceProp:h,datasource:m.value,topOfViewRef:c,createSpanLink:r.createSpanLink,focusedSpanId:r.focusedSpanId,createFocusSpanLink:r.createFocusSpanLink,spanFilters:(0,P.Q)(s,r.spanFilters),timeRange:e.timeRange})]})};var G=t(38919),v=t(73495);class A{getListWithDefaults(r){return r.getListAppender({name:v.m.Trace,pluginId:"traces"})}getSuggestionsForData(r){!r.data||!r.data.series[0]||r.data.series[0].meta?.preferredVisualisationType==="trace"&&this.getListWithDefaults(r).append({name:v.m.Trace,score:G.nQ.Best})}}const j=new i.m(V).setPanelOptions((e,r)=>{const s=[(0,n.t)("traces.category-span-filters","Span filters")],c=(0,p.L)(r?.data?.[0]);e.addTextInput({path:"spanFilters.query",name:(0,n.t)("traces.name-find-in-trace","Find in trace"),category:s}).addBooleanSwitch({path:"spanFilters.matchesOnly",name:(0,n.t)("traces.name-show-matches-only","Show matches only"),defaultValue:!1,category:s}).addBooleanSwitch({path:"spanFilters.criticalPathOnly",name:(0,n.t)("traces.name-critical-path-only","Show critical path only"),defaultValue:!1,category:s}),e.addSelect({path:"spanFilters.serviceName",name:(0,n.t)("traces.name-service-name","Service name"),category:s,settings:{options:c?(0,u.pG)(c).map(a.z):[],allowCustomValue:!0,isClearable:!0}}).addRadio({path:"spanFilters.serviceNameOperator",name:(0,n.t)("traces.name-service-name-operator","Service name operator"),defaultValue:"=",settings:{options:[{value:"=",label:"="},{value:"!=",label:"!="}]},category:s}),e.addSelect({path:"spanFilters.spanName",name:(0,n.t)("traces.name-span-name","Span name"),category:s,settings:{options:c?(0,u.m8)(c).map(a.z):[],allowCustomValue:!0,isClearable:!0}}).addRadio({path:"spanFilters.spanNameOperator",name:(0,n.t)("traces.name-span-name-operator","Span name operator"),defaultValue:"=",settings:{options:[{value:"=",label:"="},{value:"!=",label:"!="}]},category:s}),e.addTextInput({path:"spanFilters.from",name:(0,n.t)("traces.name-min-duration","Min duration"),category:s}).addTextInput({path:"spanFilters.to",name:(0,n.t)("traces.name-max-duration","Max duration"),category:s}),e.addCustomEditor({id:"tags",name:(0,n.t)("traces.name-tags","Tags"),path:"spanFilters",category:s,editor:F,defaultValue:void 0})}).setSuggestionsSupplier(new A)},73495(C,d,t){t.d(d,{m:()=>i});var i=(a=>(a.LineChart="Line chart",a.LineChartSmooth="Line chart smooth",a.LineChartGradientColorScheme="Line chart with gradient color scheme",a.AreaChart="Area chart",a.AreaChartStacked="Area chart stacked",a.AreaChartStackedPercent="Area chart 100% stacked",a.BarChart="Bar chart",a.BarChartGradientColorScheme="Bar chart with gradient color scheme",a.BarChartStacked="Bar chart stacked",a.BarChartStackedPercent="Bar chart 100% stacked",a.BarChartHorizontal="Bar chart horizontal",a.BarChartHorizontalStacked="Bar chart horizontal stacked",a.BarChartHorizontalStackedPercent="Bar chart horizontal 100% stacked",a.Candlestick="Candlestick",a.PieChart="Pie chart",a.PieChartDonut="Pie chart donut",a.Stat="Stat",a.StatColoredBackground="Stat colored background",a.Gauge="Gauge",a.GaugeCircular="Circular gauge",a.GaugeNoThresholds="Gauge no thresholds",a.BarGaugeBasic="Bar gauge basic",a.BarGaugeLCD="Bar gauge LCD",a.Table="Table",a.StateTimeline="State timeline",a.StatusHistory="Status history",a.TextPanel="Text",a.DashboardList="Dashboard list",a.Logs="Logs",a.FlameGraph="Flame graph",a.Trace="Trace",a.NodeGraph="Node graph",a))(i||{})}}]);

//# sourceMappingURL=tracesPanel.318c3720ee5e247c889d.js.map