diff --git a/README.md b/README.md index 0bed089de..22f7f0e02 100644 --- a/README.md +++ b/README.md @@ -271,6 +271,8 @@ Prometheus doesn't drop data during VictoriaMetrics restart. See [this article]( VictoriaMetrics provides UI for query troubleshooting and exploration. The UI is available at `http://victoriametrics:8428/vmui`. The UI allows exploring query results via graphs and tables. It also provides the following features: + +- [metrics explorer](#metrics-explorer) - [cardinality explorer](#cardinality-explorer) - [query tracer](#query-tracing) - [top queries explorer](#top-queries) @@ -306,6 +308,18 @@ See the [example VMUI at VictoriaMetrics playground](https://play.victoriametric * queries with the biggest average execution duration; * queries that took the most summary time for execution. +## Metrics explorer + +[VMUI](#vmui) provides an ability to explore metrics exported by a particular `job` / `instance` in the following way: + +1. Open the `vmui` at `http://victoriametrics:8428/vmui/`. +2. Click the `Explore metrics` tab. +3. Select the `job` you want to explore. +4. Optionally select the `instance` for the selected job to explore. +5. Select metrics you want to explore and compare. + +It is possible to change the selected time range for the graphs in the top right corner. + ## Cardinality explorer VictoriaMetrics provides an ability to explore time series cardinality at `cardinality` tab in [vmui](#vmui) in the following ways: diff --git a/app/vmselect/vmui/asset-manifest.json b/app/vmselect/vmui/asset-manifest.json index c3a691369..f102749b5 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.fdc77f08.css", - "main.js": "./static/js/main.ca04fac1.js", + "main.css": "./static/css/main.74a50bcc.css", + "main.js": "./static/js/main.698139ca.js", "static/js/27.c1ccfd29.chunk.js": "./static/js/27.c1ccfd29.chunk.js", "index.html": "./index.html" }, "entrypoints": [ - "static/css/main.fdc77f08.css", - "static/js/main.ca04fac1.js" + "static/css/main.74a50bcc.css", + "static/js/main.698139ca.js" ] } \ No newline at end of file diff --git a/app/vmselect/vmui/index.html b/app/vmselect/vmui/index.html index 698a9a6f4..b1bcf8e5b 100644 --- a/app/vmselect/vmui/index.html +++ b/app/vmselect/vmui/index.html @@ -1 +1 @@ -
'+(n?e:Cf(e,!0))+"
\n":""+(n?e:Cf(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?""+Cf(e.message+"",!0)+"";throw e}try{var l=Gf.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(ed.walkTokens(l,t.walkTokens)).then((function(){return Xf.parse(l,t)})).catch(u);ed.walkTokens(l,t.walkTokens)}return Xf.parse(l,t)}catch(s){u(s)}}ed.options=ed.setOptions=function(e){var t;return zf(ed.defaults,e),t=ed.defaults,gf=t,ed},ed.getDefaults=yf,ed.defaults=gf,ed.use=function(){for(var e=ed.defaults.extensions||{renderers:{},childTokens:{}},t=arguments.length,n=new Array(t),r=0;r
"+Cf(s.message+"",!0)+"";throw s}},ed.Parser=Xf,ed.parser=Xf.parse,ed.Renderer=Jf,ed.TextRenderer=Zf,ed.Lexer=Gf,ed.lexer=Gf.lex,ed.Tokenizer=Yf,ed.Slugger=Kf,ed.parse=ed;ed.options,ed.setOptions,ed.use,ed.walkTokens,ed.parseInline,Xf.parse,Gf.lex;var td=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=ai().period,c=ui(),s=ie(null),f=At(ee(!0),2),d=f[0],h=f[1],p=At(ee(l.step||1),2),v=p[0],m=p[1],g=At(ee({limits:{enable:!1,range:{1:[0,0]}}}),2),_=g[0],b=g[1],D=ae((function(){return Array.isArray(i)&&i.every((function(e){return e}))}),[i]),w=Gs({predefinedQuery:D?i:[],display:"chart",visible:d,customStep:v}),x=w.isLoading,k=w.graphData,C=w.error,E=w.warning,S=function(e){var t=or({},_);t.limits.range=e,b(t)};if(ne((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 wr(ko,{variant:"error",children:[wr("code",{children:'"expr"'})," not found. Check the configuration file ",wr("b",{children:a}),"."]});var A=function(){return wr("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&wr(y,{children:[wr("div",{children:[wr("span",{children:"Description:"}),wr("div",{dangerouslySetInnerHTML:{__html:ed.parse(n)}})]}),wr("hr",{})]}),wr("div",{children:[wr("span",{children:"Queries:"}),wr("div",{children:i.map((function(e,t){return wr("div",{children:e},"".concat(t,"_").concat(e))}))})]})]})};return wr("div",{className:"vm-predefined-panel",ref:s,children:[wr("div",{className:"vm-predefined-panel-header",children:[wr(Oo,{title:wr(A,{}),children:wr("div",{className:"vm-predefined-panel-header__info",children:wr(_i,{})})}),wr("h3",{className:"vm-predefined-panel-header__title",children:t||""}),wr("div",{className:"vm-predefined-panel-header__step",children:wr(zs,{defaultStep:l.step,setStep:m})}),wr(Xs,{yaxis:_,setYaxisLimits:S,toggleEnableLimits:function(){var e=or({},_);e.limits.enable=!e.limits.enable,b(e)}})]}),wr("div",{className:"vm-predefined-panel-body",children:[x&&wr(ef,{}),C&&wr(ko,{variant:"error",children:C}),E&&wr(ko,{variant:"warning",children:E}),k&&wr(Ms,{data:k,period:l,customStep:v,query:i,yaxis:_,unit:r,alias:u,showLegend:o,setYaxisLimits:S,setPeriod:function(e){var t=e.from,n=e.to;c({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1})]})]})},nd=function(e){var t=e.index,n=e.title,r=e.panels,i=e.filename,o=Gi(document.body),a=ae((function(){return o.width/12}),[o]),u=At(ee(!t),2),l=u[0],c=u[1],s=At(ee([]),2),f=s[0],d=s[1];ne((function(){d(r&&r.map((function(e){return e.width||12})))}),[r]);var h=At(ee({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(or(or({},p),{},{enable:!1}))},g=function(e){return function(t){!function(e,t){v({start:e.clientX,target:t,enable:!0})}(t,e)}};return ne((function(){return window.addEventListener("mousemove",m),window.addEventListener("mouseup",y),function(){window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",y)}}),[p]),wr("div",{className:"vm-predefined-dashboard",children:wr(Ko,{defaultExpanded:l,onChange:function(e){return c(e)},title:wr((function(){return wr("div",{className:qi()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":l}),children:[(n||i)&&wr("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(i)}),r&&wr("span",{className:"vm-predefined-dashboard-header__count",children:["(",r.length," panels)"]})]})}),{}),children:wr("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(r)&&r.length?r.map((function(e,t){return wr("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(f[t])},children:[wr(td,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:i,showLegend:e.showLegend}),wr("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:g(t)})]},t)})):wr("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:wr(ko,{variant:"error",children:[wr("code",{children:'"panels"'})," not found. Check the configuration file ",wr("b",{children:i}),"."]})})})})})},rd=function(){!function(){var e=ai(),t=e.duration,n=e.relativeTime,r=e.period,i=r.date,o=r.step,a=function(){var e,r=ff((rr(e={},"g0.range_input",t),rr(e,"g0.end_input",i),rr(e,"g0.step_input",o),rr(e,"g0.relative_time",n),e));yr(r)};ne(a,[t,n,i,o]),ne(a,[])}();var e=At(ee([]),2),t=e[0],n=e[1],r=At(ee("0"),2),i=r[0],o=r[1],a=ae((function(){return t.map((function(e,t){return{label:e.title||"",value:"".concat(t),className:"vm-predefined-panels-tabs__tab"}}))}),[t]),u=ae((function(){return t[+i]||{}}),[t,i]),l=ae((function(){return null===u||void 0===u?void 0:u.rows}),[u]),c=ae((function(){return u.title||u.filename||""}),[u]),s=ae((function(){return Array.isArray(l)&&!!l.length}),[l]);return ne((function(){mf().then((function(e){return e.length&&n(e)}))}),[]),wr("div",{className:"vm-predefined-panels",children:[!t.length&&wr(ko,{variant:"info",children:"Dashboards not found"}),a.length>1&&wr("div",{className:"vm-predefined-panels-tabs vm-block vm-block_empty-padding",children:wr(Ji,{activeItem:i,items:a,onChange:function(e){o(e)}})}),wr("div",{className:"vm-predefined-panels__dashboards",children:[s&&l.map((function(e,t){return wr(nd,{index:t,filename:c,title:e.title,panels:e.panels},"".concat(i,"_").concat(t))})),!!t.length&&!s&&wr(ko,{variant:"error",children:[wr("code",{children:'"rows"'})," not found. Check the configuration file ",wr("b",{children:c}),"."]})]})]})},id=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)},od=function(){function e(){Nt(this,e),this.tsdbStatus=void 0,this.tabsNames=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"]}return Bt(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 or(or({},t),{},{tabs:or(or({},t.tabs),{},rr({},n,e.tabsNames)),containerRefs:or(or({},t.containerRefs),{},rr({},n,ie(null))),defaultActiveTab:or(or({},t.defaultActiveTab),{},rr({},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:ad,seriesCountByLabelName:ud,seriesCountByFocusLabelValue:ld,seriesCountByLabelValuePair:cd,labelValueCountByLabelName:sd}}},{key:"totalSeries",value:function(e){return"labelValueCountByLabelName"===e?-1:this.tsdbStatus.totalSeries}}]),e}(),ad=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],ud=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],ld=[{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}],cd=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],sd=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:"Action"}],fd={seriesCountByMetricName:function(e,t){return dd("__name__",t)},seriesCountByLabelName:function(e,t){return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:function(e,t){return dd(e,t)},seriesCountByLabelValuePair:function(e,t){var n=t.split("="),r=n[0],i=n.slice(1).join("=");return dd(r,i)},labelValueCountByLabelName:function(e,t){return"{".concat(t,'!=""}')}},dd=function(e,t){return e?"{"+e+"="+JSON.stringify(t)+"}":""},hd=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=di().autocomplete,v=hi(),m=tf().queryOptions,y=ae((function(){return t<1?"Number must be bigger than zero":""}),[t]);return wr("div",{className:"vm-cardinality-configurator vm-block",children:[wr("div",{className:"vm-cardinality-configurator-controls",children:[wr("div",{className:"vm-cardinality-configurator-controls__query",children:wr(Is,{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"})}),wr("div",{className:"vm-cardinality-configurator-controls__item",children:wr(qo,{label:"Number of entries per table",type:"number",value:t,error:y,onChange:u})}),wr("div",{className:"vm-cardinality-configurator-controls__item",children:wr(qo,{label:"Focus label",type:"text",value:h||"",onChange:l})}),wr("div",{className:"vm-cardinality-configurator-controls__item",children:wr(js,{label:"Autocomplete",value:p,onChange:function(){v({type:"TOGGLE_AUTOCOMPLETE"})}})})]}),wr("div",{className:"vm-cardinality-configurator-bottom",children:[wr("div",{className:"vm-cardinality-configurator-bottom__info",children:["Analyzed ",wr("b",{children:c})," series with ",wr("b",{children:s}),' "label=value" pairs at ',wr("b",{children:f}),d&&wr("span",{children:[" for series selector ",wr("b",{children:d})]}),". Show top ",t," entries per table."]}),wr(Ao,{startIcon:wr(Ti,{}),onClick:o,children:"Execute Query"})]})]})};function pd(e){var t=e.order,n=e.orderBy,r=e.onRequestSort,i=e.headerCells;return wr("thead",{className:"vm-table-header",children:wr("tr",{className:"vm-table__row vm-table__row_header",children:i.map((function(e){return wr("th",{className:qi()({"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:wr("div",{className:"vm-table-cell__content",children:[e.label,"action"!==e.id&&"percentage"!==e.id&&wr("div",{className:qi()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:wr(Ci,{})})]})},e.id);var i}))})})}function vd(e,t,n){return t[n]
'+(n?e:Df(e,!0))+"
\n":""+(n?e:Df(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?""+Df(e.message+"",!0)+"";throw e}try{var l=Vf.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(Zf.walkTokens(l,t.walkTokens)).then((function(){return Gf.parse(l,t)})).catch(u);Zf.walkTokens(l,t.walkTokens)}return Gf.parse(l,t)}catch(c){u(c)}}Zf.options=Zf.setOptions=function(e){var t;return Bf(Zf.defaults,e),t=Zf.defaults,pf=t,Zf},Zf.getDefaults=hf,Zf.defaults=pf,Zf.use=function(){for(var e=Zf.defaults.extensions||{renderers:{},childTokens:{}},t=arguments.length,n=new Array(t),r=0;r
"+Df(c.message+"",!0)+"";throw c}},Zf.Parser=Gf,Zf.parser=Gf.parse,Zf.Renderer=qf,Zf.TextRenderer=Wf,Zf.Lexer=Vf,Zf.lexer=Vf.lex,Zf.Tokenizer=Rf,Zf.Slugger=Qf,Zf.parse=Zf;Zf.options,Zf.setOptions,Zf.use,Zf.walkTokens,Zf.parseInline,Gf.parse,Vf.lex;var Jf=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=oi().period,c=ai(),s=re(null),f=St(X(!0),2),d=f[0],h=f[1],p=St(X(l.step||1),2),v=p[0],y=p[1],g=St(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=Vs({predefinedQuery:D?i:[],display:"chart",visible:d,customStep:v}),x=w.isLoading,k=w.graphData,C=w.error,E=w.warning,S=function(e){var t=lr({},_);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 Dr(bo,{variant:"error",children:[Dr("code",{children:'"expr"'})," not found. Check the configuration file ",Dr("b",{children:a}),"."]});var A=function(){return Dr("div",{className:"vm-predefined-panel-header__description vm-default-styles",children:[n&&Dr(m,{children:[Dr("div",{children:[Dr("span",{children:"Description:"}),Dr("div",{dangerouslySetInnerHTML:{__html:Zf.parse(n)}})]}),Dr("hr",{})]}),Dr("div",{children:[Dr("span",{children:"Queries:"}),Dr("div",{children:i.map((function(e,t){return Dr("div",{children:e},"".concat(t,"_").concat(e))}))})]})]})};return Dr("div",{className:"vm-predefined-panel",ref:s,children:[Dr("div",{className:"vm-predefined-panel-header",children:[Dr(So,{title:Dr(A,{}),children:Dr("div",{className:"vm-predefined-panel-header__info",children:Dr(gi,{})})}),Dr("h3",{className:"vm-predefined-panel-header__title",children:t||""}),Dr("div",{className:"vm-predefined-panel-header__step",children:Dr(Bs,{defaultStep:l.step,setStep:y})}),Dr(Gs,{yaxis:_,setYaxisLimits:S,toggleEnableLimits:function(){var e=lr({},_);e.limits.enable=!e.limits.enable,b(e)}})]}),Dr("div",{className:"vm-predefined-panel-body",children:[x&&Dr(Zs,{}),C&&Dr(bo,{variant:"error",children:C}),E&&Dr(bo,{variant:"warning",children:E}),k&&Dr(Fs,{data:k,period:l,customStep:v,query:i,yaxis:_,unit:r,alias:u,showLegend:o,setYaxisLimits:S,setPeriod:function(e){var t=e.from,n=e.to;c({type:"SET_PERIOD",payload:{from:t,to:n}})},fullWidth:!1})]})]})},Kf=function(e){var t=e.index,n=e.title,r=e.panels,i=e.filename,o=qi(document.body),a=oe((function(){return o.width/12}),[o]),u=St(X(!t),2),l=u[0],c=u[1],s=St(X([]),2),f=s[0],d=s[1];te((function(){d(r&&r.map((function(e){return e.width||12})))}),[r]);var h=St(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(lr(lr({},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]),Dr("div",{className:"vm-predefined-dashboard",children:Dr(Qo,{defaultExpanded:l,onChange:function(e){return c(e)},title:Dr((function(){return Dr("div",{className:Hi()({"vm-predefined-dashboard-header":!0,"vm-predefined-dashboard-header_open":l}),children:[(n||i)&&Dr("span",{className:"vm-predefined-dashboard-header__title",children:n||"".concat(t+1,". ").concat(i)}),r&&Dr("span",{className:"vm-predefined-dashboard-header__count",children:["(",r.length," panels)"]})]})}),{}),children:Dr("div",{className:"vm-predefined-dashboard-panels",children:Array.isArray(r)&&r.length?r.map((function(e,t){return Dr("div",{className:"vm-predefined-dashboard-panels-panel vm-block vm-block_empty-padding",style:{gridColumn:"span ".concat(f[t])},children:[Dr(Jf,{title:e.title,description:e.description,unit:e.unit,expr:e.expr,alias:e.alias,filename:i,showLegend:e.showLegend}),Dr("button",{className:"vm-predefined-dashboard-panels-panel__resizer",onMouseDown:g(t)})]},t)})):Dr("div",{className:"vm-predefined-dashboard-panels-panel__alert",children:Dr(bo,{variant:"error",children:[Dr("code",{children:'"panels"'})," not found. Check the configuration file ",Dr("b",{children:i}),"."]})})})})})},Xf=function(){!function(){var e=oi(),t=e.duration,n=e.relativeTime,r=e.period,i=r.date,o=r.step,a=function(){var e,r=uf((nr(e={},"g0.range_input",t),nr(e,"g0.end_input",i),nr(e,"g0.step_input",o),nr(e,"g0.relative_time",n),e));mr(r)};te(a,[t,n,i,o]),te(a,[])}();var e=St(X([]),2),t=e[0],n=e[1],r=St(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(){df().then((function(e){return e.length&&n(e)}))}),[]),Dr("div",{className:"vm-predefined-panels",children:[!t.length&&Dr(bo,{variant:"info",children:"Dashboards not found"}),a.length>1&&Dr("div",{className:"vm-predefined-panels-tabs vm-block vm-block_empty-padding",children:Dr(Wi,{activeItem:i,items:a,onChange:function(e){o(e)}})}),Dr("div",{className:"vm-predefined-panels__dashboards",children:[s&&l.map((function(e,t){return Dr(Kf,{index:t,filename:c,title:e.title,panels:e.panels},"".concat(i,"_").concat(t))})),!!t.length&&!s&&Dr(bo,{variant:"error",children:[Dr("code",{children:'"rows"'})," not found. Check the configuration file ",Dr("b",{children:c}),"."]})]})]})},ed=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)},td=function(){function e(){Ft(this,e),this.tsdbStatus=void 0,this.tabsNames=void 0,this.tsdbStatus=this.defaultTSDBStatus,this.tabsNames=["table","graph"]}return Mt(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 lr(lr({},t),{},{tabs:lr(lr({},t.tabs),{},nr({},n,e.tabsNames)),containerRefs:lr(lr({},t.containerRefs),{},nr({},n,re(null))),defaultActiveTab:lr(lr({},t.defaultActiveTab),{},nr({},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:nd,seriesCountByLabelName:rd,seriesCountByFocusLabelValue:id,seriesCountByLabelValuePair:od,labelValueCountByLabelName:ad}}},{key:"totalSeries",value:function(e){return"labelValueCountByLabelName"===e?-1:this.tsdbStatus.totalSeries}}]),e}(),nd=[{id:"name",label:"Metric name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],rd=[{id:"name",label:"Label name"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],id=[{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}],od=[{id:"name",label:"Label=value pair"},{id:"value",label:"Number of series"},{id:"percentage",label:"Percent of series"},{id:"action",label:"Action"}],ad=[{id:"name",label:"Label name"},{id:"value",label:"Number of unique values"},{id:"action",label:"Action"}],ud={seriesCountByMetricName:function(e,t){return ld("__name__",t)},seriesCountByLabelName:function(e,t){return"{".concat(t,'!=""}')},seriesCountByFocusLabelValue:function(e,t){return ld(e,t)},seriesCountByLabelValuePair:function(e,t){var n=t.split("="),r=n[0],i=n.slice(1).join("=");return ld(r,i)},labelValueCountByLabelName:function(e,t){return"{".concat(t,'!=""}')}},ld=function(e,t){return e?"{"+e+"="+JSON.stringify(t)+"}":""},cd=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=fi().autocomplete,v=di(),m=Js().queryOptions,y=oe((function(){return t<1?"Number must be bigger than zero":""}),[t]);return Dr("div",{className:"vm-cardinality-configurator vm-block",children:[Dr("div",{className:"vm-cardinality-configurator-controls",children:[Dr("div",{className:"vm-cardinality-configurator-controls__query",children:Dr(Os,{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"})}),Dr("div",{className:"vm-cardinality-configurator-controls__item",children:Dr(Uo,{label:"Number of entries per table",type:"number",value:t,error:y,onChange:u})}),Dr("div",{className:"vm-cardinality-configurator-controls__item",children:Dr(Uo,{label:"Focus label",type:"text",value:h||"",onChange:l})}),Dr("div",{className:"vm-cardinality-configurator-controls__item",children:Dr(Ps,{label:"Autocomplete",value:p,onChange:function(){v({type:"TOGGLE_AUTOCOMPLETE"})}})})]}),Dr("div",{className:"vm-cardinality-configurator-bottom",children:[Dr("div",{className:"vm-cardinality-configurator-bottom__info",children:["Analyzed ",Dr("b",{children:c})," series with ",Dr("b",{children:s}),' "label=value" pairs at ',Dr("b",{children:f}),d&&Dr("span",{children:[" for series selector ",Dr("b",{children:d})]}),". Show top ",t," entries per table."]}),Dr(ko,{startIcon:Dr(Ni,{}),onClick:o,children:"Execute Query"})]})]})};function sd(e){var t=e.order,n=e.orderBy,r=e.onRequestSort,i=e.headerCells;return Dr("thead",{className:"vm-table-header",children:Dr("tr",{className:"vm-table__row vm-table__row_header",children:i.map((function(e){return Dr("th",{className:Hi()({"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:Dr("div",{className:"vm-table-cell__content",children:[e.label,"action"!==e.id&&"percentage"!==e.id&&Dr("div",{className:Hi()({"vm-table__sort-icon":!0,"vm-table__sort-icon_active":n===e.id,"vm-table__sort-icon_desc":"desc"===t&&n===e.id}),children:Dr(Ci,{})})]})},e.id);var i}))})})}function fd(e,t,n){return t[n]
rate()
}
+ label={rate()}
value={rateEnabled}
onChange={setRateEnabled}
/>
@@ -69,7 +69,6 @@ const ExploreMetricItem: FC