diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 471dae809..9f98964b7 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -17,6 +17,11 @@ jobs: with: go-version: 1.19.4 id: go + - name: Setup docker scan + run: | + mkdir -p ~/.docker/cli-plugins && \ + curl https://github.com/docker/scan-cli-plugin/releases/latest/download/docker-scan_linux_amd64 -L -s -S -o ~/.docker/cli-plugins/docker-scan &&\ + chmod +x ~/.docker/cli-plugins/docker-scan - name: Code checkout uses: actions/checkout@master - name: Publish diff --git a/Makefile b/Makefile index 7a26efdc4..986411600 100644 --- a/Makefile +++ b/Makefile @@ -167,10 +167,10 @@ vmutils-crossbuild: \ vmutils-windows-amd64 publish-release: - git checkout $(TAG) && $(MAKE) release publish && \ - git checkout $(TAG)-cluster && $(MAKE) release publish && \ - git checkout $(TAG)-enterprise && $(MAKE) release publish && \ - git checkout $(TAG)-enterprise-cluster && $(MAKE) release publish + git checkout $(TAG) && LATEST_TAG=stable $(MAKE) release publish && \ + git checkout $(TAG)-cluster && LATEST_TAG=cluster-stable $(MAKE) release publish && \ + git checkout $(TAG)-enterprise && LATEST_TAG=enterprise-stable $(MAKE) release publish && \ + git checkout $(TAG)-enterprise-cluster && LATEST_TAG=enterprise-cluster-stable $(MAKE) release publish release: \ release-victoria-metrics \ @@ -383,7 +383,7 @@ golangci-lint: install-golangci-lint golangci-lint run --exclude '(SA4003|SA1019|SA5011):' -D errcheck -D structcheck --timeout 2m install-golangci-lint: - which golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.48.0 + which golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.50.1 govulncheck: install-govulncheck govulncheck ./... diff --git a/README.md b/README.md index 987386529..0bed089de 100644 --- a/README.md +++ b/README.md @@ -363,7 +363,7 @@ DataDog agent allows configuring destinations for metrics sending via ENV variab or via [configuration file](https://docs.datadoghq.com/agent/guide/agent-configuration-files/) in section `dd_url`.
- +
To configure DataDog agent via ENV variable add the following prefix: @@ -397,7 +397,7 @@ DataDog allows configuring [Dual Shipping](https://docs.datadoghq.com/agent/guid sending via ENV variable `DD_ADDITIONAL_ENDPOINTS` or via configuration file `additional_endpoints`.- +
Run DataDog using the following ENV variable with VictoriaMetrics as additional metrics receiver: diff --git a/app/vmagent/remotewrite/relabel.go b/app/vmagent/remotewrite/relabel.go index 1b796e24c..44147439c 100644 --- a/app/vmagent/remotewrite/relabel.go +++ b/app/vmagent/remotewrite/relabel.go @@ -86,7 +86,7 @@ func initLabelsGlobal() { } func (rctx *relabelCtx) applyRelabeling(tss []prompbmarshal.TimeSeries, extraLabels []prompbmarshal.Label, pcs *promrelabel.ParsedConfigs) []prompbmarshal.TimeSeries { - if len(extraLabels) == 0 && pcs.Len() == 0 { + if len(extraLabels) == 0 && pcs.Len() == 0 && !*usePromCompatibleNaming { // Nothing to change. return tss } diff --git a/app/vmagent/remotewrite/relabel_test.go b/app/vmagent/remotewrite/relabel_test.go new file mode 100644 index 000000000..eb3540002 --- /dev/null +++ b/app/vmagent/remotewrite/relabel_test.go @@ -0,0 +1,49 @@ +package remotewrite + +import ( + "reflect" + "testing" + + "github.com/VictoriaMetrics/VictoriaMetrics/lib/prompbmarshal" + "github.com/VictoriaMetrics/VictoriaMetrics/lib/promrelabel" + "github.com/VictoriaMetrics/VictoriaMetrics/lib/promutils" +) + +func TestApplyRelabeling(t *testing.T) { + f := func(extraLabels []prompbmarshal.Label, pcs *promrelabel.ParsedConfigs, sTss, sExpTss string) { + rctx := &relabelCtx{} + tss, expTss := parseSeries(sTss), parseSeries(sExpTss) + gotTss := rctx.applyRelabeling(tss, extraLabels, pcs) + if !reflect.DeepEqual(gotTss, expTss) { + t.Fatalf("expected to have: \n%v;\ngot: \n%v", expTss, gotTss) + } + } + + f(nil, nil, "up", "up") + f([]prompbmarshal.Label{{Name: "foo", Value: "bar"}}, nil, "up", `up{foo="bar"}`) + f([]prompbmarshal.Label{{Name: "foo", Value: "bar"}}, nil, `up{foo="baz"}`, `up{foo="bar"}`) + + pcs, err := promrelabel.ParseRelabelConfigsData([]byte(` +- target_label: "foo" + replacement: "aaa" +- action: labeldrop + regex: "env.*" +`)) + if err != nil { + t.Fatalf("unexpected error: %s", err) + } + f(nil, pcs, `up{foo="baz", env="prod"}`, `up{foo="aaa"}`) + + oldVal := *usePromCompatibleNaming + *usePromCompatibleNaming = true + f(nil, nil, `foo.bar`, `foo_bar`) + *usePromCompatibleNaming = oldVal +} + +func parseSeries(data string) []prompbmarshal.TimeSeries { + var tss []prompbmarshal.TimeSeries + tss = append(tss, prompbmarshal.TimeSeries{ + Labels: promutils.MustNewLabelsFromString(data).GetLabels(), + }) + return tss +} diff --git a/app/vmalert/templates/template.go b/app/vmalert/templates/template.go index faab29a94..c932b5777 100644 --- a/app/vmalert/templates/template.go +++ b/app/vmalert/templates/template.go @@ -27,11 +27,11 @@ import ( "strconv" "strings" "sync" + textTpl "text/template" "time" - textTpl "text/template" - "github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/datasource" + "github.com/VictoriaMetrics/VictoriaMetrics/lib/formatutil" "github.com/VictoriaMetrics/VictoriaMetrics/lib/promutils" ) @@ -350,15 +350,7 @@ func templateFuncs() textTpl.FuncMap { if math.Abs(v) <= 1 || math.IsNaN(v) || math.IsInf(v, 0) { return fmt.Sprintf("%.4g", v), nil } - prefix := "" - for _, p := range []string{"ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi"} { - if math.Abs(v) < 1024 { - break - } - prefix = p - v /= 1024 - } - return fmt.Sprintf("%.4g%s", v, prefix), nil + return formatutil.HumanizeBytes(v), nil }, // humanizeDuration converts given seconds to a human-readable duration diff --git a/app/vmalert/templates/template_test.go b/app/vmalert/templates/template_test.go index 1dd3adfbd..d5378a434 100644 --- a/app/vmalert/templates/template_test.go +++ b/app/vmalert/templates/template_test.go @@ -1,6 +1,7 @@ package templates import ( + "math" "strings" "testing" textTpl "text/template" @@ -50,6 +51,31 @@ func TestTemplateFuncs(t *testing.T) { if !ok { t.Fatalf("unexpected mismatch") } + + formatting := func(funcName string, p interface{}, resultExpected string) { + t.Helper() + v := funcs[funcName] + fLocal := v.(func(s interface{}) (string, error)) + result, err := fLocal(p) + if err != nil { + t.Fatalf("unexpected error for %s(%f): %s", funcName, p, err) + } + if result != resultExpected { + t.Fatalf("unexpected result for %s(%f); got\n%s\nwant\n%s", funcName, p, result, resultExpected) + } + } + formatting("humanize1024", float64(0), "0") + formatting("humanize1024", math.Inf(0), "+Inf") + formatting("humanize1024", math.NaN(), "NaN") + formatting("humanize1024", float64(127087), "124.1ki") + formatting("humanize1024", float64(130137088), "124.1Mi") + formatting("humanize1024", float64(133260378112), "124.1Gi") + formatting("humanize1024", float64(136458627186688), "124.1Ti") + formatting("humanize1024", float64(139733634239168512), "124.1Pi") + formatting("humanize1024", float64(143087241460908556288), "124.1Ei") + formatting("humanize1024", float64(146521335255970361638912), "124.1Zi") + formatting("humanize1024", float64(150037847302113650318245888), "124.1Yi") + formatting("humanize1024", float64(153638755637364377925883789312), "1.271e+05Yi") } func mkTemplate(current, replacement interface{}) textTemplate { diff --git a/app/vmbackupmanager/README.md b/app/vmbackupmanager/README.md index efebe6f60..499c06397 100644 --- a/app/vmbackupmanager/README.md +++ b/app/vmbackupmanager/README.md @@ -158,7 +158,7 @@ The result on the GCS bucket. We see only 3 daily backups: * GET `/api/v1/backups` - returns list of backups in remote storage. Example output: ```json - ["daily/2022-10-06","daily/2022-10-10","hourly/2022-10-04:13","hourly/2022-10-06:12","hourly/2022-10-06:13","hourly/2022-10-10:14","hourly/2022-10-10:16","monthly/2022-10","weekly/2022-40","weekly/2022-41"] + [{"name":"daily/2022-11-30","size_bytes":26664689,"size":"25.429Mi"},{"name":"daily/2022-12-01","size_bytes":40160965,"size":"38.300Mi"},{"name":"hourly/2022-11-30:12","size_bytes":5846529,"size":"5.576Mi"},{"name":"hourly/2022-11-30:13","size_bytes":17651847,"size":"16.834Mi"},{"name":"hourly/2022-11-30:13:22","size_bytes":8797831,"size":"8.390Mi"},{"name":"hourly/2022-11-30:14","size_bytes":10680454,"size":"10.186Mi"}] ``` * POST `/api/v1/restore` - saves backup name to restore when [performing restore](#restore-commands). @@ -211,7 +211,7 @@ It can be changed by using flag: `vmbackupmanager backup list` lists backups in remote storage: ```console $ ./vmbackupmanager backup list -["daily/2022-10-06","daily/2022-10-10","hourly/2022-10-04:13","hourly/2022-10-06:12","hourly/2022-10-06:13","hourly/2022-10-10:14","hourly/2022-10-10:16","monthly/2022-10","weekly/2022-40","weekly/2022-41"] +[{"name":"daily/2022-11-30","size_bytes":26664689,"size":"25.429Mi"},{"name":"daily/2022-12-01","size_bytes":40160965,"size":"38.300Mi"},{"name":"hourly/2022-11-30:12","size_bytes":5846529,"size":"5.576Mi"},{"name":"hourly/2022-11-30:13","size_bytes":17651847,"size":"16.834Mi"},{"name":"hourly/2022-11-30:13:22","size_bytes":8797831,"size":"8.390Mi"},{"name":"hourly/2022-11-30:14","size_bytes":10680454,"size":"10.186Mi"}] ``` ### Restore commands @@ -270,7 +270,15 @@ If restore mark doesn't exist at `storageDataPath`(restore wasn't requested) `vm ### How to restore in Kubernetes -1. Enter container running `vmbackupmanager` +1. Ensure there is an init container with `vmbackupmanager restore` in `vmstorage` or `vmsingle` pod. + For [VictoriaMetrics operator](https://docs.victoriametrics.com/operator/VictoriaMetrics-Operator.html) deployments it is required to add: + ```yaml + vmbackup: + restore: + onStart: "true" + ``` + See operator `VMStorage` schema [here](https://docs.victoriametrics.com/operator/api.html#vmstorage) and `VMSingle` [here](https://docs.victoriametrics.com/operator/api.html#vmsinglespec). +2. Enter container running `vmbackupmanager` 2. Use `vmbackupmanager backup list` to get list of available backups: ```console $ /vmbackupmanager-prod backup list @@ -287,6 +295,33 @@ If restore mark doesn't exist at `storageDataPath`(restore wasn't requested) `vm ``` 4. Restart pod +#### Restore cluster into another cluster + +These steps are assuming that [VictoriaMetrics operator](https://docs.victoriametrics.com/operator/VictoriaMetrics-Operator.html) is used to manage `VMCluster`. +Clusters here are referred to as `source` and `destination`. + +1. Create a new cluster with access to *source* cluster `vmbackupmanager` storage and same number of storage nodes. + Add the following section in order to enable restore on start (operator `VMStorage` schema can be found [here](https://docs.victoriametrics.com/operator/api.html#vmstorage): + ```yaml + vmbackup: + restore: + onStart: "true" + ``` + Note: it is safe to leave this section in the cluster configuration, since it will be ignored if restore mark doesn't exist. + > Important! Use different `-dst` for *destination* cluster to avoid overwriting backup data of the *source* cluster. +2. Enter container running `vmbackupmanager` in *source* cluster +2. Use `vmbackupmanager backup list` to get list of available backups: + ```console + $ /vmbackupmanager-prod backup list + ["daily/2022-10-06","daily/2022-10-10","hourly/2022-10-04:13","hourly/2022-10-06:12","hourly/2022-10-06:13","hourly/2022-10-10:14","hourly/2022-10-10:16","monthly/2022-10","weekly/2022-40","weekly/2022-41"] + ``` +3. Use `vmbackupmanager restore create` to create restore mark at each pod of the *destination* cluster. + Each pod in *destination* cluster should be restored from backup of respective pod in *source* cluster. + For example: `vmstorage-source-0` in *source* cluster should be restored from `vmstorage-destination-0` in *destination* cluster. + ```console + $ /vmbackupmanager-prod restore create s3://source_cluster/vmstorage-source-0/daily/2022-10-06 + ``` + ## Configuration ### Flags diff --git a/app/vmselect/promql/exec_test.go b/app/vmselect/promql/exec_test.go index 9f26e93a9..cfa204225 100644 --- a/app/vmselect/promql/exec_test.go +++ b/app/vmselect/promql/exec_test.go @@ -935,7 +935,7 @@ func TestExecSuccess(t *testing.T) { ))` r := netstorage.Result{ MetricName: metricNameExpected, - Values: []float64{nan, nan, nan, 1, nan, nan}, + Values: []float64{nan, nan, 1, 1, nan, nan}, Timestamps: timestampsExpected, } resultExpected := []netstorage.Result{r} @@ -6692,7 +6692,7 @@ func TestExecSuccess(t *testing.T) { q := `rate((2000-time())[100s])` r := netstorage.Result{ MetricName: metricNameExpected, - Values: []float64{5.5, 4.5, 3.5, 2.5, 1.5, 0.5}, + Values: []float64{5, 4, 3, 2, 1, 0}, Timestamps: timestampsExpected, } resultExpected := []netstorage.Result{r} @@ -6703,7 +6703,7 @@ func TestExecSuccess(t *testing.T) { q := `rate((2000-time())[100s:])` r := netstorage.Result{ MetricName: metricNameExpected, - Values: []float64{5.5, 4.5, 3.5, 2.5, 1.5, 0.5}, + Values: []float64{5, 4, 3, 2, 1, 0}, Timestamps: timestampsExpected, } resultExpected := []netstorage.Result{r} @@ -6714,7 +6714,7 @@ func TestExecSuccess(t *testing.T) { q := `rate((2000-time())[100s:100s])` r := netstorage.Result{ MetricName: metricNameExpected, - Values: []float64{0, 0, 6.5, 4.5, 2.5, 0.5}, + Values: []float64{0, 0, 6, 4, 2, 0}, Timestamps: timestampsExpected, } resultExpected := []netstorage.Result{r} @@ -6725,7 +6725,7 @@ func TestExecSuccess(t *testing.T) { q := `rate((2000-time())[100s:100s] offset 100s)` r := netstorage.Result{ MetricName: metricNameExpected, - Values: []float64{0, 0, 3.5, 5.5, 3.5, 1.5}, + Values: []float64{0, 0, 7, 5, 3, 1}, Timestamps: timestampsExpected, } resultExpected := []netstorage.Result{r} @@ -6736,7 +6736,7 @@ func TestExecSuccess(t *testing.T) { q := `rate((2000-time())[100s:100s] offset 100s)[:] offset 100s` r := netstorage.Result{ MetricName: metricNameExpected, - Values: []float64{0, 0, 0, 3.5, 5.5, 3.5}, + Values: []float64{0, 0, 0, 7, 5, 3}, Timestamps: timestampsExpected, } resultExpected := []netstorage.Result{r} diff --git a/app/vmselect/promql/rollup.go b/app/vmselect/promql/rollup.go index 06603aac2..8acb8aa09 100644 --- a/app/vmselect/promql/rollup.go +++ b/app/vmselect/promql/rollup.go @@ -145,11 +145,11 @@ var rollupAggrFuncs = map[string]rollupFunc{ "zscore_over_time": rollupZScoreOverTime, } -// VictoriaMetrics can increase lookbehind window in square brackets for these functions -// if the given window doesn't contain enough samples for calculations. +// VictoriaMetrics can extends lookbehind window for these functions +// in order to make sure it contains enough points for returning non-empty results. // -// This is needed in order to return the expected non-empty graphs when zooming in the graph in Grafana, -// which is built with `func_name(metric[$__interval])` query. +// This is needed for returning the expected non-empty graphs when zooming in the graph in Grafana, +// which is built with `func_name(metric)` query. var rollupFuncsCanAdjustWindow = map[string]bool{ "default_rollup": true, "deriv": true, @@ -584,15 +584,23 @@ func (rc *rollupConfig) doInternal(dstValues []float64, tsm *timeseriesMap, valu window := rc.Window if window <= 0 { window = rc.Step + if rc.MayAdjustWindow && window < maxPrevInterval { + // Adjust lookbehind window only if it isn't set explicilty, e.g. rate(foo). + // In the case of missing lookbehind window it should be adjusted in order to return non-empty graph + // when the window doesn't cover at least two raw samples (this is what most users expect). + // + // If the user explicitly sets the lookbehind window to some fixed value, e.g. rate(foo[1s]), + // then it is expected he knows what he is doing. Do not adjust the lookbehind window then. + // + // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3483 + window = maxPrevInterval + } if rc.isDefaultRollup && rc.LookbackDelta > 0 && window > rc.LookbackDelta { // Implicit window exceeds -search.maxStalenessInterval, so limit it to -search.maxStalenessInterval // according to https://github.com/VictoriaMetrics/VictoriaMetrics/issues/784 window = rc.LookbackDelta } } - if rc.MayAdjustWindow && window < maxPrevInterval { - window = maxPrevInterval - } rfa := getRollupFuncArg() rfa.idx = 0 rfa.window = window diff --git a/app/vmselect/vmui/asset-manifest.json b/app/vmselect/vmui/asset-manifest.json index 840d8843a..c3a691369 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.2d332988.js", + "main.js": "./static/js/main.ca04fac1.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.2d332988.js" + "static/js/main.ca04fac1.js" ] } \ No newline at end of file diff --git a/app/vmselect/vmui/index.html b/app/vmselect/vmui/index.html index a03847d3b..698a9a6f4 100644 --- a/app/vmselect/vmui/index.html +++ b/app/vmselect/vmui/index.html @@ -1 +1 @@ -'+(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]
'+(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]