diff --git a/README.md b/README.md index ad60fcdbf..2eaa7d47a 100644 --- a/README.md +++ b/README.md @@ -1644,7 +1644,9 @@ All the durations and timestamps in traces are in milliseconds. Query tracing is allowed by default. It can be denied by passing `-denyQueryTracing` command-line flag to VictoriaMetrics. -[VMUI](#vmui) provides an UI for query tracing - just click `Trace query` checkbox and re-run the query in order to investigate its' trace. +[VMUI](#vmui) provides an UI: +- for query tracing - just click `Trace query` checkbox and re-run the query in order to investigate its' trace. +- for exploring custom trace - go to the tab `Trace analyzer` and upload or paste JSON with trace information. ## Cardinality limiter diff --git a/app/vmselect/vmui/asset-manifest.json b/app/vmselect/vmui/asset-manifest.json index a1f9aba33..24fc65b79 100644 --- a/app/vmselect/vmui/asset-manifest.json +++ b/app/vmselect/vmui/asset-manifest.json @@ -1,12 +1,12 @@ { "files": { - "main.css": "./static/css/main.f2cbb582.css", - "main.js": "./static/js/main.d0509bc3.js", + "main.css": "./static/css/main.44a8ea12.css", + "main.js": "./static/js/main.da9caa97.js", "static/js/27.c1ccfd29.chunk.js": "./static/js/27.c1ccfd29.chunk.js", "index.html": "./index.html" }, "entrypoints": [ - "static/css/main.f2cbb582.css", - "static/js/main.d0509bc3.js" + "static/css/main.44a8ea12.css", + "static/js/main.da9caa97.js" ] } \ No newline at end of file diff --git a/app/vmselect/vmui/index.html b/app/vmselect/vmui/index.html index 6032aabf0..9a378670f 100644 --- a/app/vmselect/vmui/index.html +++ b/app/vmselect/vmui/index.html @@ -1 +1 @@ -
'+(n?e:Gs(e,!0))+"
\n":""+(n?e:Gs(e,!0))+"
\n"}},{key:"blockquote",value:function(e){return"\n".concat(e,"\n")}},{key:"html",value:function(e){return e}},{key:"heading",value:function(e,t,n,r){if(this.options.headerIds){var i=this.options.headerPrefix+r.slug(n);return"
".concat(e,"
\n")}},{key:"table",value:function(e,t){return t&&(t="".concat(t,"")),"".concat(e,"
")}},{key:"br",value:function(){return this.options.xhtml?""+Gs(e.message+"",!0)+"";throw e}try{var l=bf.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(Cf.walkTokens(l,t.walkTokens)).then((function(){return kf.parse(l,t)})).catch(u);Cf.walkTokens(l,t.walkTokens)}return kf.parse(l,t)}catch(c){u(c)}}Cf.options=Cf.setOptions=function(e){var t;return cf(Cf.defaults,e),t=Cf.defaults,Us=t,Cf},Cf.getDefaults=zs,Cf.defaults=Us,Cf.use=function(){for(var e=arguments.length,t=new Array(e),n=0;n
"+Gs(c.message+"",!0)+"";throw c}},Cf.Parser=kf,Cf.parser=kf.parse,Cf.Renderer=Df,Cf.TextRenderer=wf,Cf.Lexer=bf,Cf.lexer=bf.lex,Cf.Tokenizer=vf,Cf.Slugger=xf,Cf.parse=Cf;Cf.options,Cf.setOptions,Cf.use,Cf.walkTokens,Cf.parseInline,kf.parse,bf.lex;var Ef=function(e){var t=e.title,n=e.description,r=e.unit,i=e.expr,o=e.showLegend,a=e.filename,u=e.alias,l=Wr().period,c=Qr(),s=re(null),f=_t(X(!0),2),d=f[0],h=f[1],p=_t(X(l.step||1),2),v=p[0],y=p[1],g=_t(X({limits:{enable:!1,range:{1:[0,0]}}}),2),_=g[0],b=g[1],D=oe((function(){return Array.isArray(i)&&i.every((function(e){return e}))}),[i]),w=ws({predefinedQuery:D?i:[],display:"chart",visible:d,customStep:v}),x=w.isLoading,k=w.graphData,C=w.error,E=w.warning,A=function(e){var t=Kn({},_);t.limits.range=e,b(t)};if(te((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){return h(e.isIntersecting)}))}),{threshold:.1});return s.current&&e.observe(s.current),function(){s.current&&e.unobserve(s.current)}}),[]),!D)return fr(oo,{variant:"error",children:[fr("code",{children:'"expr"'})," not found. Check the configuration file ",fr("b",{children:a}),"."]});var S=function(){return fr("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&fr(m,{children:[fr("div",{children:[fr("span",{children:"Description:"}),fr("div",{dangerouslySetInnerHTML:{__html:Cf.parse(n)}})]}),fr("hr",{})]}),fr("div",{children:[fr("span",{children:"Queries:"}),fr("div",{children:i.map((function(e,t){return fr("div",{children:e},"".concat(t,"_").concat(e))}))})]})]})};return fr("div",{className:"vm-predefined-panel",ref:s,children:[fr("div",{className:"vm-predefined-panel-header",children:[fr(fo,{title:fr(S,{}),children:fr("div",{className:"vm-predefined-panel-header__info",children:fr(li,{})})}),fr("h3",{className:"vm-predefined-panel-header__title",children:t||""}),fr("div",{className:"vm-predefined-panel-header__step",children:fr(ds,{defaultStep:l.step,setStep:y})}),fr(Es,{yaxis:_,setYaxisLimits:A,toggleEnableLimits:function(){var e=Kn({},_);e.limits.enable=!e.limits.enable,b(e)}})]}),fr("div",{className:"vm-predefined-panel-body",children:[x&&fr(As,{}),C&&fr(oo,{variant:"error",children:C}),E&&fr(oo,{variant:"warning",children:E}),k&&fr(ls,{data:k,period:l,customStep:v,query:i,yaxis:_,unit:r,alias:u,showLegend:o,setYaxisLimits:A,setPeriod:function(e){var t=e.from,n=e.to;c({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1})]})]})},Af=function(e){var t=e.defaultExpanded,n=void 0!==t&&t,r=e.onChange,i=e.title,o=e.children,a=_t(X(n),2),u=a[0],l=a[1];return te((function(){r&&r(u)}),[u]),fr(m,{children:[fr("header",{className:"vm-accordion-header ".concat(u&&"vm-accordion-header_open"),onClick:function(){l((function(e){return!e}))},children:[i,fr("div",{className:"vm-accordion-header__arrow ".concat(u&&"vm-accordion-header__arrow_open"),children:fr(hi,{})})]}),u&&fr("section",{className:"vm-accordion-section",children:o},"content")]})},Sf=function(e){var t=e.index,n=e.title,r=e.panels,i=e.filename,o=mo(document.body),a=oe((function(){return o.width/12}),[o]),u=_t(X(!t),2),l=u[0],c=u[1],s=_t(X([]),2),f=s[0],d=s[1];te((function(){d(r&&r.map((function(e){return e.width||12})))}),[r]);var h=_t(X({start:0,target:0,enable:!1}),2),p=h[0],v=h[1],m=function(e){if(p.enable){var t=p.start,n=Math.ceil((t-e.clientX)/a);if(!(Math.abs(n)>=12)){var r=f.map((function(e,t){return e-(t===p.target?n:0)}));d(r)}}},y=function(){v(Kn(Kn({},p),{},{enable:!1}))},g=function(e){return function(t){!function(e,t){v({start:e.clientX,target:t,enable:!0})}(t,e)}};return te((function(){return window.addEventListener("mousemove",m),window.addEventListener("mouseup",y),function(){window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",y)}}),[p]),fr("div",{className:"vm-predefined-dashboard",children:fr(Af,{defaultExpanded:l,onChange:function(e){return c(e)},title:fr((function(){return fr("div",{className:Oi()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":l}),children:[(n||i)&&fr("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(i)}),r&&fr("span",{className:"vm-predefined-dashboard-header__count",children:["(",r.length," panels)"]})]})}),{}),children:fr("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(r)&&r.length?r.map((function(e,t){return fr("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(f[t])},children:[fr(Ef,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:i,showLegend:e.showLegend}),fr("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:g(t)})]},t)})):fr("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:fr(oo,{variant:"error",children:[fr("code",{children:'"panels"'})," not found. Check the configuration file ",fr("b",{children:i}),"."]})})})})})},Ff=function(){!function(){var e=Wr(),t=e.duration,n=e.relativeTime,r=e.period,i=r.date,o=r.step,a=function(){var e,r=Ps((qn(e={},"g0.range_input",t),qn(e,"g0.end_input",i),qn(e,"g0.step_input",o),qn(e,"g0.relative_time",n),e));ar(r)};te(a,[t,n,i,o]),te(a,[])}();var e=_t(X([]),2),t=e[0],n=e[1],r=_t(X("0"),2),i=r[0],o=r[1],a=oe((function(){return t.map((function(e,t){return{label:e.title||"",value:"".concat(t),className:"vm-predefined-panels-tabs__tab"}}))}),[t]),u=oe((function(){return t[+i]||{}}),[t,i]),l=oe((function(){return null===u||void 0===u?void 0:u.rows}),[u]),c=oe((function(){return u.title||u.filename||""}),[u]),s=oe((function(){return Array.isArray(l)&&!!l.length}),[l]);return te((function(){js().then((function(e){return e.length&&n(e)}))}),[]),fr("div",{className:"vm-predefined-panels",children:[!t.length&&fr(oo,{variant:"info",children:"Dashboards not found"}),a.length>1&&fr("div",{className:"vm-predefined-panels-tabs vm-block vm-block_empty-padding",children:fr(Mi,{activeItem:i,items:a,onChange:function(e){o(e)}})}),fr("div",{className:"vm-predefined-panels__dashboards",children:[s&&l.map((function(e,t){return fr(Sf,{index:t,filename:c,title:e.title,panels:e.panels},"".concat(i,"_").concat(t))})),!!t.length&&!s&&fr(oo,{variant:"error",children:[fr("code",{children:'"rows"'})," not found. Check the configuration file ",fr("b",{children:c}),"."]})]})]})},Nf=function(e,t){var n=t.match?"&match[]="+encodeURIComponent(t.match):"",r=t.focusLabel?"&focusLabel="+encodeURIComponent(t.focusLabel):"";return"".concat(e,"/api/v1/status/tsdb?topN=").concat(t.topN,"&date=").concat(t.date).concat(n).concat(r)},Of=function(){function e(){Dt(this,e),this.tsdbStatus=void 0,this.tabsNames=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"]}return xt(e,[{key:"tsdbStatusData",get:function(){return this.tsdbStatus},set:function(e){this.tsdbStatus=e}},{key:"defaultTSDBStatus",get:function(){return{totalSeries:0,totalLabelValuePairs:0,seriesCountByMetricName:[],seriesCountByLabelName:[],seriesCountByFocusLabelValue:[],seriesCountByLabelValuePair:[],labelValueCountByLabelName:[]}}},{key:"keys",value:function(e){var t=[];return e&&(t=t.concat("seriesCountByFocusLabelValue")),t=t.concat("seriesCountByMetricName","seriesCountByLabelName","seriesCountByLabelValuePair","labelValueCountByLabelName"),t}},{key:"defaultState",get:function(){var e=this;return this.keys("job").reduce((function(t,n){return Kn(Kn({},t),{},{tabs:Kn(Kn({},t.tabs),{},qn({},n,e.tabsNames)),containerRefs:Kn(Kn({},t.containerRefs),{},qn({},n,re(null))),defaultActiveTab:Kn(Kn({},t.defaultActiveTab),{},qn({},n,0))})}),{tabs:{},containerRefs:{},defaultActiveTab:{}})}},{key:"sectionsTitles",value:function(e){return{seriesCountByMetricName:"Metric names with the highest number of series",seriesCountByLabelName:"Labels with the highest number of series",seriesCountByFocusLabelValue:'Values for "'.concat(e,'" label with the highest number of series'),seriesCountByLabelValuePair:"Label=value pairs with the highest number of series",labelValueCountByLabelName:"Labels with the highest number of unique values"}}},{key:"tablesHeaders",get:function(){return{seriesCountByMetricName:Tf,seriesCountByLabelName:Bf,seriesCountByFocusLabelValue:Mf,seriesCountByLabelValuePair:Lf,labelValueCountByLabelName:Pf}}},{key:"totalSeries",value:function(e){return"labelValueCountByLabelName"===e?-1:this.tsdbStatus.totalSeries}}]),e}(),Tf=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Bf=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Mf=[{id:"name",label:"Label value"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{disablePadding:!1,id:"action",label:"Action",numeric:!1}],Lf=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Pf=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:"Action"}],$f={seriesCountByMetricName:function(e,t){return Rf("__name__",t)},seriesCountByLabelName:function(e,t){return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:function(e,t){return Rf(e,t)},seriesCountByLabelValuePair:function(e,t){var n=t.split("="),r=n[0],i=n.slice(1).join("=");return Rf(r,i)},labelValueCountByLabelName:function(e,t){return"{".concat(t,'!=""}')}},Rf=function(e,t){return e?"{"+e+"="+JSON.stringify(t)+"}":""},If=function(e){var t=e.topN,n=e.error,r=e.query,i=e.onSetHistory,o=e.onRunQuery,a=e.onSetQuery,u=e.onTopNChange,l=e.onFocusLabelChange,c=e.totalSeries,s=e.totalLabelValuePairs,f=e.date,d=e.match,h=e.focusLabel,p=ni().autocomplete,v=ri(),m=Ss().queryOptions,y=oe((function(){return t<1?"Number must be bigger than zero":""}),[t]);return fr("div",{className:"vm-cardinality-configurator vm-block",children:[fr("div",{className:"vm-cardinality-configurator-controls",children:[fr("div",{className:"vm-cardinality-configurator-controls__query",children:fr(cs,{value:r||d||"",autocomplete:p,options:m,error:n,onArrowUp:function(){i(-1)},onArrowDown:function(){i(1)},onEnter:o,onChange:a,label:"Time series selector"})}),fr("div",{className:"vm-cardinality-configurator-controls__item",children:fr(So,{label:"Number of entries per table",type:"number",value:t,error:y,onChange:u})}),fr("div",{className:"vm-cardinality-configurator-controls__item",children:fr(So,{label:"Focus label",type:"text",value:h||"",onChange:l})}),fr("div",{className:"vm-cardinality-configurator-controls__item",children:fr(ps,{label:"Autocomplete",value:p,onChange:function(){v({type:"TOGGLE_AUTOCOMPLETE"})}})})]}),fr("div",{className:"vm-cardinality-configurator-bottom",children:[fr("div",{className:"vm-cardinality-configurator-bottom__info",children:["Analyzed ",fr("b",{children:c})," series with ",fr("b",{children:s}),' "label=value" pairs at ',fr("b",{children:f}),d&&fr("span",{children:[" for series selector ",fr("b",{children:d})]}),". Show top ",t," entries per table."]}),fr(lo,{startIcon:fr(bi,{}),onClick:o,children:"Execute Query"})]})]})};function jf(e){var t=e.order,n=e.orderBy,r=e.onRequestSort,i=e.headerCells;return fr("thead",{className:"vm-table-header",children:fr("tr",{className:"vm-table__row vm-table__row_header",children:i.map((function(e){return fr("th",{className:Oi()({"vm-table-cell vm-table-cell_header":!0,"vm-table-cell_sort":"action"!==e.id&&"percentage"!==e.id,"vm-table-cell_right":"action"===e.id}),onClick:(i=e.id,function(e){r(e,i)}),children:fr("div",{className:"vm-table-cell__content",children:[e.label,"action"!==e.id&&"percentage"!==e.id&&fr("div",{className:Oi()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:fr(vi,{})})]})},e.id);var i}))})})}function zf(e,t,n){return t[n]
'+(n?e:Ks(e,!0))+"
\n":""+(n?e:Ks(e,!0))+"
\n"}},{key:"blockquote",value:function(e){return"\n".concat(e,"\n")}},{key:"html",value:function(e){return e}},{key:"heading",value:function(e,t,n,r){if(this.options.headerIds){var i=this.options.headerPrefix+r.slug(n);return"
".concat(e,"
\n")}},{key:"table",value:function(e,t){return t&&(t="".concat(t,"")),"".concat(e,"
")}},{key:"br",value:function(){return this.options.xhtml?""+Ks(e.message+"",!0)+"";throw e}try{var l=xf.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(Sf.walkTokens(l,t.walkTokens)).then((function(){return Af.parse(l,t)})).catch(u);Sf.walkTokens(l,t.walkTokens)}return Af.parse(l,t)}catch(c){u(c)}}Sf.options=Sf.setOptions=function(e){var t;return df(Sf.defaults,e),t=Sf.defaults,Vs=t,Sf},Sf.getDefaults=Ys,Sf.defaults=Vs,Sf.use=function(){for(var e=arguments.length,t=new Array(e),n=0;n
"+Ks(c.message+"",!0)+"";throw c}},Sf.Parser=Af,Sf.parser=Af.parse,Sf.Renderer=kf,Sf.TextRenderer=Cf,Sf.Lexer=xf,Sf.lexer=xf.lex,Sf.Tokenizer=gf,Sf.Slugger=Ef,Sf.parse=Sf;Sf.options,Sf.setOptions,Sf.use,Sf.walkTokens,Sf.parseInline,Af.parse,xf.lex;var Ff=function(e){var t=e.title,n=e.description,r=e.unit,i=e.expr,o=e.showLegend,a=e.filename,u=e.alias,l=Wr().period,c=Qr(),s=re(null),f=_t(X(!0),2),d=f[0],h=f[1],p=_t(X(l.step||1),2),v=p[0],y=p[1],g=_t(X({limits:{enable:!1,range:{1:[0,0]}}}),2),_=g[0],b=g[1],D=oe((function(){return Array.isArray(i)&&i.every((function(e){return e}))}),[i]),w=ks({predefinedQuery:D?i:[],display:"chart",visible:d,customStep:v}),x=w.isLoading,k=w.graphData,C=w.error,E=w.warning,A=function(e){var t=Kn({},_);t.limits.range=e,b(t)};if(te((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){return h(e.isIntersecting)}))}),{threshold:.1});return s.current&&e.observe(s.current),function(){s.current&&e.unobserve(s.current)}}),[]),!D)return fr(ao,{variant:"error",children:[fr("code",{children:'"expr"'})," not found. Check the configuration file ",fr("b",{children:a}),"."]});var S=function(){return fr("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&fr(m,{children:[fr("div",{children:[fr("span",{children:"Description:"}),fr("div",{dangerouslySetInnerHTML:{__html:Sf.parse(n)}})]}),fr("hr",{})]}),fr("div",{children:[fr("span",{children:"Queries:"}),fr("div",{children:i.map((function(e,t){return fr("div",{children:e},"".concat(t,"_").concat(e))}))})]})]})};return fr("div",{className:"vm-predefined-panel",ref:s,children:[fr("div",{className:"vm-predefined-panel-header",children:[fr(po,{title:fr(S,{}),children:fr("div",{className:"vm-predefined-panel-header__info",children:fr(li,{})})}),fr("h3",{className:"vm-predefined-panel-header__title",children:t||""}),fr("div",{className:"vm-predefined-panel-header__step",children:fr(ps,{defaultStep:l.step,setStep:y})}),fr(Ss,{yaxis:_,setYaxisLimits:A,toggleEnableLimits:function(){var e=Kn({},_);e.limits.enable=!e.limits.enable,b(e)}})]}),fr("div",{className:"vm-predefined-panel-body",children:[x&&fr(Fs,{}),C&&fr(ao,{variant:"error",children:C}),E&&fr(ao,{variant:"warning",children:E}),k&&fr(ss,{data:k,period:l,customStep:v,query:i,yaxis:_,unit:r,alias:u,showLegend:o,setYaxisLimits:A,setPeriod:function(e){var t=e.from,n=e.to;c({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1})]})]})},Nf=function(e){var t=e.defaultExpanded,n=void 0!==t&&t,r=e.onChange,i=e.title,o=e.children,a=_t(X(n),2),u=a[0],l=a[1];return te((function(){r&&r(u)}),[u]),fr(m,{children:[fr("header",{className:"vm-accordion-header ".concat(u&&"vm-accordion-header_open"),onClick:function(){l((function(e){return!e}))},children:[i,fr("div",{className:"vm-accordion-header__arrow ".concat(u&&"vm-accordion-header__arrow_open"),children:fr(hi,{})})]}),u&&fr("section",{className:"vm-accordion-section",children:o},"content")]})},Of=function(e){var t=e.index,n=e.title,r=e.panels,i=e.filename,o=go(document.body),a=oe((function(){return o.width/12}),[o]),u=_t(X(!t),2),l=u[0],c=u[1],s=_t(X([]),2),f=s[0],d=s[1];te((function(){d(r&&r.map((function(e){return e.width||12})))}),[r]);var h=_t(X({start:0,target:0,enable:!1}),2),p=h[0],v=h[1],m=function(e){if(p.enable){var t=p.start,n=Math.ceil((t-e.clientX)/a);if(!(Math.abs(n)>=12)){var r=f.map((function(e,t){return e-(t===p.target?n:0)}));d(r)}}},y=function(){v(Kn(Kn({},p),{},{enable:!1}))},g=function(e){return function(t){!function(e,t){v({start:e.clientX,target:t,enable:!0})}(t,e)}};return te((function(){return window.addEventListener("mousemove",m),window.addEventListener("mouseup",y),function(){window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",y)}}),[p]),fr("div",{className:"vm-predefined-dashboard",children:fr(Nf,{defaultExpanded:l,onChange:function(e){return c(e)},title:fr((function(){return fr("div",{className:Ti()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":l}),children:[(n||i)&&fr("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(i)}),r&&fr("span",{className:"vm-predefined-dashboard-header__count",children:["(",r.length," panels)"]})]})}),{}),children:fr("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(r)&&r.length?r.map((function(e,t){return fr("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(f[t])},children:[fr(Ff,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:i,showLegend:e.showLegend}),fr("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:g(t)})]},t)})):fr("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:fr(ao,{variant:"error",children:[fr("code",{children:'"panels"'})," not found. Check the configuration file ",fr("b",{children:i}),"."]})})})})})},Tf=function(){!function(){var e=Wr(),t=e.duration,n=e.relativeTime,r=e.period,i=r.date,o=r.step,a=function(){var e,r=Is((qn(e={},"g0.range_input",t),qn(e,"g0.end_input",i),qn(e,"g0.step_input",o),qn(e,"g0.relative_time",n),e));ar(r)};te(a,[t,n,i,o]),te(a,[])}();var e=_t(X([]),2),t=e[0],n=e[1],r=_t(X("0"),2),i=r[0],o=r[1],a=oe((function(){return t.map((function(e,t){return{label:e.title||"",value:"".concat(t),className:"vm-predefined-panels-tabs__tab"}}))}),[t]),u=oe((function(){return t[+i]||{}}),[t,i]),l=oe((function(){return null===u||void 0===u?void 0:u.rows}),[u]),c=oe((function(){return u.title||u.filename||""}),[u]),s=oe((function(){return Array.isArray(l)&&!!l.length}),[l]);return te((function(){Hs().then((function(e){return e.length&&n(e)}))}),[]),fr("div",{className:"vm-predefined-panels",children:[!t.length&&fr(ao,{variant:"info",children:"Dashboards not found"}),a.length>1&&fr("div",{className:"vm-predefined-panels-tabs vm-block vm-block_empty-padding",children:fr(Li,{activeItem:i,items:a,onChange:function(e){o(e)}})}),fr("div",{className:"vm-predefined-panels__dashboards",children:[s&&l.map((function(e,t){return fr(Of,{index:t,filename:c,title:e.title,panels:e.panels},"".concat(i,"_").concat(t))})),!!t.length&&!s&&fr(ao,{variant:"error",children:[fr("code",{children:'"rows"'})," not found. Check the configuration file ",fr("b",{children:c}),"."]})]})]})},Bf=function(e,t){var n=t.match?"&match[]="+encodeURIComponent(t.match):"",r=t.focusLabel?"&focusLabel="+encodeURIComponent(t.focusLabel):"";return"".concat(e,"/api/v1/status/tsdb?topN=").concat(t.topN,"&date=").concat(t.date).concat(n).concat(r)},Mf=function(){function e(){Dt(this,e),this.tsdbStatus=void 0,this.tabsNames=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"]}return xt(e,[{key:"tsdbStatusData",get:function(){return this.tsdbStatus},set:function(e){this.tsdbStatus=e}},{key:"defaultTSDBStatus",get:function(){return{totalSeries:0,totalLabelValuePairs:0,seriesCountByMetricName:[],seriesCountByLabelName:[],seriesCountByFocusLabelValue:[],seriesCountByLabelValuePair:[],labelValueCountByLabelName:[]}}},{key:"keys",value:function(e){var t=[];return e&&(t=t.concat("seriesCountByFocusLabelValue")),t=t.concat("seriesCountByMetricName","seriesCountByLabelName","seriesCountByLabelValuePair","labelValueCountByLabelName"),t}},{key:"defaultState",get:function(){var e=this;return this.keys("job").reduce((function(t,n){return Kn(Kn({},t),{},{tabs:Kn(Kn({},t.tabs),{},qn({},n,e.tabsNames)),containerRefs:Kn(Kn({},t.containerRefs),{},qn({},n,re(null))),defaultActiveTab:Kn(Kn({},t.defaultActiveTab),{},qn({},n,0))})}),{tabs:{},containerRefs:{},defaultActiveTab:{}})}},{key:"sectionsTitles",value:function(e){return{seriesCountByMetricName:"Metric names with the highest number of series",seriesCountByLabelName:"Labels with the highest number of series",seriesCountByFocusLabelValue:'Values for "'.concat(e,'" label with the highest number of series'),seriesCountByLabelValuePair:"Label=value pairs with the highest number of series",labelValueCountByLabelName:"Labels with the highest number of unique values"}}},{key:"tablesHeaders",get:function(){return{seriesCountByMetricName:Lf,seriesCountByLabelName:Pf,seriesCountByFocusLabelValue:$f,seriesCountByLabelValuePair:Rf,labelValueCountByLabelName:If}}},{key:"totalSeries",value:function(e){return"labelValueCountByLabelName"===e?-1:this.tsdbStatus.totalSeries}}]),e}(),Lf=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Pf=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],$f=[{id:"name",label:"Label value"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{disablePadding:!1,id:"action",label:"Action",numeric:!1}],Rf=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],If=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:"Action"}],jf={seriesCountByMetricName:function(e,t){return zf("__name__",t)},seriesCountByLabelName:function(e,t){return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:function(e,t){return zf(e,t)},seriesCountByLabelValuePair:function(e,t){var n=t.split("="),r=n[0],i=n.slice(1).join("=");return zf(r,i)},labelValueCountByLabelName:function(e,t){return"{".concat(t,'!=""}')}},zf=function(e,t){return e?"{"+e+"="+JSON.stringify(t)+"}":""},Uf=function(e){var t=e.topN,n=e.error,r=e.query,i=e.onSetHistory,o=e.onRunQuery,a=e.onSetQuery,u=e.onTopNChange,l=e.onFocusLabelChange,c=e.totalSeries,s=e.totalLabelValuePairs,f=e.date,d=e.match,h=e.focusLabel,p=ni().autocomplete,v=ri(),m=Ns().queryOptions,y=oe((function(){return t<1?"Number must be bigger than zero":""}),[t]);return fr("div",{className:"vm-cardinality-configurator vm-block",children:[fr("div",{className:"vm-cardinality-configurator-controls",children:[fr("div",{className:"vm-cardinality-configurator-controls__query",children:fr(fs,{value:r||d||"",autocomplete:p,options:m,error:n,onArrowUp:function(){i(-1)},onArrowDown:function(){i(1)},onEnter:o,onChange:a,label:"Time series selector"})}),fr("div",{className:"vm-cardinality-configurator-controls__item",children:fr(No,{label:"Number of entries per table",type:"number",value:t,error:y,onChange:u})}),fr("div",{className:"vm-cardinality-configurator-controls__item",children:fr(No,{label:"Focus label",type:"text",value:h||"",onChange:l})}),fr("div",{className:"vm-cardinality-configurator-controls__item",children:fr(ms,{label:"Autocomplete",value:p,onChange:function(){v({type:"TOGGLE_AUTOCOMPLETE"})}})})]}),fr("div",{className:"vm-cardinality-configurator-bottom",children:[fr("div",{className:"vm-cardinality-configurator-bottom__info",children:["Analyzed ",fr("b",{children:c})," series with ",fr("b",{children:s}),' "label=value" pairs at ',fr("b",{children:f}),d&&fr("span",{children:[" for series selector ",fr("b",{children:d})]}),". Show top ",t," entries per table."]}),fr(so,{startIcon:fr(bi,{}),onClick:o,children:"Execute Query"})]})]})};function Hf(e){var t=e.order,n=e.orderBy,r=e.onRequestSort,i=e.headerCells;return fr("thead",{className:"vm-table-header",children:fr("tr",{className:"vm-table__row vm-table__row_header",children:i.map((function(e){return fr("th",{className:Ti()({"vm-table-cell vm-table-cell_header":!0,"vm-table-cell_sort":"action"!==e.id&&"percentage"!==e.id,"vm-table-cell_right":"action"===e.id}),onClick:(i=e.id,function(e){r(e,i)}),children:fr("div",{className:"vm-table-cell__content",children:[e.label,"action"!==e.id&&"percentage"!==e.id&&fr("div",{className:Ti()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:fr(vi,{})})]})},e.id);var i}))})})}function Yf(e,t,n){return t[n]