diff --git a/app/vmselect/vmui/asset-manifest.json b/app/vmselect/vmui/asset-manifest.json index 743c4512d0..6183910fcc 100644 --- a/app/vmselect/vmui/asset-manifest.json +++ b/app/vmselect/vmui/asset-manifest.json @@ -1,14 +1,14 @@ { "files": { - "main.css": "./static/css/main.69d78cc2.css", - "main.js": "./static/js/main.1be8603e.js", + "main.css": "./static/css/main.2c709f8b.css", + "main.js": "./static/js/main.34430dca.js", "static/js/27.c1ccfd29.chunk.js": "./static/js/27.c1ccfd29.chunk.js", "static/media/Lato-Regular.ttf": "./static/media/Lato-Regular.d714fec1633b69a9c2e9.ttf", "static/media/Lato-Bold.ttf": "./static/media/Lato-Bold.32360ba4b57802daa4d6.ttf", "index.html": "./index.html" }, "entrypoints": [ - "static/css/main.69d78cc2.css", - "static/js/main.1be8603e.js" + "static/css/main.2c709f8b.css", + "static/js/main.34430dca.js" ] } \ No newline at end of file diff --git a/app/vmselect/vmui/index.html b/app/vmselect/vmui/index.html index a533f17360..68bc7581ef 100644 --- a/app/vmselect/vmui/index.html +++ b/app/vmselect/vmui/index.html @@ -1 +1 @@ -
'+(n?e:ls(e,!0))+"
\n":""+(n?e:ls(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?""+ls(e.message+"",!0)+"";throw e}try{var l=Os.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(Ps.walkTokens(l,t.walkTokens)).then((function(){return Ls.parse(l,t)})).catch(u);Ps.walkTokens(l,t.walkTokens)}return Ls.parse(l,t)}catch(c){u(c)}}Ps.options=Ps.setOptions=function(e){var t;return Ds(Ps.defaults,e),t=Ps.defaults,ts=t,Ps},Ps.getDefaults=es,Ps.defaults=ts,Ps.use=function(){for(var e=Ps.defaults.extensions||{renderers:{},childTokens:{}},t=arguments.length,n=new Array(t),r=0;r
"+ls(r.message+"",!0)+"";throw r}},Ps.Parser=Ls,Ps.parser=Ls.parse,Ps.Renderer=Ts,Ps.TextRenderer=Bs,Ps.Lexer=Os,Ps.lexer=Os.lex,Ps.Tokenizer=As,Ps.Slugger=Is,Ps.parse=Ps;Ps.options,Ps.setOptions,Ps.use,Ps.walkTokens,Ps.parseInline,Ls.parse,Os.lex;var Rs=function(e){var t=e.title,n=e.description,i=e.unit,o=e.expr,a=e.showLegend,u=e.filename,l=e.alias,c=Yr().isMobile,s=_n().period,f=Mr().customStep,d=bn(),h=(0,r.useRef)(null),p=m((0,r.useState)(!1),2),v=p[0],g=p[1],y=m((0,r.useState)({limits:{enable:!1,range:{1:[0,0]}}}),2),_=y[0],b=y[1],D=(0,r.useMemo)((function(){return Array.isArray(o)&&o.every((function(e){return e}))}),[o]),w=Ic({predefinedQuery:D?o:[],display:"chart",visible:v,customStep:f}),x=w.isLoading,k=w.graphData,C=w.error,E=w.warning,A=function(e){var t=at({},_);t.limits.range=e,b(t)};return(0,r.useEffect)((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){return g(e.isIntersecting)}))}),{threshold:.1});return h.current&&e.observe(h.current),function(){h.current&&e.unobserve(h.current)}}),[h]),D?Bt("div",{className:"vm-predefined-panel",ref:h,children:[Bt("div",{className:"vm-predefined-panel-header",children:[Bt(oi,{title:Bt((function(){return Bt("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&Bt(Ot.HY,{children:[Bt("div",{children:[Bt("span",{children:"Description:"}),Bt("div",{dangerouslySetInnerHTML:{__html:Ps.parse(n)}})]}),Bt("hr",{})]}),Bt("div",{children:[Bt("span",{children:"Queries:"}),Bt("div",{children:o.map((function(e,t){return Bt("div",{children:e},"".concat(t,"_").concat(e))}))})]})]})}),{}),children:Bt("div",{className:"vm-predefined-panel-header__info",children:Bt(On,{})})}),Bt("h3",{className:"vm-predefined-panel-header__title",children:t||""}),Bt(zc,{yaxis:_,setYaxisLimits:A,toggleEnableLimits:function(){var e=at({},_);e.limits.enable=!e.limits.enable,b(e)}})]}),Bt("div",{className:"vm-predefined-panel-body",children:[x&&Bt(jc,{}),C&&Bt(Vr,{variant:"error",children:C}),E&&Bt(Vr,{variant:"warning",children:E}),k&&Bt(Dc,{data:k,period:s,customStep:f,query:o,yaxis:_,unit:i,alias:l,showLegend:a,setYaxisLimits:A,setPeriod:function(e){var t=e.from,n=e.to;d({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1,height:c?.5*window.innerHeight:500})]})]}):Bt(Vr,{variant:"error",children:[Bt("code",{children:'"expr"'})," not found. Check the configuration file ",Bt("b",{children:u}),"."]})},zs=function(e){var t=e.index,n=e.title,i=e.panels,o=e.filename,a=cr(document.body),u=(0,r.useMemo)((function(){return a.width/12}),[a]),l=m((0,r.useState)(!t),2),c=l[0],s=l[1],f=m((0,r.useState)([]),2),d=f[0],h=f[1];(0,r.useEffect)((function(){h(i&&i.map((function(e){return e.width||12})))}),[i]);var p=m((0,r.useState)({start:0,target:0,enable:!1}),2),v=p[0],g=p[1],y=function(e){if(v.enable){var t=v.start,n=Math.ceil((t-e.clientX)/u);if(!(Math.abs(n)>=12)){var r=d.map((function(e,t){return e-(t===v.target?n:0)}));h(r)}}},_=function(){g(at(at({},v),{},{enable:!1}))},b=function(e){return function(t){!function(e,t){g({start:e.clientX,target:t,enable:!0})}(t,e)}};return(0,r.useEffect)((function(){return window.addEventListener("mousemove",y),window.addEventListener("mouseup",_),function(){window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",_)}}),[v]),Bt("div",{className:"vm-predefined-dashboard",children:Bt(Ri,{defaultExpanded:c,onChange:function(e){return s(e)},title:Bt((function(){return Bt("div",{className:fr()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":c}),children:[(n||o)&&Bt("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(o)}),i&&Bt("span",{className:"vm-predefined-dashboard-header__count",children:["(",i.length," panels)"]})]})}),{}),children:Bt("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(i)&&i.length?i.map((function(e,t){return Bt("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(d[t])},children:[Bt(Rs,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:o,showLegend:e.showLegend}),Bt("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:b(t)})]},t)})):Bt("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:Bt(Vr,{variant:"error",children:[Bt("code",{children:'"panels"'})," not found. Check the configuration file ",Bt("b",{children:o}),"."]})})})})})},js=function(){!function(){var e=_n(),t=e.duration,n=e.relativeTime,i=e.period.date,o=Mr().customStep,a=m(nt(),2)[1],u=function(){var e,r=Jc((it(e={},"g0.range_input",t),it(e,"g0.end_input",i),it(e,"g0.step_input",o),it(e,"g0.relative_time",n),e));a(r)};(0,r.useEffect)(u,[t,n,i,o]),(0,r.useEffect)(u,[])}();var e=Yr().isMobile,t=Jr(),n=t.dashboardsSettings,i=t.dashboardsLoading,o=t.dashboardsError,a=m((0,r.useState)(0),2),u=a[0],l=a[1],c=(0,r.useMemo)((function(){return n.map((function(e,t){return{label:e.title||"",value:t}}))}),[n]),s=(0,r.useMemo)((function(){return n[u]||{}}),[n,u]),f=(0,r.useMemo)((function(){return null===s||void 0===s?void 0:s.rows}),[s]),d=(0,r.useMemo)((function(){return s.title||s.filename||""}),[s]),h=(0,r.useMemo)((function(){return Array.isArray(f)&&!!f.length}),[f]),p=function(e){return function(){!function(e){l(e)}(e)}};return Bt("div",{className:"vm-predefined-panels",children:[i&&Bt(jc,{}),!n.length&&o&&Bt(Vr,{variant:"error",children:o}),!n.length&&Bt(Vr,{variant:"info",children:"Dashboards not found"}),c.length>1&&Bt("div",{className:fr()({"vm-predefined-panels-tabs":!0,"vm-predefined-panels-tabs_mobile":e}),children:c.map((function(e){return Bt("div",{className:fr()({"vm-predefined-panels-tabs__tab":!0,"vm-predefined-panels-tabs__tab_active":e.value==u}),onClick:p(e.value),children:e.label},e.value)}))}),Bt("div",{className:"vm-predefined-panels__dashboards",children:[h&&f.map((function(e,t){return Bt(zs,{index:t,filename:d,title:e.title,panels:e.panels},"".concat(u,"_").concat(t))})),!!n.length&&!h&&Bt(Vr,{variant:"error",children:[Bt("code",{children:'"rows"'})," not found. Check the configuration file ",Bt("b",{children:d}),"."]})]})]})},$s=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)},Ys=function(){function e(){b(this,e),this.tsdbStatus=void 0,this.tabsNames=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"]}return k(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 at(at({},t),{},{tabs:at(at({},t.tabs),{},it({},n,e.tabsNames)),containerRefs:at(at({},t.containerRefs),{},it({},n,(0,r.useRef)(null))),defaultActiveTab:at(at({},t.defaultActiveTab),{},it({},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:Hs,seriesCountByLabelName:Vs,seriesCountByFocusLabelValue:Us,seriesCountByLabelValuePair:qs,labelValueCountByLabelName:Ws}}},{key:"totalSeries",value:function(e){return"labelValueCountByLabelName"===e?-1:this.tsdbStatus.totalSeries}}]),e}(),Hs=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Vs=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Us=[{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}],qs=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],Ws=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:"Action"}],Qs={seriesCountByMetricName:function(e,t){return Gs("__name__",t)},seriesCountByLabelName:function(e,t){return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:function(e,t){return Gs(e,t)},seriesCountByLabelValuePair:function(e,t){var n=t.split("="),r=n[0],i=n.slice(1).join("=");return Gs(r,i)},labelValueCountByLabelName:function(e,t){return"{".concat(t,'!=""}')}},Gs=function(e,t){return e?"{"+e+"="+JSON.stringify(t)+"}":""},Js=function(e){var t=e.topN,n=e.error,i=e.query,o=e.onSetHistory,a=e.onRunQuery,u=e.onSetQuery,l=e.onTopNChange,c=e.onFocusLabelChange,s=e.totalSeries,f=e.totalLabelValuePairs,d=e.date,h=e.match,p=e.focusLabel,v=Cn().autocomplete,m=En(),g=Yr().isMobile,y=$c().queryOptions,_=(0,r.useMemo)((function(){return t<1?"Number must be bigger than zero":""}),[t]);return Bt("div",{className:fr()({"vm-cardinality-configurator":!0,"vm-block":!0,"vm-block_mobile":g}),children:[Bt("div",{className:"vm-cardinality-configurator-controls",children:[Bt("div",{className:"vm-cardinality-configurator-controls__query",children:Bt(xc,{value:i,autocomplete:v,options:y,error:n,onArrowUp:function(){o(-1)},onArrowDown:function(){o(1)},onEnter:a,onChange:u,label:"Time series selector"})}),Bt("div",{className:"vm-cardinality-configurator-controls__item",children:Bt(di,{label:"Number of entries per table",type:"number",value:t,error:_,onChange:l})}),Bt("div",{className:"vm-cardinality-configurator-controls__item",children:Bt(di,{label:"Focus label",type:"text",value:p||"",onChange:c,endIcon:Bt(oi,{title:Bt("div",{children:[Bt("p",{children:"To identify values with the highest number of series for the selected label."}),Bt("p",{children:"Adds a table showing the series with the highest number of series."})]}),children:Bt(On,{})})})})]}),Bt("div",{className:"vm-cardinality-configurator-additional",children:Bt(kc,{label:"Autocomplete",value:v,onChange:function(){m({type:"TOGGLE_AUTOCOMPLETE"})}})}),Bt("div",{className:fr()({"vm-cardinality-configurator-bottom":!0,"vm-cardinality-configurator-bottom_mobile":g}),children:[Bt("div",{className:"vm-cardinality-configurator-bottom__info",children:["Analyzed ",Bt("b",{children:s})," series with ",Bt("b",{children:f}),' "label=value" pairs at ',Bt("b",{children:d}),h&&Bt("span",{children:[" for series selector ",Bt("b",{children:h})]}),". Show top ",t," entries per table."]}),Bt("div",{className:"vm-cardinality-configurator-bottom__docs",children:[Bt("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/#cardinality-explorer",rel:"help noreferrer",children:[Bt(rr,{}),"Documentation"]}),Bt("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://victoriametrics.com/blog/cardinality-explorer/",rel:"help noreferrer",children:[Bt(or,{}),"Example of using"]})]}),Bt(ei,{startIcon:Bt(Hn,{}),onClick:a,fullWidth:!0,children:"Execute Query"})]})]})};function Zs(e){var t=e.order,n=e.orderBy,r=e.onRequestSort,i=e.headerCells;return Bt("thead",{className:"vm-table-header",children:Bt("tr",{className:"vm-table__row vm-table__row_header",children:i.map((function(e){return Bt("th",{className:fr()({"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:Bt("div",{className:"vm-table-cell__content",children:[e.label,"action"!==e.id&&"percentage"!==e.id&&Bt("div",{className:fr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:Bt(Rn,{})})]})},e.id);var i}))})})}function Ks(e,t,n){return t[n]
'+(n?e:rs(e,!0))+"
\n":""+(n?e:rs(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?""+rs(e.message+"",!0)+"";throw e}try{var l=As.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(Os.walkTokens(l,t.walkTokens)).then((function(){return Fs.parse(l,t)})).catch(u);Os.walkTokens(l,t.walkTokens)}return Fs.parse(l,t)}catch(c){u(c)}}Os.options=Os.setOptions=function(e){var t;return vs(Os.defaults,e),t=Os.defaults,Jc=t,Os},Os.getDefaults=Gc,Os.defaults=Jc,Os.use=function(){for(var e=Os.defaults.extensions||{renderers:{},childTokens:{}},t=arguments.length,n=new Array(t),r=0;r
"+rs(r.message+"",!0)+"";throw r}},Os.Parser=Fs,Os.parser=Fs.parse,Os.Renderer=Ss,Os.TextRenderer=Ns,Os.Lexer=As,Os.lexer=As.lex,Os.Tokenizer=ws,Os.Slugger=Ms,Os.parse=Os;Os.options,Os.setOptions,Os.use,Os.walkTokens,Os.parseInline,Fs.parse,As.lex;var Ts=function(e){var t=e.title,n=e.description,i=e.unit,a=e.expr,o=e.showLegend,u=e.filename,l=e.alias,c=Rr().isMobile,s=_n().period,f=Fr().customStep,d=bn(),h=(0,r.useRef)(null),p=v((0,r.useState)(!1),2),m=p[0],g=p[1],y=v((0,r.useState)({limits:{enable:!1,range:{1:[0,0]}}}),2),_=y[0],b=y[1],D=(0,r.useMemo)((function(){return Array.isArray(a)&&a.every((function(e){return e}))}),[a]),w=Fc({predefinedQuery:D?a:[],display:"chart",visible:m,customStep:f}),k=w.isLoading,x=w.graphData,C=w.error,E=w.warning,A=function(e){var t=ot({},_);t.limits.range=e,b(t)};return(0,r.useEffect)((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){return g(e.isIntersecting)}))}),{threshold:.1});return h.current&&e.observe(h.current),function(){h.current&&e.unobserve(h.current)}}),[h]),D?Bt("div",{className:"vm-predefined-panel",ref:h,children:[Bt("div",{className:"vm-predefined-panel-header",children:[Bt(ti,{title:Bt((function(){return Bt("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&Bt(Ot.HY,{children:[Bt("div",{children:[Bt("span",{children:"Description:"}),Bt("div",{dangerouslySetInnerHTML:{__html:Os.parse(n)}})]}),Bt("hr",{})]}),Bt("div",{children:[Bt("span",{children:"Queries:"}),Bt("div",{children:a.map((function(e,t){return Bt("div",{children:e},"".concat(t,"_").concat(e))}))})]})]})}),{}),children:Bt("div",{className:"vm-predefined-panel-header__info",children:Bt(On,{})})}),Bt("h3",{className:"vm-predefined-panel-header__title",children:t||""}),Bt(Ic,{yaxis:_,setYaxisLimits:A,toggleEnableLimits:function(){var e=ot({},_);e.limits.enable=!e.limits.enable,b(e)}})]}),Bt("div",{className:"vm-predefined-panel-body",children:[k&&Bt(Lc,{}),C&&Bt(jr,{variant:"error",children:C}),E&&Bt(jr,{variant:"warning",children:E}),x&&Bt(gc,{data:x,period:s,customStep:f,query:a,yaxis:_,unit:i,alias:l,showLegend:o,setYaxisLimits:A,setPeriod:function(e){var t=e.from,n=e.to;d({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1,height:c?.5*window.innerHeight:500})]})]}):Bt(jr,{variant:"error",children:[Bt("code",{children:'"expr"'})," not found. Check the configuration file ",Bt("b",{children:u}),"."]})},Bs=function(e){var t=e.index,n=e.title,i=e.panels,a=e.filename,o=sr(document.body),u=(0,r.useMemo)((function(){return o.width/12}),[o]),l=v((0,r.useState)(!t),2),c=l[0],s=l[1],f=v((0,r.useState)([]),2),d=f[0],h=f[1];(0,r.useEffect)((function(){h(i&&i.map((function(e){return e.width||12})))}),[i]);var p=v((0,r.useState)({start:0,target:0,enable:!1}),2),m=p[0],g=p[1],y=function(e){if(m.enable){var t=m.start,n=Math.ceil((t-e.clientX)/u);if(!(Math.abs(n)>=12)){var r=d.map((function(e,t){return e-(t===m.target?n:0)}));h(r)}}},_=function(){g(ot(ot({},m),{},{enable:!1}))},b=function(e){return function(t){!function(e,t){g({start:e.clientX,target:t,enable:!0})}(t,e)}};return(0,r.useEffect)((function(){return window.addEventListener("mousemove",y),window.addEventListener("mouseup",_),function(){window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",_)}}),[m]),Bt("div",{className:"vm-predefined-dashboard",children:Bt(Bi,{defaultExpanded:c,onChange:function(e){return s(e)},title:Bt((function(){return Bt("div",{className:dr()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":c}),children:[(n||a)&&Bt("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(a)}),i&&Bt("span",{className:"vm-predefined-dashboard-header__count",children:["(",i.length," panels)"]})]})}),{}),children:Bt("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(i)&&i.length?i.map((function(e,t){return Bt("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(d[t])},children:[Bt(Ts,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:a,showLegend:e.showLegend}),Bt("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:b(t)})]},t)})):Bt("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:Bt(jr,{variant:"error",children:[Bt("code",{children:'"panels"'})," not found. Check the configuration file ",Bt("b",{children:a}),"."]})})})})})},Is=function(){!function(){var e=_n(),t=e.duration,n=e.relativeTime,i=e.period.date,a=Fr().customStep,o=v(nt(),2)[1],u=function(){var e,r=Uc((it(e={},"g0.range_input",t),it(e,"g0.end_input",i),it(e,"g0.step_input",a),it(e,"g0.relative_time",n),e));o(r)};(0,r.useEffect)(u,[t,n,i,a]),(0,r.useEffect)(u,[])}();var e=Rr().isMobile,t=qr(),n=t.dashboardsSettings,i=t.dashboardsLoading,a=t.dashboardsError,o=v((0,r.useState)(0),2),u=o[0],l=o[1],c=(0,r.useMemo)((function(){return n.map((function(e,t){return{label:e.title||"",value:t}}))}),[n]),s=(0,r.useMemo)((function(){return n[u]||{}}),[n,u]),f=(0,r.useMemo)((function(){return null===s||void 0===s?void 0:s.rows}),[s]),d=(0,r.useMemo)((function(){return s.title||s.filename||""}),[s]),h=(0,r.useMemo)((function(){return Array.isArray(f)&&!!f.length}),[f]),p=function(e){return function(){!function(e){l(e)}(e)}};return Bt("div",{className:"vm-predefined-panels",children:[i&&Bt(Lc,{}),!n.length&&a&&Bt(jr,{variant:"error",children:a}),!n.length&&Bt(jr,{variant:"info",children:"Dashboards not found"}),c.length>1&&Bt("div",{className:dr()({"vm-predefined-panels-tabs":!0,"vm-predefined-panels-tabs_mobile":e}),children:c.map((function(e){return Bt("div",{className:dr()({"vm-predefined-panels-tabs__tab":!0,"vm-predefined-panels-tabs__tab_active":e.value==u}),onClick:p(e.value),children:e.label},e.value)}))}),Bt("div",{className:"vm-predefined-panels__dashboards",children:[h&&f.map((function(e,t){return Bt(Bs,{index:t,filename:d,title:e.title,panels:e.panels},"".concat(u,"_").concat(t))})),!!n.length&&!h&&Bt(jr,{variant:"error",children:[Bt("code",{children:'"rows"'})," not found. Check the configuration file ",Bt("b",{children:d}),"."]})]})]})},Ls=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)},Ps=function(){function e(){b(this,e),this.tsdbStatus=void 0,this.tabsNames=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"],this.getDefaultState=this.getDefaultState.bind(this)}return x(e,[{key:"tsdbStatusData",get:function(){return this.tsdbStatus},set:function(e){this.tsdbStatus=e}},{key:"defaultTSDBStatus",get:function(){return{totalSeries:0,totalLabelValuePairs:0,totalSeriesByAll:0,seriesCountByMetricName:[],seriesCountByLabelName:[],seriesCountByFocusLabelValue:[],seriesCountByLabelValuePair:[],labelValueCountByLabelName:[]}}},{key:"keys",value:function(e,t){var n=e&&/__name__=".+"/.test(e),r=e&&/{.+=".+"}/g.test(e),i=e&&/__name__=".+", .+!=""/g.test(e),a=[];return a=t||i?a.concat("seriesCountByFocusLabelValue"):n?a.concat("labelValueCountByLabelName"):r?a.concat("seriesCountByMetricName","seriesCountByLabelName"):a.concat("seriesCountByMetricName","seriesCountByLabelName","seriesCountByLabelValuePair"),a}},{key:"getDefaultState",value:function(e,t){var n=this;return this.keys(e,t).reduce((function(e,t){return ot(ot({},e),{},{tabs:ot(ot({},e.tabs),{},it({},t,n.tabsNames)),containerRefs:ot(ot({},e.containerRefs),{},it({},t,(0,r.useRef)(null)))})}),{tabs:{},containerRefs:{}})}},{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:"sectionsTips",get:function(){return{seriesCountByMetricName:"\n
\n This table returns a list of metrics with the highest cardinality.\n The cardinality of a metric is the number of time series associated with that metric,\n where each time series is defined as a unique combination of key-value label pairs.\n
\n\n When looking to reduce the number of active series in your data source,\n you can start by inspecting individual metrics with high cardinality\n (i.e. that have lots of active time series associated with them),\n since that single metric contributes a large fraction of the series that make up your total series count.\n
",seriesCountByLabelName:"\n\n This table returns a list of the labels with the highest number of series.\n
\n\n Use this table to identify labels that are storing dimensions with high cardinality\n (many different label values).\n
\n\n It is recommended to choose labels such that they have a finite set of values,\n since every unique combination of key-value label pairs creates a new time series\n and therefore can dramatically increase the number of time series in your system.\n
",seriesCountByFocusLabelValue:"\n\n This table returns a list of unique label values per selected label.\n
\n\n Use this table to identify label values that are storing per each selected series.\n
",labelValueCountByLabelName:"",seriesCountByLabelValuePair:"\n\n This table returns a list of the label values pairs with the highest number of series.\n
\n\n Use this table to identify unique label values pairs. This helps to identify same labels \n is applied to count timeseries in your system, since every unique combination of key-value label pairs \n creates a new time series and therefore can dramatically increase the number of time series in your system\n
"}}},{key:"tablesHeaders",get:function(){return{seriesCountByMetricName:Rs,seriesCountByLabelName:zs,seriesCountByFocusLabelValue:js,seriesCountByLabelValuePair:$s,labelValueCountByLabelName:Ys}}},{key:"totalSeries",value:function(e){return"labelValueCountByLabelName"===e?-1:this.tsdbStatus.totalSeries}}]),e}(),Rs=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of a metric to the total number of series"},{id:"action",label:""}],zs=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of the label to the total number of series"},{id:"action",label:""}],js=[{id:"name",label:"Label value"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total"},{disablePadding:!1,id:"action",label:"",numeric:!1}],$s=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Share in total",info:"Shows the share of the label value pair to the total number of series"},{id:"action",label:""}],Ys=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:""}],Hs={seriesCountByMetricName:function(e){var t=e.query;return Vs("__name__",t)},seriesCountByLabelName:function(e){var t=e.query;return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:function(e){var t=e.query,n=e.focusLabel;return Vs(n,t)},seriesCountByLabelValuePair:function(e){var t=e.query.split("="),n=t[0],r=t.slice(1).join("=");return Vs(n,r)},labelValueCountByLabelName:function(e){var t=e.query,n=e.match;return"".concat(n.replace("}",""),", ").concat(t,'!=""}')}},Vs=function(e,t){return e?"{"+e+"="+JSON.stringify(t)+"}":""},Us=function(e){var t,n=e.totalSeries,r=e.totalSeriesAll,i=e.seriesCountByMetricName,a=Rr().isMobile,o=v(nt(),1)[0],u=o.get("match"),l=o.get("focusLabel"),c=/__name__/.test(u||""),s=(null===(t=i[0])||void 0===t?void 0:t.value)/r*100,f=[{title:"Total series",value:n.toLocaleString("en-US"),display:!l,info:'The total number of active time series. \n A time series is uniquely identified by its name plus a set of its labels. \n For example, temperature{city="NY",country="US"} and temperature{city="SF",country="US"} \n are two distinct series, since they differ by the city label.'},{title:"Percentage from total",value:isNaN(s)?"-":"".concat(s.toFixed(2),"%"),display:c,info:"The share of these series in the total number of time series."}].filter((function(e){return e.display}));return f.length?Bt("div",{className:dr()({"vm-cardinality-totals":!0,"vm-cardinality-totals_mobile":a}),children:f.map((function(e){var t=e.title,n=e.value,r=e.info;return Bt("div",{className:"vm-cardinality-totals-card",children:[Bt("div",{className:"vm-cardinality-totals-card-header",children:[r&&Bt(ti,{title:Bt("p",{className:"vm-cardinality-totals-card-header__tooltip",children:r}),children:Bt("div",{className:"vm-cardinality-totals-card-header__info-icon",children:Bt(On,{})})}),Bt("h4",{className:"vm-cardinality-totals-card-header__title",children:t})]}),Bt("span",{className:"vm-cardinality-totals-card__value",children:n})]},t)}))}):null},qs=function(e){var t=Rr().isMobile,n=v(nt(),2),i=n[0],a=n[1],o=i.get("tips")||"",u=v((0,r.useState)(i.get("match")||""),2),l=u[0],c=u[1],s=v((0,r.useState)(i.get("focusLabel")||""),2),f=s[0],d=s[1],h=v((0,r.useState)(+(i.get("topN")||10)),2),p=h[0],m=h[1],g=(0,r.useMemo)((function(){return p<0?"Number must be bigger than zero":""}),[p]),y=function(){i.set("match",l),i.set("topN",p.toString()),i.set("focusLabel",f),a(i)};return(0,r.useEffect)((function(){var e=i.get("match"),t=+(i.get("topN")||10),n=i.get("focusLabel");e!==l&&c(e||""),t!==p&&m(t),n!==f&&d(n||"")}),[i]),Bt("div",{className:dr()({"vm-cardinality-configurator":!0,"vm-cardinality-configurator_mobile":t,"vm-block":!0,"vm-block_mobile":t}),children:[Bt("div",{className:"vm-cardinality-configurator-controls",children:[Bt("div",{className:"vm-cardinality-configurator-controls__query",children:Bt(li,{label:"Time series selector",type:"string",value:l,onChange:c,onEnter:y})}),Bt("div",{className:"vm-cardinality-configurator-controls__item",children:Bt(li,{label:"Focus label",type:"text",value:f||"",onChange:d,onEnter:y,endIcon:Bt(ti,{title:Bt("div",{children:Bt("p",{children:"To identify values with the highest number of series for the selected label."})}),children:Bt(ar,{})})})}),Bt("div",{className:"vm-cardinality-configurator-controls__item vm-cardinality-configurator-controls__item_limit",children:Bt(li,{label:"Limit entries",type:"number",value:p,error:g,onChange:function(e){var t=+e;m(isNaN(t)?0:t)},onEnter:y})})]}),Bt("div",{className:"vm-cardinality-configurator-bottom",children:[Bt(Us,ot({},e)),Bt("div",{className:"vm-cardinality-configurator-bottom-helpful",children:Bt("a",{className:"vm-link vm-link_with-icon",target:"_blank",href:"https://docs.victoriametrics.com/#cardinality-explorer",rel:"help noreferrer",children:[Bt(rr,{}),"Documentation"]})}),Bt("div",{className:"vm-cardinality-configurator-bottom__execute",children:[Bt(ti,{title:o?"Hide tips":"Show tips",children:Bt(Jr,{variant:"text",color:o?"warning":"gray",startIcon:Bt(cr,{}),onClick:function(){i.get("tips")||""?i.delete("tips"):i.set("tips","true"),a(i)}})}),Bt(Jr,{variant:"text",startIcon:Bt(Fn,{}),onClick:function(){i.set("match",""),i.set("focusLabel",""),a(i)},children:"Reset"}),Bt(Jr,{startIcon:Bt(Hn,{}),onClick:y,children:"Execute Query"})]})]})]})};function Ws(e){var t=e.order,n=e.orderBy,r=e.onRequestSort,i=e.headerCells;return Bt("thead",{className:"vm-table-header",children:Bt("tr",{className:"vm-table__row vm-table__row_header",children:i.map((function(e){return Bt("th",{className:dr()({"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:Bt("div",{className:"vm-table-cell__content",children:[e.info?Bt(ti,{title:e.info,children:[Bt("div",{className:"vm-metrics-content-header__tip-icon",children:Bt(On,{})}),e.label]}):Bt(Ot.HY,{children:e.label}),"action"!==e.id&&"percentage"!==e.id&&Bt("div",{className:dr()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:Bt(Rn,{})})]})},e.id);var i}))})})}function Qs(e,t,n){return t[n]