diff --git a/app/vmalert/notifier/alertmanager_request.qtpl.go b/app/vmalert/notifier/alertmanager_request.qtpl.go index f3f7b193a6..8a6ce45e24 100644 --- a/app/vmalert/notifier/alertmanager_request.qtpl.go +++ b/app/vmalert/notifier/alertmanager_request.qtpl.go @@ -1,135 +1,135 @@ // Code generated by qtc from "alertmanager_request.qtpl". DO NOT EDIT. // See https://github.com/valyala/quicktemplate for details. -//line notifier/alertmanager_request.qtpl:1 +//line app/vmalert/notifier/alertmanager_request.qtpl:1 package notifier -//line notifier/alertmanager_request.qtpl:1 +//line app/vmalert/notifier/alertmanager_request.qtpl:1 import ( "time" "github.com/VictoriaMetrics/VictoriaMetrics/lib/promrelabel" ) -//line notifier/alertmanager_request.qtpl:8 +//line app/vmalert/notifier/alertmanager_request.qtpl:8 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) -//line notifier/alertmanager_request.qtpl:8 +//line app/vmalert/notifier/alertmanager_request.qtpl:8 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) -//line notifier/alertmanager_request.qtpl:8 +//line app/vmalert/notifier/alertmanager_request.qtpl:8 func streamamRequest(qw422016 *qt422016.Writer, alerts []Alert, generatorURL func(Alert) string, relabelCfg *promrelabel.ParsedConfigs) { -//line notifier/alertmanager_request.qtpl:8 +//line app/vmalert/notifier/alertmanager_request.qtpl:8 qw422016.N().S(`[`) -//line notifier/alertmanager_request.qtpl:10 +//line app/vmalert/notifier/alertmanager_request.qtpl:10 for i, alert := range alerts { -//line notifier/alertmanager_request.qtpl:10 +//line app/vmalert/notifier/alertmanager_request.qtpl:10 qw422016.N().S(`{"startsAt":`) -//line notifier/alertmanager_request.qtpl:12 +//line app/vmalert/notifier/alertmanager_request.qtpl:12 qw422016.N().Q(alert.Start.Format(time.RFC3339Nano)) -//line notifier/alertmanager_request.qtpl:12 +//line app/vmalert/notifier/alertmanager_request.qtpl:12 qw422016.N().S(`,"generatorURL":`) -//line notifier/alertmanager_request.qtpl:13 +//line app/vmalert/notifier/alertmanager_request.qtpl:13 qw422016.N().Q(generatorURL(alert)) -//line notifier/alertmanager_request.qtpl:13 +//line app/vmalert/notifier/alertmanager_request.qtpl:13 qw422016.N().S(`,`) -//line notifier/alertmanager_request.qtpl:14 +//line app/vmalert/notifier/alertmanager_request.qtpl:14 if !alert.End.IsZero() { -//line notifier/alertmanager_request.qtpl:14 +//line app/vmalert/notifier/alertmanager_request.qtpl:14 qw422016.N().S(`"endsAt":`) -//line notifier/alertmanager_request.qtpl:15 +//line app/vmalert/notifier/alertmanager_request.qtpl:15 qw422016.N().Q(alert.End.Format(time.RFC3339Nano)) -//line notifier/alertmanager_request.qtpl:15 +//line app/vmalert/notifier/alertmanager_request.qtpl:15 qw422016.N().S(`,`) -//line notifier/alertmanager_request.qtpl:16 +//line app/vmalert/notifier/alertmanager_request.qtpl:16 } -//line notifier/alertmanager_request.qtpl:16 +//line app/vmalert/notifier/alertmanager_request.qtpl:16 qw422016.N().S(`"labels": {"alertname":`) -//line notifier/alertmanager_request.qtpl:18 +//line app/vmalert/notifier/alertmanager_request.qtpl:18 qw422016.N().Q(alert.Name) -//line notifier/alertmanager_request.qtpl:19 +//line app/vmalert/notifier/alertmanager_request.qtpl:19 lbls := alert.toPromLabels(relabelCfg) -//line notifier/alertmanager_request.qtpl:20 +//line app/vmalert/notifier/alertmanager_request.qtpl:20 for _, l := range lbls { -//line notifier/alertmanager_request.qtpl:20 +//line app/vmalert/notifier/alertmanager_request.qtpl:20 qw422016.N().S(`,`) -//line notifier/alertmanager_request.qtpl:21 +//line app/vmalert/notifier/alertmanager_request.qtpl:21 qw422016.N().Q(l.Name) -//line notifier/alertmanager_request.qtpl:21 +//line app/vmalert/notifier/alertmanager_request.qtpl:21 qw422016.N().S(`:`) -//line notifier/alertmanager_request.qtpl:21 +//line app/vmalert/notifier/alertmanager_request.qtpl:21 qw422016.N().Q(l.Value) -//line notifier/alertmanager_request.qtpl:22 +//line app/vmalert/notifier/alertmanager_request.qtpl:22 } -//line notifier/alertmanager_request.qtpl:22 +//line app/vmalert/notifier/alertmanager_request.qtpl:22 qw422016.N().S(`},"annotations": {`) -//line notifier/alertmanager_request.qtpl:25 +//line app/vmalert/notifier/alertmanager_request.qtpl:25 c := len(alert.Annotations) -//line notifier/alertmanager_request.qtpl:26 +//line app/vmalert/notifier/alertmanager_request.qtpl:26 for k, v := range alert.Annotations { -//line notifier/alertmanager_request.qtpl:27 +//line app/vmalert/notifier/alertmanager_request.qtpl:27 c = c - 1 -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 qw422016.N().Q(k) -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 qw422016.N().S(`:`) -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 qw422016.N().Q(v) -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 if c > 0 { -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 qw422016.N().S(`,`) -//line notifier/alertmanager_request.qtpl:28 +//line app/vmalert/notifier/alertmanager_request.qtpl:28 } -//line notifier/alertmanager_request.qtpl:29 +//line app/vmalert/notifier/alertmanager_request.qtpl:29 } -//line notifier/alertmanager_request.qtpl:29 +//line app/vmalert/notifier/alertmanager_request.qtpl:29 qw422016.N().S(`}}`) -//line notifier/alertmanager_request.qtpl:32 +//line app/vmalert/notifier/alertmanager_request.qtpl:32 if i != len(alerts)-1 { -//line notifier/alertmanager_request.qtpl:32 +//line app/vmalert/notifier/alertmanager_request.qtpl:32 qw422016.N().S(`,`) -//line notifier/alertmanager_request.qtpl:32 +//line app/vmalert/notifier/alertmanager_request.qtpl:32 } -//line notifier/alertmanager_request.qtpl:33 +//line app/vmalert/notifier/alertmanager_request.qtpl:33 } -//line notifier/alertmanager_request.qtpl:33 +//line app/vmalert/notifier/alertmanager_request.qtpl:33 qw422016.N().S(`]`) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 } -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 func writeamRequest(qq422016 qtio422016.Writer, alerts []Alert, generatorURL func(Alert) string, relabelCfg *promrelabel.ParsedConfigs) { -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 qw422016 := qt422016.AcquireWriter(qq422016) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 streamamRequest(qw422016, alerts, generatorURL, relabelCfg) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 qt422016.ReleaseWriter(qw422016) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 } -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 func amRequest(alerts []Alert, generatorURL func(Alert) string, relabelCfg *promrelabel.ParsedConfigs) string { -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 qb422016 := qt422016.AcquireByteBuffer() -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 writeamRequest(qb422016, alerts, generatorURL, relabelCfg) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 qs422016 := string(qb422016.B) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 qt422016.ReleaseByteBuffer(qb422016) -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 return qs422016 -//line notifier/alertmanager_request.qtpl:35 +//line app/vmalert/notifier/alertmanager_request.qtpl:35 } diff --git a/app/vmalert/tpl/footer.qtpl.go b/app/vmalert/tpl/footer.qtpl.go index 7100c36bc7..fd5a0a1ce7 100644 --- a/app/vmalert/tpl/footer.qtpl.go +++ b/app/vmalert/tpl/footer.qtpl.go @@ -1,25 +1,25 @@ // Code generated by qtc from "footer.qtpl". DO NOT EDIT. // See https://github.com/valyala/quicktemplate for details. -//line tpl/footer.qtpl:1 +//line app/vmalert/tpl/footer.qtpl:1 package tpl -//line tpl/footer.qtpl:1 +//line app/vmalert/tpl/footer.qtpl:1 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) -//line tpl/footer.qtpl:1 +//line app/vmalert/tpl/footer.qtpl:1 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) -//line tpl/footer.qtpl:1 +//line app/vmalert/tpl/footer.qtpl:1 func StreamFooter(qw422016 *qt422016.Writer) { -//line tpl/footer.qtpl:1 +//line app/vmalert/tpl/footer.qtpl:1 qw422016.N().S(` </main> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script> @@ -56,31 +56,31 @@ func StreamFooter(qw422016 *qt422016.Writer) { </body> </html> `) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 } -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 func WriteFooter(qq422016 qtio422016.Writer) { -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 qw422016 := qt422016.AcquireWriter(qq422016) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 StreamFooter(qw422016) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 qt422016.ReleaseWriter(qw422016) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 } -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 func Footer() string { -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 qb422016 := qt422016.AcquireByteBuffer() -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 WriteFooter(qb422016) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 qs422016 := string(qb422016.B) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 qt422016.ReleaseByteBuffer(qb422016) -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 return qs422016 -//line tpl/footer.qtpl:36 +//line app/vmalert/tpl/footer.qtpl:36 } diff --git a/app/vmalert/tpl/header.qtpl.go b/app/vmalert/tpl/header.qtpl.go index 386cefac0e..1bc0adf7a9 100644 --- a/app/vmalert/tpl/header.qtpl.go +++ b/app/vmalert/tpl/header.qtpl.go @@ -1,39 +1,39 @@ // Code generated by qtc from "header.qtpl". DO NOT EDIT. // See https://github.com/valyala/quicktemplate for details. -//line tpl/header.qtpl:1 +//line app/vmalert/tpl/header.qtpl:1 package tpl -//line tpl/header.qtpl:1 +//line app/vmalert/tpl/header.qtpl:1 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) -//line tpl/header.qtpl:1 +//line app/vmalert/tpl/header.qtpl:1 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) -//line tpl/header.qtpl:1 +//line app/vmalert/tpl/header.qtpl:1 func StreamHeader(qw422016 *qt422016.Writer, title string, pages []NavItem) { -//line tpl/header.qtpl:1 +//line app/vmalert/tpl/header.qtpl:1 qw422016.N().S(` <!DOCTYPE html> <html lang="en"> <head> <title>vmalert`) -//line tpl/header.qtpl:5 +//line app/vmalert/tpl/header.qtpl:5 if title != "" { -//line tpl/header.qtpl:5 +//line app/vmalert/tpl/header.qtpl:5 qw422016.N().S(` - `) -//line tpl/header.qtpl:5 +//line app/vmalert/tpl/header.qtpl:5 qw422016.E().S(title) -//line tpl/header.qtpl:5 +//line app/vmalert/tpl/header.qtpl:5 } -//line tpl/header.qtpl:5 +//line app/vmalert/tpl/header.qtpl:5 qw422016.N().S(`</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <style> @@ -85,37 +85,37 @@ func StreamHeader(qw422016 *qt422016.Writer, title string, pages []NavItem) { </head> <body> `) -//line tpl/header.qtpl:55 +//line app/vmalert/tpl/header.qtpl:55 StreamPrintNavItems(qw422016, title, pages) -//line tpl/header.qtpl:55 +//line app/vmalert/tpl/header.qtpl:55 qw422016.N().S(` <main class="px-2"> `) -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 } -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 func WriteHeader(qq422016 qtio422016.Writer, title string, pages []NavItem) { -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 qw422016 := qt422016.AcquireWriter(qq422016) -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 StreamHeader(qw422016, title, pages) -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 qt422016.ReleaseWriter(qw422016) -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 } -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 func Header(title string, pages []NavItem) string { -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 qb422016 := qt422016.AcquireByteBuffer() -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 WriteHeader(qb422016, title, pages) -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 qs422016 := string(qb422016.B) -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 qt422016.ReleaseByteBuffer(qb422016) -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 return qs422016 -//line tpl/header.qtpl:57 +//line app/vmalert/tpl/header.qtpl:57 } diff --git a/app/vmalert/tpl/nav.qtpl.go b/app/vmalert/tpl/nav.qtpl.go index d4e7f56a0a..85b56266f7 100644 --- a/app/vmalert/tpl/nav.qtpl.go +++ b/app/vmalert/tpl/nav.qtpl.go @@ -1,96 +1,96 @@ // Code generated by qtc from "nav.qtpl". DO NOT EDIT. // See https://github.com/valyala/quicktemplate for details. -//line tpl/nav.qtpl:1 +//line app/vmalert/tpl/nav.qtpl:1 package tpl -//line tpl/nav.qtpl:1 +//line app/vmalert/tpl/nav.qtpl:1 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) -//line tpl/nav.qtpl:1 +//line app/vmalert/tpl/nav.qtpl:1 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) -//line tpl/nav.qtpl:2 +//line app/vmalert/tpl/nav.qtpl:2 type NavItem struct { Name string Url string } -//line tpl/nav.qtpl:8 +//line app/vmalert/tpl/nav.qtpl:8 func StreamPrintNavItems(qw422016 *qt422016.Writer, current string, items []NavItem) { -//line tpl/nav.qtpl:8 +//line app/vmalert/tpl/nav.qtpl:8 qw422016.N().S(` <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> <div class="container-fluid"> <div class="collapse navbar-collapse" id="navbarCollapse"> <ul class="navbar-nav me-auto mb-2 mb-md-0"> `) -//line tpl/nav.qtpl:13 +//line app/vmalert/tpl/nav.qtpl:13 for _, item := range items { -//line tpl/nav.qtpl:13 +//line app/vmalert/tpl/nav.qtpl:13 qw422016.N().S(` <li class="nav-item"> <a class="nav-link`) -//line tpl/nav.qtpl:15 +//line app/vmalert/tpl/nav.qtpl:15 if current == item.Name { -//line tpl/nav.qtpl:15 +//line app/vmalert/tpl/nav.qtpl:15 qw422016.N().S(` active`) -//line tpl/nav.qtpl:15 +//line app/vmalert/tpl/nav.qtpl:15 } -//line tpl/nav.qtpl:15 +//line app/vmalert/tpl/nav.qtpl:15 qw422016.N().S(`" href="`) -//line tpl/nav.qtpl:15 +//line app/vmalert/tpl/nav.qtpl:15 qw422016.E().S(item.Url) -//line tpl/nav.qtpl:15 +//line app/vmalert/tpl/nav.qtpl:15 qw422016.N().S(`"> `) -//line tpl/nav.qtpl:16 +//line app/vmalert/tpl/nav.qtpl:16 qw422016.E().S(item.Name) -//line tpl/nav.qtpl:16 +//line app/vmalert/tpl/nav.qtpl:16 qw422016.N().S(` </a> </li> `) -//line tpl/nav.qtpl:19 +//line app/vmalert/tpl/nav.qtpl:19 } -//line tpl/nav.qtpl:19 +//line app/vmalert/tpl/nav.qtpl:19 qw422016.N().S(` </ul> </div> </nav> `) -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 } -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 func WritePrintNavItems(qq422016 qtio422016.Writer, current string, items []NavItem) { -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 qw422016 := qt422016.AcquireWriter(qq422016) -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 StreamPrintNavItems(qw422016, current, items) -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 qt422016.ReleaseWriter(qw422016) -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 } -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 func PrintNavItems(current string, items []NavItem) string { -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 qb422016 := qt422016.AcquireByteBuffer() -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 WritePrintNavItems(qb422016, current, items) -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 qs422016 := string(qb422016.B) -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 qt422016.ReleaseByteBuffer(qb422016) -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 return qs422016 -//line tpl/nav.qtpl:23 +//line app/vmalert/tpl/nav.qtpl:23 } diff --git a/app/vmalert/web.qtpl.go b/app/vmalert/web.qtpl.go index c0720c1bba..4ff90f4156 100644 --- a/app/vmalert/web.qtpl.go +++ b/app/vmalert/web.qtpl.go @@ -1,10 +1,10 @@ // Code generated by qtc from "web.qtpl". DO NOT EDIT. // See https://github.com/valyala/quicktemplate for details. -//line web.qtpl:1 +//line app/vmalert/web.qtpl:1 package main -//line web.qtpl:3 +//line app/vmalert/web.qtpl:3 import ( "path" "sort" @@ -14,111 +14,111 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/tpl" ) -//line web.qtpl:13 +//line app/vmalert/web.qtpl:13 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) -//line web.qtpl:13 +//line app/vmalert/web.qtpl:13 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) -//line web.qtpl:13 +//line app/vmalert/web.qtpl:13 func StreamWelcome(qw422016 *qt422016.Writer) { -//line web.qtpl:13 +//line app/vmalert/web.qtpl:13 qw422016.N().S(` `) -//line web.qtpl:14 +//line app/vmalert/web.qtpl:14 tpl.StreamHeader(qw422016, "vmalert", navItems) -//line web.qtpl:14 +//line app/vmalert/web.qtpl:14 qw422016.N().S(` <p> API:<br> `) -//line web.qtpl:17 +//line app/vmalert/web.qtpl:17 for _, p := range apiLinks { -//line web.qtpl:17 +//line app/vmalert/web.qtpl:17 qw422016.N().S(` `) -//line web.qtpl:19 +//line app/vmalert/web.qtpl:19 p, doc := p[0], p[1] -//line web.qtpl:20 +//line app/vmalert/web.qtpl:20 qw422016.N().S(` <a href="`) -//line web.qtpl:21 +//line app/vmalert/web.qtpl:21 qw422016.E().S(p) -//line web.qtpl:21 +//line app/vmalert/web.qtpl:21 qw422016.N().S(`">`) -//line web.qtpl:21 +//line app/vmalert/web.qtpl:21 qw422016.E().S(p) -//line web.qtpl:21 +//line app/vmalert/web.qtpl:21 qw422016.N().S(`</a> - `) -//line web.qtpl:21 +//line app/vmalert/web.qtpl:21 qw422016.E().S(doc) -//line web.qtpl:21 +//line app/vmalert/web.qtpl:21 qw422016.N().S(`<br/> `) -//line web.qtpl:22 +//line app/vmalert/web.qtpl:22 } -//line web.qtpl:22 +//line app/vmalert/web.qtpl:22 qw422016.N().S(` </p> `) -//line web.qtpl:24 +//line app/vmalert/web.qtpl:24 tpl.StreamFooter(qw422016) -//line web.qtpl:24 +//line app/vmalert/web.qtpl:24 qw422016.N().S(` `) -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 } -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 func WriteWelcome(qq422016 qtio422016.Writer) { -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 qw422016 := qt422016.AcquireWriter(qq422016) -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 StreamWelcome(qw422016) -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 qt422016.ReleaseWriter(qw422016) -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 } -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 func Welcome() string { -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 qb422016 := qt422016.AcquireByteBuffer() -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 WriteWelcome(qb422016) -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 qs422016 := string(qb422016.B) -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 qt422016.ReleaseByteBuffer(qb422016) -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 return qs422016 -//line web.qtpl:25 +//line app/vmalert/web.qtpl:25 } -//line web.qtpl:27 +//line app/vmalert/web.qtpl:27 func StreamListGroups(qw422016 *qt422016.Writer, groups []APIGroup) { -//line web.qtpl:27 +//line app/vmalert/web.qtpl:27 qw422016.N().S(` `) -//line web.qtpl:28 +//line app/vmalert/web.qtpl:28 tpl.StreamHeader(qw422016, "Groups", navItems) -//line web.qtpl:28 +//line app/vmalert/web.qtpl:28 qw422016.N().S(` `) -//line web.qtpl:29 +//line app/vmalert/web.qtpl:29 if len(groups) > 0 { -//line web.qtpl:29 +//line app/vmalert/web.qtpl:29 qw422016.N().S(` `) -//line web.qtpl:31 +//line app/vmalert/web.qtpl:31 rOk := make(map[string]int) rNotOk := make(map[string]int) for _, g := range groups { @@ -131,111 +131,111 @@ func StreamListGroups(qw422016 *qt422016.Writer, groups []APIGroup) { } } -//line web.qtpl:42 +//line app/vmalert/web.qtpl:42 qw422016.N().S(` <a class="btn btn-primary" role="button" onclick="collapseAll()">Collapse All</a> <a class="btn btn-primary" role="button" onclick="expandAll()">Expand All</a> `) -//line web.qtpl:45 +//line app/vmalert/web.qtpl:45 for _, g := range groups { -//line web.qtpl:45 +//line app/vmalert/web.qtpl:45 qw422016.N().S(` <div class="group-heading`) -//line web.qtpl:46 +//line app/vmalert/web.qtpl:46 if rNotOk[g.Name] > 0 { -//line web.qtpl:46 +//line app/vmalert/web.qtpl:46 qw422016.N().S(` alert-danger`) -//line web.qtpl:46 +//line app/vmalert/web.qtpl:46 } -//line web.qtpl:46 +//line app/vmalert/web.qtpl:46 qw422016.N().S(`" data-bs-target="rules-`) -//line web.qtpl:46 +//line app/vmalert/web.qtpl:46 qw422016.E().S(g.ID) -//line web.qtpl:46 +//line app/vmalert/web.qtpl:46 qw422016.N().S(`"> <span class="anchor" id="group-`) -//line web.qtpl:47 +//line app/vmalert/web.qtpl:47 qw422016.E().S(g.ID) -//line web.qtpl:47 +//line app/vmalert/web.qtpl:47 qw422016.N().S(`"></span> <a href="#group-`) -//line web.qtpl:48 +//line app/vmalert/web.qtpl:48 qw422016.E().S(g.ID) -//line web.qtpl:48 +//line app/vmalert/web.qtpl:48 qw422016.N().S(`">`) -//line web.qtpl:48 +//line app/vmalert/web.qtpl:48 qw422016.E().S(g.Name) -//line web.qtpl:48 +//line app/vmalert/web.qtpl:48 if g.Type != "prometheus" { -//line web.qtpl:48 +//line app/vmalert/web.qtpl:48 qw422016.N().S(` (`) -//line web.qtpl:48 +//line app/vmalert/web.qtpl:48 qw422016.E().S(g.Type) -//line web.qtpl:48 +//line app/vmalert/web.qtpl:48 qw422016.N().S(`)`) -//line web.qtpl:48 +//line app/vmalert/web.qtpl:48 } -//line web.qtpl:48 +//line app/vmalert/web.qtpl:48 qw422016.N().S(` (every `) -//line web.qtpl:48 +//line app/vmalert/web.qtpl:48 qw422016.N().FPrec(g.Interval, 0) -//line web.qtpl:48 +//line app/vmalert/web.qtpl:48 qw422016.N().S(`s)</a> `) -//line web.qtpl:49 +//line app/vmalert/web.qtpl:49 if rNotOk[g.Name] > 0 { -//line web.qtpl:49 +//line app/vmalert/web.qtpl:49 qw422016.N().S(`<span class="badge bg-danger" title="Number of rules with status Error">`) -//line web.qtpl:49 +//line app/vmalert/web.qtpl:49 qw422016.N().D(rNotOk[g.Name]) -//line web.qtpl:49 +//line app/vmalert/web.qtpl:49 qw422016.N().S(`</span> `) -//line web.qtpl:49 +//line app/vmalert/web.qtpl:49 } -//line web.qtpl:49 +//line app/vmalert/web.qtpl:49 qw422016.N().S(` <span class="badge bg-success" title="Number of rules withs status Ok">`) -//line web.qtpl:50 +//line app/vmalert/web.qtpl:50 qw422016.N().D(rOk[g.Name]) -//line web.qtpl:50 +//line app/vmalert/web.qtpl:50 qw422016.N().S(`</span> <p class="fs-6 fw-lighter">`) -//line web.qtpl:51 +//line app/vmalert/web.qtpl:51 qw422016.E().S(g.File) -//line web.qtpl:51 +//line app/vmalert/web.qtpl:51 qw422016.N().S(`</p> `) -//line web.qtpl:52 +//line app/vmalert/web.qtpl:52 if len(g.Params) > 0 { -//line web.qtpl:52 +//line app/vmalert/web.qtpl:52 qw422016.N().S(` <div class="fs-6 fw-lighter">Extra params `) -//line web.qtpl:54 +//line app/vmalert/web.qtpl:54 for _, param := range g.Params { -//line web.qtpl:54 +//line app/vmalert/web.qtpl:54 qw422016.N().S(` <span class="float-left badge bg-primary">`) -//line web.qtpl:55 +//line app/vmalert/web.qtpl:55 qw422016.E().S(param) -//line web.qtpl:55 +//line app/vmalert/web.qtpl:55 qw422016.N().S(`</span> `) -//line web.qtpl:56 +//line app/vmalert/web.qtpl:56 } -//line web.qtpl:56 +//line app/vmalert/web.qtpl:56 qw422016.N().S(` </div> `) -//line web.qtpl:58 +//line app/vmalert/web.qtpl:58 } -//line web.qtpl:58 +//line app/vmalert/web.qtpl:58 qw422016.N().S(` </div> <div class="collapse" id="rules-`) -//line web.qtpl:60 +//line app/vmalert/web.qtpl:60 qw422016.E().S(g.ID) -//line web.qtpl:60 +//line app/vmalert/web.qtpl:60 qw422016.N().S(`"> <table class="table table-striped table-hover table-sm"> <thead> @@ -247,256 +247,256 @@ func StreamListGroups(qw422016 *qt422016.Writer, groups []APIGroup) { </thead> <tbody> `) -//line web.qtpl:70 +//line app/vmalert/web.qtpl:70 for _, r := range g.Rules { -//line web.qtpl:70 +//line app/vmalert/web.qtpl:70 qw422016.N().S(` <tr`) -//line web.qtpl:71 +//line app/vmalert/web.qtpl:71 if r.LastError != "" { -//line web.qtpl:71 +//line app/vmalert/web.qtpl:71 qw422016.N().S(` class="alert-danger"`) -//line web.qtpl:71 +//line app/vmalert/web.qtpl:71 } -//line web.qtpl:71 +//line app/vmalert/web.qtpl:71 qw422016.N().S(`> <td> <div class="row"> <div class="col-12 mb-2"> `) -//line web.qtpl:75 +//line app/vmalert/web.qtpl:75 if r.Type == "alerting" { -//line web.qtpl:75 +//line app/vmalert/web.qtpl:75 qw422016.N().S(` <b>alert:</b> `) -//line web.qtpl:76 +//line app/vmalert/web.qtpl:76 qw422016.E().S(r.Name) -//line web.qtpl:76 +//line app/vmalert/web.qtpl:76 qw422016.N().S(` (for: `) -//line web.qtpl:76 +//line app/vmalert/web.qtpl:76 qw422016.E().V(r.Duration) -//line web.qtpl:76 +//line app/vmalert/web.qtpl:76 qw422016.N().S(` seconds) `) -//line web.qtpl:77 +//line app/vmalert/web.qtpl:77 } else { -//line web.qtpl:77 +//line app/vmalert/web.qtpl:77 qw422016.N().S(` <b>record:</b> `) -//line web.qtpl:78 +//line app/vmalert/web.qtpl:78 qw422016.E().S(r.Name) -//line web.qtpl:78 +//line app/vmalert/web.qtpl:78 qw422016.N().S(` `) -//line web.qtpl:79 +//line app/vmalert/web.qtpl:79 } -//line web.qtpl:79 +//line app/vmalert/web.qtpl:79 qw422016.N().S(` </div> <div class="col-12"> <code><pre>`) -//line web.qtpl:82 +//line app/vmalert/web.qtpl:82 qw422016.E().S(r.Query) -//line web.qtpl:82 +//line app/vmalert/web.qtpl:82 qw422016.N().S(`</pre></code> </div> <div class="col-12 mb-2"> `) -//line web.qtpl:85 +//line app/vmalert/web.qtpl:85 if len(r.Labels) > 0 { -//line web.qtpl:85 +//line app/vmalert/web.qtpl:85 qw422016.N().S(` <b>Labels:</b>`) -//line web.qtpl:85 +//line app/vmalert/web.qtpl:85 } -//line web.qtpl:85 +//line app/vmalert/web.qtpl:85 qw422016.N().S(` `) -//line web.qtpl:86 +//line app/vmalert/web.qtpl:86 for k, v := range r.Labels { -//line web.qtpl:86 +//line app/vmalert/web.qtpl:86 qw422016.N().S(` <span class="ms-1 badge bg-primary">`) -//line web.qtpl:87 +//line app/vmalert/web.qtpl:87 qw422016.E().S(k) -//line web.qtpl:87 +//line app/vmalert/web.qtpl:87 qw422016.N().S(`=`) -//line web.qtpl:87 +//line app/vmalert/web.qtpl:87 qw422016.E().S(v) -//line web.qtpl:87 +//line app/vmalert/web.qtpl:87 qw422016.N().S(`</span> `) -//line web.qtpl:88 +//line app/vmalert/web.qtpl:88 } -//line web.qtpl:88 +//line app/vmalert/web.qtpl:88 qw422016.N().S(` </div> `) -//line web.qtpl:90 +//line app/vmalert/web.qtpl:90 if r.LastError != "" { -//line web.qtpl:90 +//line app/vmalert/web.qtpl:90 qw422016.N().S(` <div class="col-12"> <b>Error:</b> <div class="error-cell"> `) -//line web.qtpl:94 +//line app/vmalert/web.qtpl:94 qw422016.E().S(r.LastError) -//line web.qtpl:94 +//line app/vmalert/web.qtpl:94 qw422016.N().S(` </div> </div> `) -//line web.qtpl:97 +//line app/vmalert/web.qtpl:97 } -//line web.qtpl:97 +//line app/vmalert/web.qtpl:97 qw422016.N().S(` </div> </td> <td class="text-center">`) -//line web.qtpl:100 +//line app/vmalert/web.qtpl:100 qw422016.N().D(r.LastSamples) -//line web.qtpl:100 +//line app/vmalert/web.qtpl:100 qw422016.N().S(`</td> <td class="text-center">`) -//line web.qtpl:101 +//line app/vmalert/web.qtpl:101 qw422016.N().FPrec(time.Since(r.LastEvaluation).Seconds(), 3) -//line web.qtpl:101 +//line app/vmalert/web.qtpl:101 qw422016.N().S(`s ago</td> </tr> `) -//line web.qtpl:103 +//line app/vmalert/web.qtpl:103 } -//line web.qtpl:103 +//line app/vmalert/web.qtpl:103 qw422016.N().S(` </tbody> </table> </div> `) -//line web.qtpl:107 +//line app/vmalert/web.qtpl:107 } -//line web.qtpl:107 +//line app/vmalert/web.qtpl:107 qw422016.N().S(` `) -//line web.qtpl:109 +//line app/vmalert/web.qtpl:109 } else { -//line web.qtpl:109 +//line app/vmalert/web.qtpl:109 qw422016.N().S(` <div> <p>No items...</p> </div> `) -//line web.qtpl:113 +//line app/vmalert/web.qtpl:113 } -//line web.qtpl:113 +//line app/vmalert/web.qtpl:113 qw422016.N().S(` `) -//line web.qtpl:115 +//line app/vmalert/web.qtpl:115 tpl.StreamFooter(qw422016) -//line web.qtpl:115 +//line app/vmalert/web.qtpl:115 qw422016.N().S(` `) -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 } -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 func WriteListGroups(qq422016 qtio422016.Writer, groups []APIGroup) { -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 qw422016 := qt422016.AcquireWriter(qq422016) -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 StreamListGroups(qw422016, groups) -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 qt422016.ReleaseWriter(qw422016) -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 } -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 func ListGroups(groups []APIGroup) string { -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 qb422016 := qt422016.AcquireByteBuffer() -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 WriteListGroups(qb422016, groups) -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 qs422016 := string(qb422016.B) -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 qt422016.ReleaseByteBuffer(qb422016) -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 return qs422016 -//line web.qtpl:117 +//line app/vmalert/web.qtpl:117 } -//line web.qtpl:120 +//line app/vmalert/web.qtpl:120 func StreamListAlerts(qw422016 *qt422016.Writer, pathPrefix string, groupAlerts []GroupAlerts) { -//line web.qtpl:120 +//line app/vmalert/web.qtpl:120 qw422016.N().S(` `) -//line web.qtpl:121 +//line app/vmalert/web.qtpl:121 tpl.StreamHeader(qw422016, "Alerts", navItems) -//line web.qtpl:121 +//line app/vmalert/web.qtpl:121 qw422016.N().S(` `) -//line web.qtpl:122 +//line app/vmalert/web.qtpl:122 if len(groupAlerts) > 0 { -//line web.qtpl:122 +//line app/vmalert/web.qtpl:122 qw422016.N().S(` <a class="btn btn-primary" role="button" onclick="collapseAll()">Collapse All</a> <a class="btn btn-primary" role="button" onclick="expandAll()">Expand All</a> `) -//line web.qtpl:125 +//line app/vmalert/web.qtpl:125 for _, ga := range groupAlerts { -//line web.qtpl:125 +//line app/vmalert/web.qtpl:125 qw422016.N().S(` `) -//line web.qtpl:126 +//line app/vmalert/web.qtpl:126 g := ga.Group -//line web.qtpl:126 +//line app/vmalert/web.qtpl:126 qw422016.N().S(` <div class="group-heading alert-danger" data-bs-target="rules-`) -//line web.qtpl:127 +//line app/vmalert/web.qtpl:127 qw422016.E().S(g.ID) -//line web.qtpl:127 +//line app/vmalert/web.qtpl:127 qw422016.N().S(`"> <span class="anchor" id="group-`) -//line web.qtpl:128 +//line app/vmalert/web.qtpl:128 qw422016.E().S(g.ID) -//line web.qtpl:128 +//line app/vmalert/web.qtpl:128 qw422016.N().S(`"></span> <a href="#group-`) -//line web.qtpl:129 +//line app/vmalert/web.qtpl:129 qw422016.E().S(g.ID) -//line web.qtpl:129 +//line app/vmalert/web.qtpl:129 qw422016.N().S(`">`) -//line web.qtpl:129 +//line app/vmalert/web.qtpl:129 qw422016.E().S(g.Name) -//line web.qtpl:129 +//line app/vmalert/web.qtpl:129 if g.Type != "prometheus" { -//line web.qtpl:129 +//line app/vmalert/web.qtpl:129 qw422016.N().S(` (`) -//line web.qtpl:129 +//line app/vmalert/web.qtpl:129 qw422016.E().S(g.Type) -//line web.qtpl:129 +//line app/vmalert/web.qtpl:129 qw422016.N().S(`)`) -//line web.qtpl:129 +//line app/vmalert/web.qtpl:129 } -//line web.qtpl:129 +//line app/vmalert/web.qtpl:129 qw422016.N().S(`</a> <span class="badge bg-danger" title="Number of active alerts">`) -//line web.qtpl:130 +//line app/vmalert/web.qtpl:130 qw422016.N().D(len(ga.Alerts)) -//line web.qtpl:130 +//line app/vmalert/web.qtpl:130 qw422016.N().S(`</span> <br> <p class="fs-6 fw-lighter">`) -//line web.qtpl:132 +//line app/vmalert/web.qtpl:132 qw422016.E().S(g.File) -//line web.qtpl:132 +//line app/vmalert/web.qtpl:132 qw422016.N().S(`</p> </div> `) -//line web.qtpl:135 +//line app/vmalert/web.qtpl:135 var keys []string alertsByRule := make(map[string][]*APIAlert) for _, alert := range ga.Alerts { @@ -507,20 +507,20 @@ func StreamListAlerts(qw422016 *qt422016.Writer, pathPrefix string, groupAlerts } sort.Strings(keys) -//line web.qtpl:144 +//line app/vmalert/web.qtpl:144 qw422016.N().S(` <div class="collapse" id="rules-`) -//line web.qtpl:145 +//line app/vmalert/web.qtpl:145 qw422016.E().S(g.ID) -//line web.qtpl:145 +//line app/vmalert/web.qtpl:145 qw422016.N().S(`"> `) -//line web.qtpl:146 +//line app/vmalert/web.qtpl:146 for _, ruleID := range keys { -//line web.qtpl:146 +//line app/vmalert/web.qtpl:146 qw422016.N().S(` `) -//line web.qtpl:148 +//line app/vmalert/web.qtpl:148 defaultAR := alertsByRule[ruleID][0] var labelKeys []string for k := range defaultAR.Labels { @@ -528,28 +528,28 @@ func StreamListAlerts(qw422016 *qt422016.Writer, pathPrefix string, groupAlerts } sort.Strings(labelKeys) -//line web.qtpl:154 +//line app/vmalert/web.qtpl:154 qw422016.N().S(` <br> <b>alert:</b> `) -//line web.qtpl:156 +//line app/vmalert/web.qtpl:156 qw422016.E().S(defaultAR.Name) -//line web.qtpl:156 +//line app/vmalert/web.qtpl:156 qw422016.N().S(` (`) -//line web.qtpl:156 +//line app/vmalert/web.qtpl:156 qw422016.N().D(len(alertsByRule[ruleID])) -//line web.qtpl:156 +//line app/vmalert/web.qtpl:156 qw422016.N().S(`) | <span><a target="_blank" href="`) -//line web.qtpl:157 +//line app/vmalert/web.qtpl:157 qw422016.E().S(defaultAR.SourceLink) -//line web.qtpl:157 +//line app/vmalert/web.qtpl:157 qw422016.N().S(`">Source</a></span> <br> <b>expr:</b><code><pre>`) -//line web.qtpl:159 +//line app/vmalert/web.qtpl:159 qw422016.E().S(defaultAR.Expression) -//line web.qtpl:159 +//line app/vmalert/web.qtpl:159 qw422016.N().S(`</pre></code> <table class="table table-striped table-hover table-sm"> <thead> @@ -563,204 +563,204 @@ func StreamListAlerts(qw422016 *qt422016.Writer, pathPrefix string, groupAlerts </thead> <tbody> `) -//line web.qtpl:171 +//line app/vmalert/web.qtpl:171 for _, ar := range alertsByRule[ruleID] { -//line web.qtpl:171 +//line app/vmalert/web.qtpl:171 qw422016.N().S(` <tr> <td> `) -//line web.qtpl:174 +//line app/vmalert/web.qtpl:174 for _, k := range labelKeys { -//line web.qtpl:174 +//line app/vmalert/web.qtpl:174 qw422016.N().S(` <span class="ms-1 badge bg-primary">`) -//line web.qtpl:175 +//line app/vmalert/web.qtpl:175 qw422016.E().S(k) -//line web.qtpl:175 +//line app/vmalert/web.qtpl:175 qw422016.N().S(`=`) -//line web.qtpl:175 +//line app/vmalert/web.qtpl:175 qw422016.E().S(ar.Labels[k]) -//line web.qtpl:175 +//line app/vmalert/web.qtpl:175 qw422016.N().S(`</span> `) -//line web.qtpl:176 +//line app/vmalert/web.qtpl:176 } -//line web.qtpl:176 +//line app/vmalert/web.qtpl:176 qw422016.N().S(` </td> <td>`) -//line web.qtpl:178 +//line app/vmalert/web.qtpl:178 streambadgeState(qw422016, ar.State) -//line web.qtpl:178 +//line app/vmalert/web.qtpl:178 qw422016.N().S(`</td> <td> `) -//line web.qtpl:180 +//line app/vmalert/web.qtpl:180 qw422016.E().S(ar.ActiveAt.Format("2006-01-02T15:04:05Z07:00")) -//line web.qtpl:180 +//line app/vmalert/web.qtpl:180 qw422016.N().S(` `) -//line web.qtpl:181 +//line app/vmalert/web.qtpl:181 if ar.Restored { -//line web.qtpl:181 +//line app/vmalert/web.qtpl:181 streambadgeRestored(qw422016) -//line web.qtpl:181 +//line app/vmalert/web.qtpl:181 } -//line web.qtpl:181 +//line app/vmalert/web.qtpl:181 qw422016.N().S(` </td> <td>`) -//line web.qtpl:183 +//line app/vmalert/web.qtpl:183 qw422016.E().S(ar.Value) -//line web.qtpl:183 +//line app/vmalert/web.qtpl:183 qw422016.N().S(`</td> <td> <a href="`) -//line web.qtpl:185 +//line app/vmalert/web.qtpl:185 qw422016.E().S(path.Join(pathPrefix, g.ID, ar.ID, "status")) -//line web.qtpl:185 +//line app/vmalert/web.qtpl:185 qw422016.N().S(`">Details</a> </td> </tr> `) -//line web.qtpl:188 +//line app/vmalert/web.qtpl:188 } -//line web.qtpl:188 +//line app/vmalert/web.qtpl:188 qw422016.N().S(` </tbody> </table> `) -//line web.qtpl:191 +//line app/vmalert/web.qtpl:191 } -//line web.qtpl:191 +//line app/vmalert/web.qtpl:191 qw422016.N().S(` </div> <br> `) -//line web.qtpl:194 +//line app/vmalert/web.qtpl:194 } -//line web.qtpl:194 +//line app/vmalert/web.qtpl:194 qw422016.N().S(` `) -//line web.qtpl:196 +//line app/vmalert/web.qtpl:196 } else { -//line web.qtpl:196 +//line app/vmalert/web.qtpl:196 qw422016.N().S(` <div> <p>No items...</p> </div> `) -//line web.qtpl:200 +//line app/vmalert/web.qtpl:200 } -//line web.qtpl:200 +//line app/vmalert/web.qtpl:200 qw422016.N().S(` `) -//line web.qtpl:202 +//line app/vmalert/web.qtpl:202 tpl.StreamFooter(qw422016) -//line web.qtpl:202 +//line app/vmalert/web.qtpl:202 qw422016.N().S(` `) -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 } -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 func WriteListAlerts(qq422016 qtio422016.Writer, pathPrefix string, groupAlerts []GroupAlerts) { -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 qw422016 := qt422016.AcquireWriter(qq422016) -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 StreamListAlerts(qw422016, pathPrefix, groupAlerts) -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 qt422016.ReleaseWriter(qw422016) -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 } -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 func ListAlerts(pathPrefix string, groupAlerts []GroupAlerts) string { -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 qb422016 := qt422016.AcquireByteBuffer() -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 WriteListAlerts(qb422016, pathPrefix, groupAlerts) -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 qs422016 := string(qb422016.B) -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 qt422016.ReleaseByteBuffer(qb422016) -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 return qs422016 -//line web.qtpl:204 +//line app/vmalert/web.qtpl:204 } -//line web.qtpl:206 +//line app/vmalert/web.qtpl:206 func StreamListTargets(qw422016 *qt422016.Writer, targets map[notifier.TargetType][]notifier.Target) { -//line web.qtpl:206 +//line app/vmalert/web.qtpl:206 qw422016.N().S(` `) -//line web.qtpl:207 +//line app/vmalert/web.qtpl:207 tpl.StreamHeader(qw422016, "Notifiers", navItems) -//line web.qtpl:207 +//line app/vmalert/web.qtpl:207 qw422016.N().S(` `) -//line web.qtpl:208 +//line app/vmalert/web.qtpl:208 if len(targets) > 0 { -//line web.qtpl:208 +//line app/vmalert/web.qtpl:208 qw422016.N().S(` <a class="btn btn-primary" role="button" onclick="collapseAll()">Collapse All</a> <a class="btn btn-primary" role="button" onclick="expandAll()">Expand All</a> `) -//line web.qtpl:213 +//line app/vmalert/web.qtpl:213 var keys []string for key := range targets { keys = append(keys, string(key)) } sort.Strings(keys) -//line web.qtpl:218 +//line app/vmalert/web.qtpl:218 qw422016.N().S(` `) -//line web.qtpl:220 +//line app/vmalert/web.qtpl:220 for i := range keys { -//line web.qtpl:220 +//line app/vmalert/web.qtpl:220 qw422016.N().S(` `) -//line web.qtpl:221 +//line app/vmalert/web.qtpl:221 typeK, ns := keys[i], targets[notifier.TargetType(keys[i])] count := len(ns) -//line web.qtpl:223 +//line app/vmalert/web.qtpl:223 qw422016.N().S(` <div class="group-heading data-bs-target="rules-`) -//line web.qtpl:224 +//line app/vmalert/web.qtpl:224 qw422016.E().S(typeK) -//line web.qtpl:224 +//line app/vmalert/web.qtpl:224 qw422016.N().S(`"> <span class="anchor" id="notifiers-`) -//line web.qtpl:225 +//line app/vmalert/web.qtpl:225 qw422016.E().S(typeK) -//line web.qtpl:225 +//line app/vmalert/web.qtpl:225 qw422016.N().S(`"></span> <a href="#notifiers-`) -//line web.qtpl:226 +//line app/vmalert/web.qtpl:226 qw422016.E().S(typeK) -//line web.qtpl:226 +//line app/vmalert/web.qtpl:226 qw422016.N().S(`">`) -//line web.qtpl:226 +//line app/vmalert/web.qtpl:226 qw422016.E().S(typeK) -//line web.qtpl:226 +//line app/vmalert/web.qtpl:226 qw422016.N().S(` (`) -//line web.qtpl:226 +//line app/vmalert/web.qtpl:226 qw422016.N().D(count) -//line web.qtpl:226 +//line app/vmalert/web.qtpl:226 qw422016.N().S(`)</a> </div> <div class="collapse show" id="notifiers-`) -//line web.qtpl:228 +//line app/vmalert/web.qtpl:228 qw422016.E().S(typeK) -//line web.qtpl:228 +//line app/vmalert/web.qtpl:228 qw422016.N().S(`"> <table class="table table-striped table-hover table-sm"> <thead> @@ -771,113 +771,113 @@ func StreamListTargets(qw422016 *qt422016.Writer, targets map[notifier.TargetTyp </thead> <tbody> `) -//line web.qtpl:237 +//line app/vmalert/web.qtpl:237 for _, n := range ns { -//line web.qtpl:237 +//line app/vmalert/web.qtpl:237 qw422016.N().S(` <tr> <td> `) -//line web.qtpl:240 +//line app/vmalert/web.qtpl:240 for _, l := range n.Labels { -//line web.qtpl:240 +//line app/vmalert/web.qtpl:240 qw422016.N().S(` <span class="ms-1 badge bg-primary">`) -//line web.qtpl:241 +//line app/vmalert/web.qtpl:241 qw422016.E().S(l.Name) -//line web.qtpl:241 +//line app/vmalert/web.qtpl:241 qw422016.N().S(`=`) -//line web.qtpl:241 +//line app/vmalert/web.qtpl:241 qw422016.E().S(l.Value) -//line web.qtpl:241 +//line app/vmalert/web.qtpl:241 qw422016.N().S(`</span> `) -//line web.qtpl:242 +//line app/vmalert/web.qtpl:242 } -//line web.qtpl:242 +//line app/vmalert/web.qtpl:242 qw422016.N().S(` </td> <td>`) -//line web.qtpl:244 +//line app/vmalert/web.qtpl:244 qw422016.E().S(n.Notifier.Addr()) -//line web.qtpl:244 +//line app/vmalert/web.qtpl:244 qw422016.N().S(`</td> </tr> `) -//line web.qtpl:246 +//line app/vmalert/web.qtpl:246 } -//line web.qtpl:246 +//line app/vmalert/web.qtpl:246 qw422016.N().S(` </tbody> </table> </div> `) -//line web.qtpl:250 +//line app/vmalert/web.qtpl:250 } -//line web.qtpl:250 +//line app/vmalert/web.qtpl:250 qw422016.N().S(` `) -//line web.qtpl:252 +//line app/vmalert/web.qtpl:252 } else { -//line web.qtpl:252 +//line app/vmalert/web.qtpl:252 qw422016.N().S(` <div> <p>No items...</p> </div> `) -//line web.qtpl:256 +//line app/vmalert/web.qtpl:256 } -//line web.qtpl:256 +//line app/vmalert/web.qtpl:256 qw422016.N().S(` `) -//line web.qtpl:258 +//line app/vmalert/web.qtpl:258 tpl.StreamFooter(qw422016) -//line web.qtpl:258 +//line app/vmalert/web.qtpl:258 qw422016.N().S(` `) -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 } -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 func WriteListTargets(qq422016 qtio422016.Writer, targets map[notifier.TargetType][]notifier.Target) { -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 qw422016 := qt422016.AcquireWriter(qq422016) -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 StreamListTargets(qw422016, targets) -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 qt422016.ReleaseWriter(qw422016) -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 } -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 func ListTargets(targets map[notifier.TargetType][]notifier.Target) string { -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 qb422016 := qt422016.AcquireByteBuffer() -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 WriteListTargets(qb422016, targets) -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 qs422016 := string(qb422016.B) -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 qt422016.ReleaseByteBuffer(qb422016) -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 return qs422016 -//line web.qtpl:260 +//line app/vmalert/web.qtpl:260 } -//line web.qtpl:262 +//line app/vmalert/web.qtpl:262 func StreamAlert(qw422016 *qt422016.Writer, pathPrefix string, alert *APIAlert) { -//line web.qtpl:262 +//line app/vmalert/web.qtpl:262 qw422016.N().S(` `) -//line web.qtpl:263 +//line app/vmalert/web.qtpl:263 tpl.StreamHeader(qw422016, "", navItems) -//line web.qtpl:263 +//line app/vmalert/web.qtpl:263 qw422016.N().S(` `) -//line web.qtpl:265 +//line app/vmalert/web.qtpl:265 var labelKeys []string for k := range alert.Labels { labelKeys = append(labelKeys, k) @@ -890,28 +890,28 @@ func StreamAlert(qw422016 *qt422016.Writer, pathPrefix string, alert *APIAlert) } sort.Strings(annotationKeys) -//line web.qtpl:276 +//line app/vmalert/web.qtpl:276 qw422016.N().S(` <div class="display-6 pb-3 mb-3">`) -//line web.qtpl:277 +//line app/vmalert/web.qtpl:277 qw422016.E().S(alert.Name) -//line web.qtpl:277 +//line app/vmalert/web.qtpl:277 qw422016.N().S(`<span class="ms-2 badge `) -//line web.qtpl:277 +//line app/vmalert/web.qtpl:277 if alert.State == "firing" { -//line web.qtpl:277 +//line app/vmalert/web.qtpl:277 qw422016.N().S(`bg-danger`) -//line web.qtpl:277 +//line app/vmalert/web.qtpl:277 } else { -//line web.qtpl:277 +//line app/vmalert/web.qtpl:277 qw422016.N().S(` bg-warning text-dark`) -//line web.qtpl:277 +//line app/vmalert/web.qtpl:277 } -//line web.qtpl:277 +//line app/vmalert/web.qtpl:277 qw422016.N().S(`">`) -//line web.qtpl:277 +//line app/vmalert/web.qtpl:277 qw422016.E().S(alert.State) -//line web.qtpl:277 +//line app/vmalert/web.qtpl:277 qw422016.N().S(`</span></div> <div class="container border-bottom p-2"> <div class="row"> @@ -920,9 +920,9 @@ func StreamAlert(qw422016 *qt422016.Writer, pathPrefix string, alert *APIAlert) </div> <div class="col"> `) -//line web.qtpl:284 +//line app/vmalert/web.qtpl:284 qw422016.E().S(alert.ActiveAt.Format("2006-01-02T15:04:05Z07:00")) -//line web.qtpl:284 +//line app/vmalert/web.qtpl:284 qw422016.N().S(` </div> </div> @@ -934,9 +934,9 @@ func StreamAlert(qw422016 *qt422016.Writer, pathPrefix string, alert *APIAlert) </div> <div class="col"> <code><pre>`) -//line web.qtpl:294 +//line app/vmalert/web.qtpl:294 qw422016.E().S(alert.Expression) -//line web.qtpl:294 +//line app/vmalert/web.qtpl:294 qw422016.N().S(`</pre></code> </div> </div> @@ -948,23 +948,23 @@ func StreamAlert(qw422016 *qt422016.Writer, pathPrefix string, alert *APIAlert) </div> <div class="col"> `) -//line web.qtpl:304 +//line app/vmalert/web.qtpl:304 for _, k := range labelKeys { -//line web.qtpl:304 +//line app/vmalert/web.qtpl:304 qw422016.N().S(` <span class="m-1 badge bg-primary">`) -//line web.qtpl:305 +//line app/vmalert/web.qtpl:305 qw422016.E().S(k) -//line web.qtpl:305 +//line app/vmalert/web.qtpl:305 qw422016.N().S(`=`) -//line web.qtpl:305 +//line app/vmalert/web.qtpl:305 qw422016.E().S(alert.Labels[k]) -//line web.qtpl:305 +//line app/vmalert/web.qtpl:305 qw422016.N().S(`</span> `) -//line web.qtpl:306 +//line app/vmalert/web.qtpl:306 } -//line web.qtpl:306 +//line app/vmalert/web.qtpl:306 qw422016.N().S(` </div> </div> @@ -976,24 +976,24 @@ func StreamAlert(qw422016 *qt422016.Writer, pathPrefix string, alert *APIAlert) </div> <div class="col"> `) -//line web.qtpl:316 +//line app/vmalert/web.qtpl:316 for _, k := range annotationKeys { -//line web.qtpl:316 +//line app/vmalert/web.qtpl:316 qw422016.N().S(` <b>`) -//line web.qtpl:317 +//line app/vmalert/web.qtpl:317 qw422016.E().S(k) -//line web.qtpl:317 +//line app/vmalert/web.qtpl:317 qw422016.N().S(`:</b><br> <p>`) -//line web.qtpl:318 +//line app/vmalert/web.qtpl:318 qw422016.E().S(alert.Annotations[k]) -//line web.qtpl:318 +//line app/vmalert/web.qtpl:318 qw422016.N().S(`</p> `) -//line web.qtpl:319 +//line app/vmalert/web.qtpl:319 } -//line web.qtpl:319 +//line app/vmalert/web.qtpl:319 qw422016.N().S(` </div> </div> @@ -1005,17 +1005,17 @@ func StreamAlert(qw422016 *qt422016.Writer, pathPrefix string, alert *APIAlert) </div> <div class="col"> <a target="_blank" href="`) -//line web.qtpl:329 +//line app/vmalert/web.qtpl:329 qw422016.E().S(path.Join(pathPrefix, "groups")) -//line web.qtpl:329 +//line app/vmalert/web.qtpl:329 qw422016.N().S(`#group-`) -//line web.qtpl:329 +//line app/vmalert/web.qtpl:329 qw422016.E().S(alert.GroupID) -//line web.qtpl:329 +//line app/vmalert/web.qtpl:329 qw422016.N().S(`">`) -//line web.qtpl:329 +//line app/vmalert/web.qtpl:329 qw422016.E().S(alert.GroupID) -//line web.qtpl:329 +//line app/vmalert/web.qtpl:329 qw422016.N().S(`</a> </div> </div> @@ -1027,132 +1027,132 @@ func StreamAlert(qw422016 *qt422016.Writer, pathPrefix string, alert *APIAlert) </div> <div class="col"> <a target="_blank" href="`) -//line web.qtpl:339 +//line app/vmalert/web.qtpl:339 qw422016.E().S(alert.SourceLink) -//line web.qtpl:339 +//line app/vmalert/web.qtpl:339 qw422016.N().S(`">Link</a> </div> </div> </div> `) -//line web.qtpl:343 +//line app/vmalert/web.qtpl:343 tpl.StreamFooter(qw422016) -//line web.qtpl:343 +//line app/vmalert/web.qtpl:343 qw422016.N().S(` `) -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 } -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 func WriteAlert(qq422016 qtio422016.Writer, pathPrefix string, alert *APIAlert) { -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 qw422016 := qt422016.AcquireWriter(qq422016) -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 StreamAlert(qw422016, pathPrefix, alert) -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 qt422016.ReleaseWriter(qw422016) -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 } -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 func Alert(pathPrefix string, alert *APIAlert) string { -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 qb422016 := qt422016.AcquireByteBuffer() -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 WriteAlert(qb422016, pathPrefix, alert) -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 qs422016 := string(qb422016.B) -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 qt422016.ReleaseByteBuffer(qb422016) -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 return qs422016 -//line web.qtpl:345 +//line app/vmalert/web.qtpl:345 } -//line web.qtpl:347 +//line app/vmalert/web.qtpl:347 func streambadgeState(qw422016 *qt422016.Writer, state string) { -//line web.qtpl:347 +//line app/vmalert/web.qtpl:347 qw422016.N().S(` `) -//line web.qtpl:349 +//line app/vmalert/web.qtpl:349 badgeClass := "bg-warning text-dark" if state == "firing" { badgeClass = "bg-danger" } -//line web.qtpl:353 +//line app/vmalert/web.qtpl:353 qw422016.N().S(` <span class="badge `) -//line web.qtpl:354 +//line app/vmalert/web.qtpl:354 qw422016.E().S(badgeClass) -//line web.qtpl:354 +//line app/vmalert/web.qtpl:354 qw422016.N().S(`">`) -//line web.qtpl:354 +//line app/vmalert/web.qtpl:354 qw422016.E().S(state) -//line web.qtpl:354 +//line app/vmalert/web.qtpl:354 qw422016.N().S(`</span> `) -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 } -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 func writebadgeState(qq422016 qtio422016.Writer, state string) { -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 qw422016 := qt422016.AcquireWriter(qq422016) -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 streambadgeState(qw422016, state) -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 qt422016.ReleaseWriter(qw422016) -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 } -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 func badgeState(state string) string { -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 qb422016 := qt422016.AcquireByteBuffer() -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 writebadgeState(qb422016, state) -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 qs422016 := string(qb422016.B) -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 qt422016.ReleaseByteBuffer(qb422016) -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 return qs422016 -//line web.qtpl:355 +//line app/vmalert/web.qtpl:355 } -//line web.qtpl:357 +//line app/vmalert/web.qtpl:357 func streambadgeRestored(qw422016 *qt422016.Writer) { -//line web.qtpl:357 +//line app/vmalert/web.qtpl:357 qw422016.N().S(` <span class="badge bg-warning text-dark" title="Alert state was restored after the service restart from remote storage">restored</span> `) -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 } -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 func writebadgeRestored(qq422016 qtio422016.Writer) { -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 qw422016 := qt422016.AcquireWriter(qq422016) -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 streambadgeRestored(qw422016) -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 qt422016.ReleaseWriter(qw422016) -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 } -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 func badgeRestored() string { -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 qb422016 := qt422016.AcquireByteBuffer() -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 writebadgeRestored(qb422016) -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 qs422016 := string(qb422016.B) -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 qt422016.ReleaseByteBuffer(qb422016) -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 return qs422016 -//line web.qtpl:359 +//line app/vmalert/web.qtpl:359 } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index ca77b1d8af..a5eb687b37 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -47,7 +47,7 @@ The following tip changes can be tested by building VictoriaMetrics components f * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): properly show `scrape_timeout` and `scrape_interval` options at `http://vmagent:8429/config` page. Previously these options weren't displayed even if they were set in `-promscrape.config`. * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): handle non-standard http redirect status codes, which may be returned by scrape targets, in the same way as Prometheus does. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2482). * BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert.html): skip template execution during rules' validation. This should prevent from `error evaluating annotation template` errors when some template functions expect non-empty args. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2514). -* BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert.html): fixed truncating alerts expression in table, updated table cell layout. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2484). +* BUGFIX: [vmalert](https://docs.victoriametrics.com/vmalert.html): fixed truncating alerts expression in table, updated table cell layout. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2484). * BUGFIX: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): properly handle joins on time series filtered by values. For example, `kube_pod_container_resource_requests{resource="cpu"} * on (namespace,pod) group_left() (kube_pod_status_phase{phase=~"Pending|Running"}==1)`. This query could result in `duplicate time series on the right side` error even if `==1` filter leaves only a single time series per `(namespace,pod)` labels. Now such query is properly executed. * BUGFIX: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): properly handle `scalar default vector`, `scalar if vector` and `scalar ifnot vector` queries. Previously such queries could return unexpected results from the `vector` part. * BUGFIX: [Official Grafana dashboards for VictoriaMetrics](https://grafana.com/orgs/victoriametrics): take into account `indexdb` when calculating disk space usage. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2368).