mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-16 17:21:04 +01:00
dd412a3757
show on UI groups error after reload config https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4076 Co-authored-by: hagen1778 <roman@victoriametrics.com>
1807 lines
52 KiB
Go
1807 lines
52 KiB
Go
// Code generated by qtc from "web.qtpl". DO NOT EDIT.
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
//line app/vmalert/web.qtpl:1
|
|
package main
|
|
|
|
//line app/vmalert/web.qtpl:3
|
|
import (
|
|
"net/http"
|
|
"sort"
|
|
"time"
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/notifier"
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/tpl"
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/utils"
|
|
)
|
|
|
|
//line app/vmalert/web.qtpl:14
|
|
import (
|
|
qtio422016 "io"
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
)
|
|
|
|
//line app/vmalert/web.qtpl:14
|
|
var (
|
|
_ = qtio422016.Copy
|
|
_ = qt422016.AcquireByteBuffer
|
|
)
|
|
|
|
//line app/vmalert/web.qtpl:14
|
|
func StreamWelcome(qw422016 *qt422016.Writer, r *http.Request) {
|
|
//line app/vmalert/web.qtpl:14
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:15
|
|
tpl.StreamHeader(qw422016, r, navItems, "vmalert", configError())
|
|
//line app/vmalert/web.qtpl:15
|
|
qw422016.N().S(`
|
|
<p>
|
|
API:<br>
|
|
`)
|
|
//line app/vmalert/web.qtpl:18
|
|
for _, p := range apiLinks {
|
|
//line app/vmalert/web.qtpl:18
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:19
|
|
p, doc := p[0], p[1]
|
|
|
|
//line app/vmalert/web.qtpl:19
|
|
qw422016.N().S(`
|
|
<a href="`)
|
|
//line app/vmalert/web.qtpl:20
|
|
qw422016.E().S(p)
|
|
//line app/vmalert/web.qtpl:20
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:20
|
|
qw422016.E().S(p)
|
|
//line app/vmalert/web.qtpl:20
|
|
qw422016.N().S(`</a> - `)
|
|
//line app/vmalert/web.qtpl:20
|
|
qw422016.E().S(doc)
|
|
//line app/vmalert/web.qtpl:20
|
|
qw422016.N().S(`<br/>
|
|
`)
|
|
//line app/vmalert/web.qtpl:21
|
|
}
|
|
//line app/vmalert/web.qtpl:21
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:22
|
|
if r.Header.Get("X-Forwarded-For") == "" {
|
|
//line app/vmalert/web.qtpl:22
|
|
qw422016.N().S(`
|
|
System:<br>
|
|
`)
|
|
//line app/vmalert/web.qtpl:24
|
|
for _, p := range systemLinks {
|
|
//line app/vmalert/web.qtpl:24
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:25
|
|
p, doc := p[0], p[1]
|
|
|
|
//line app/vmalert/web.qtpl:25
|
|
qw422016.N().S(`
|
|
<a href="`)
|
|
//line app/vmalert/web.qtpl:26
|
|
qw422016.E().S(p)
|
|
//line app/vmalert/web.qtpl:26
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:26
|
|
qw422016.E().S(p)
|
|
//line app/vmalert/web.qtpl:26
|
|
qw422016.N().S(`</a> - `)
|
|
//line app/vmalert/web.qtpl:26
|
|
qw422016.E().S(doc)
|
|
//line app/vmalert/web.qtpl:26
|
|
qw422016.N().S(`<br/>
|
|
`)
|
|
//line app/vmalert/web.qtpl:27
|
|
}
|
|
//line app/vmalert/web.qtpl:27
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:28
|
|
}
|
|
//line app/vmalert/web.qtpl:28
|
|
qw422016.N().S(`
|
|
</p>
|
|
`)
|
|
//line app/vmalert/web.qtpl:30
|
|
tpl.StreamFooter(qw422016, r)
|
|
//line app/vmalert/web.qtpl:30
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:31
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:31
|
|
func WriteWelcome(qq422016 qtio422016.Writer, r *http.Request) {
|
|
//line app/vmalert/web.qtpl:31
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:31
|
|
StreamWelcome(qw422016, r)
|
|
//line app/vmalert/web.qtpl:31
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:31
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:31
|
|
func Welcome(r *http.Request) string {
|
|
//line app/vmalert/web.qtpl:31
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:31
|
|
WriteWelcome(qb422016, r)
|
|
//line app/vmalert/web.qtpl:31
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:31
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:31
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:31
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:33
|
|
func streambuttonActive(qw422016 *qt422016.Writer, filter, expValue string) {
|
|
//line app/vmalert/web.qtpl:33
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:34
|
|
if filter != expValue {
|
|
//line app/vmalert/web.qtpl:34
|
|
qw422016.N().S(`
|
|
btn-secondary
|
|
`)
|
|
//line app/vmalert/web.qtpl:36
|
|
} else {
|
|
//line app/vmalert/web.qtpl:36
|
|
qw422016.N().S(`
|
|
btn-primary
|
|
`)
|
|
//line app/vmalert/web.qtpl:38
|
|
}
|
|
//line app/vmalert/web.qtpl:38
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:39
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:39
|
|
func writebuttonActive(qq422016 qtio422016.Writer, filter, expValue string) {
|
|
//line app/vmalert/web.qtpl:39
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:39
|
|
streambuttonActive(qw422016, filter, expValue)
|
|
//line app/vmalert/web.qtpl:39
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:39
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:39
|
|
func buttonActive(filter, expValue string) string {
|
|
//line app/vmalert/web.qtpl:39
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:39
|
|
writebuttonActive(qb422016, filter, expValue)
|
|
//line app/vmalert/web.qtpl:39
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:39
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:39
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:39
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:41
|
|
func StreamListGroups(qw422016 *qt422016.Writer, r *http.Request, originGroups []APIGroup) {
|
|
//line app/vmalert/web.qtpl:41
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:42
|
|
prefix := utils.Prefix(r.URL.Path)
|
|
|
|
//line app/vmalert/web.qtpl:42
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:43
|
|
tpl.StreamHeader(qw422016, r, navItems, "Groups", configError())
|
|
//line app/vmalert/web.qtpl:43
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:45
|
|
filter := r.URL.Query().Get("filter")
|
|
rOk := make(map[string]int)
|
|
rNotOk := make(map[string]int)
|
|
rNoMatch := make(map[string]int)
|
|
var groups []APIGroup
|
|
for _, g := range originGroups {
|
|
var rules []APIRule
|
|
for _, r := range g.Rules {
|
|
if r.LastError != "" {
|
|
rNotOk[g.ID]++
|
|
} else {
|
|
rOk[g.ID]++
|
|
}
|
|
if isNoMatch(r) {
|
|
rNoMatch[g.ID]++
|
|
}
|
|
if (filter == "unhealthy" && r.LastError == "") ||
|
|
(filter == "noMatch" && !isNoMatch(r)) {
|
|
continue
|
|
}
|
|
rules = append(rules, r)
|
|
}
|
|
if len(rules) > 0 {
|
|
g.Rules = rules
|
|
groups = append(groups, g)
|
|
}
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:72
|
|
qw422016.N().S(`
|
|
<a class="btn `)
|
|
//line app/vmalert/web.qtpl:73
|
|
streambuttonActive(qw422016, filter, "")
|
|
//line app/vmalert/web.qtpl:73
|
|
qw422016.N().S(`" role="button" onclick="window.location = window.location.pathname">All</a>
|
|
<a class="btn btn-primary" role="button" onclick="collapseAll()">Collapse All</a>
|
|
<a class="btn btn-primary" role="button" onclick="expandAll()">Expand All</a>
|
|
<a class="btn `)
|
|
//line app/vmalert/web.qtpl:76
|
|
streambuttonActive(qw422016, filter, "unhealthy")
|
|
//line app/vmalert/web.qtpl:76
|
|
qw422016.N().S(`" role="button" onclick="location.href='?filter=unhealthy'" title="Show only rules with errors">Unhealthy</a>
|
|
<a class="btn `)
|
|
//line app/vmalert/web.qtpl:77
|
|
streambuttonActive(qw422016, filter, "noMatch")
|
|
//line app/vmalert/web.qtpl:77
|
|
qw422016.N().S(`" role="button" onclick="location.href='?filter=noMatch'" title="Show only rules matching no time series during last evaluation">NoMatch</a>
|
|
`)
|
|
//line app/vmalert/web.qtpl:78
|
|
if len(groups) > 0 {
|
|
//line app/vmalert/web.qtpl:78
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:79
|
|
for _, g := range groups {
|
|
//line app/vmalert/web.qtpl:79
|
|
qw422016.N().S(`
|
|
<div
|
|
class="group-heading`)
|
|
//line app/vmalert/web.qtpl:81
|
|
if rNotOk[g.ID] > 0 {
|
|
//line app/vmalert/web.qtpl:81
|
|
qw422016.N().S(` alert-danger`)
|
|
//line app/vmalert/web.qtpl:81
|
|
}
|
|
//line app/vmalert/web.qtpl:81
|
|
qw422016.N().S(`" data-bs-target="rules-`)
|
|
//line app/vmalert/web.qtpl:81
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:81
|
|
qw422016.N().S(`">
|
|
<span class="anchor" id="group-`)
|
|
//line app/vmalert/web.qtpl:82
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:82
|
|
qw422016.N().S(`"></span>
|
|
<a href="#group-`)
|
|
//line app/vmalert/web.qtpl:83
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:83
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:83
|
|
qw422016.E().S(g.Name)
|
|
//line app/vmalert/web.qtpl:83
|
|
if g.Type != "prometheus" {
|
|
//line app/vmalert/web.qtpl:83
|
|
qw422016.N().S(` (`)
|
|
//line app/vmalert/web.qtpl:83
|
|
qw422016.E().S(g.Type)
|
|
//line app/vmalert/web.qtpl:83
|
|
qw422016.N().S(`)`)
|
|
//line app/vmalert/web.qtpl:83
|
|
}
|
|
//line app/vmalert/web.qtpl:83
|
|
qw422016.N().S(` (every `)
|
|
//line app/vmalert/web.qtpl:83
|
|
qw422016.N().FPrec(g.Interval, 0)
|
|
//line app/vmalert/web.qtpl:83
|
|
qw422016.N().S(`s) #</a>
|
|
`)
|
|
//line app/vmalert/web.qtpl:84
|
|
if rNotOk[g.ID] > 0 {
|
|
//line app/vmalert/web.qtpl:84
|
|
qw422016.N().S(`<span class="badge bg-danger" title="Number of rules with status Error">`)
|
|
//line app/vmalert/web.qtpl:84
|
|
qw422016.N().D(rNotOk[g.ID])
|
|
//line app/vmalert/web.qtpl:84
|
|
qw422016.N().S(`</span> `)
|
|
//line app/vmalert/web.qtpl:84
|
|
}
|
|
//line app/vmalert/web.qtpl:84
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:85
|
|
if rNoMatch[g.ID] > 0 {
|
|
//line app/vmalert/web.qtpl:85
|
|
qw422016.N().S(`<span class="badge bg-warning" title="Number of rules with status NoMatch">`)
|
|
//line app/vmalert/web.qtpl:85
|
|
qw422016.N().D(rNoMatch[g.ID])
|
|
//line app/vmalert/web.qtpl:85
|
|
qw422016.N().S(`</span> `)
|
|
//line app/vmalert/web.qtpl:85
|
|
}
|
|
//line app/vmalert/web.qtpl:85
|
|
qw422016.N().S(`
|
|
<span class="badge bg-success" title="Number of rules withs status Ok">`)
|
|
//line app/vmalert/web.qtpl:86
|
|
qw422016.N().D(rOk[g.ID])
|
|
//line app/vmalert/web.qtpl:86
|
|
qw422016.N().S(`</span>
|
|
<p class="fs-6 fw-lighter">`)
|
|
//line app/vmalert/web.qtpl:87
|
|
qw422016.E().S(g.File)
|
|
//line app/vmalert/web.qtpl:87
|
|
qw422016.N().S(`</p>
|
|
`)
|
|
//line app/vmalert/web.qtpl:88
|
|
if len(g.Params) > 0 {
|
|
//line app/vmalert/web.qtpl:88
|
|
qw422016.N().S(`
|
|
<div class="fs-6 fw-lighter">Extra params
|
|
`)
|
|
//line app/vmalert/web.qtpl:90
|
|
for _, param := range g.Params {
|
|
//line app/vmalert/web.qtpl:90
|
|
qw422016.N().S(`
|
|
<span class="float-left badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:91
|
|
qw422016.E().S(param)
|
|
//line app/vmalert/web.qtpl:91
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:92
|
|
}
|
|
//line app/vmalert/web.qtpl:92
|
|
qw422016.N().S(`
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:94
|
|
}
|
|
//line app/vmalert/web.qtpl:94
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:95
|
|
if len(g.Headers) > 0 {
|
|
//line app/vmalert/web.qtpl:95
|
|
qw422016.N().S(`
|
|
<div class="fs-6 fw-lighter">Extra headers
|
|
`)
|
|
//line app/vmalert/web.qtpl:97
|
|
for _, header := range g.Headers {
|
|
//line app/vmalert/web.qtpl:97
|
|
qw422016.N().S(`
|
|
<span class="float-left badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:98
|
|
qw422016.E().S(header)
|
|
//line app/vmalert/web.qtpl:98
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:99
|
|
}
|
|
//line app/vmalert/web.qtpl:99
|
|
qw422016.N().S(`
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:101
|
|
}
|
|
//line app/vmalert/web.qtpl:101
|
|
qw422016.N().S(`
|
|
</div>
|
|
<div class="collapse" id="rules-`)
|
|
//line app/vmalert/web.qtpl:103
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:103
|
|
qw422016.N().S(`">
|
|
<table class="table table-striped table-hover table-sm">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" style="width: 60%">Rule</th>
|
|
<th scope="col" style="width: 20%" class="text-center" title="How many samples were produced by the rule">Samples</th>
|
|
<th scope="col" style="width: 20%" class="text-center" title="How many seconds ago rule was executed">Updated</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
`)
|
|
//line app/vmalert/web.qtpl:113
|
|
for _, r := range g.Rules {
|
|
//line app/vmalert/web.qtpl:113
|
|
qw422016.N().S(`
|
|
<tr`)
|
|
//line app/vmalert/web.qtpl:114
|
|
if r.LastError != "" {
|
|
//line app/vmalert/web.qtpl:114
|
|
qw422016.N().S(` class="alert-danger"`)
|
|
//line app/vmalert/web.qtpl:114
|
|
}
|
|
//line app/vmalert/web.qtpl:114
|
|
qw422016.N().S(`>
|
|
<td>
|
|
<div class="row">
|
|
<div class="col-12 mb-2">
|
|
`)
|
|
//line app/vmalert/web.qtpl:118
|
|
if r.Type == "alerting" {
|
|
//line app/vmalert/web.qtpl:118
|
|
qw422016.N().S(`
|
|
<b>alert:</b> `)
|
|
//line app/vmalert/web.qtpl:119
|
|
qw422016.E().S(r.Name)
|
|
//line app/vmalert/web.qtpl:119
|
|
qw422016.N().S(` (for: `)
|
|
//line app/vmalert/web.qtpl:119
|
|
qw422016.E().V(r.Duration)
|
|
//line app/vmalert/web.qtpl:119
|
|
qw422016.N().S(` seconds)
|
|
`)
|
|
//line app/vmalert/web.qtpl:120
|
|
} else {
|
|
//line app/vmalert/web.qtpl:120
|
|
qw422016.N().S(`
|
|
<b>record:</b> `)
|
|
//line app/vmalert/web.qtpl:121
|
|
qw422016.E().S(r.Name)
|
|
//line app/vmalert/web.qtpl:121
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:122
|
|
}
|
|
//line app/vmalert/web.qtpl:122
|
|
qw422016.N().S(`
|
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:124
|
|
streamseriesFetchedWarn(qw422016, r)
|
|
//line app/vmalert/web.qtpl:124
|
|
qw422016.N().S(`
|
|
<span><a target="_blank" href="`)
|
|
//line app/vmalert/web.qtpl:125
|
|
qw422016.E().S(prefix + r.WebLink())
|
|
//line app/vmalert/web.qtpl:125
|
|
qw422016.N().S(`">Details</a></span>
|
|
</div>
|
|
<div class="col-12">
|
|
<code><pre>`)
|
|
//line app/vmalert/web.qtpl:128
|
|
qw422016.E().S(r.Query)
|
|
//line app/vmalert/web.qtpl:128
|
|
qw422016.N().S(`</pre></code>
|
|
</div>
|
|
<div class="col-12 mb-2">
|
|
`)
|
|
//line app/vmalert/web.qtpl:131
|
|
if len(r.Labels) > 0 {
|
|
//line app/vmalert/web.qtpl:131
|
|
qw422016.N().S(` <b>Labels:</b>`)
|
|
//line app/vmalert/web.qtpl:131
|
|
}
|
|
//line app/vmalert/web.qtpl:131
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:132
|
|
for k, v := range r.Labels {
|
|
//line app/vmalert/web.qtpl:132
|
|
qw422016.N().S(`
|
|
<span class="ms-1 badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:133
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:133
|
|
qw422016.N().S(`=`)
|
|
//line app/vmalert/web.qtpl:133
|
|
qw422016.E().S(v)
|
|
//line app/vmalert/web.qtpl:133
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:134
|
|
}
|
|
//line app/vmalert/web.qtpl:134
|
|
qw422016.N().S(`
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:136
|
|
if r.LastError != "" {
|
|
//line app/vmalert/web.qtpl:136
|
|
qw422016.N().S(`
|
|
<div class="col-12">
|
|
<b>Error:</b>
|
|
<div class="error-cell">
|
|
`)
|
|
//line app/vmalert/web.qtpl:140
|
|
qw422016.E().S(r.LastError)
|
|
//line app/vmalert/web.qtpl:140
|
|
qw422016.N().S(`
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:143
|
|
}
|
|
//line app/vmalert/web.qtpl:143
|
|
qw422016.N().S(`
|
|
</div>
|
|
</td>
|
|
<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:146
|
|
qw422016.N().D(r.LastSamples)
|
|
//line app/vmalert/web.qtpl:146
|
|
qw422016.N().S(`</td>
|
|
<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:147
|
|
qw422016.N().FPrec(time.Since(r.LastEvaluation).Seconds(), 3)
|
|
//line app/vmalert/web.qtpl:147
|
|
qw422016.N().S(`s ago</td>
|
|
</tr>
|
|
`)
|
|
//line app/vmalert/web.qtpl:149
|
|
}
|
|
//line app/vmalert/web.qtpl:149
|
|
qw422016.N().S(`
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:153
|
|
}
|
|
//line app/vmalert/web.qtpl:153
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:154
|
|
} else {
|
|
//line app/vmalert/web.qtpl:154
|
|
qw422016.N().S(`
|
|
<div>
|
|
<p>No groups...</p>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:158
|
|
}
|
|
//line app/vmalert/web.qtpl:158
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:160
|
|
tpl.StreamFooter(qw422016, r)
|
|
//line app/vmalert/web.qtpl:160
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:162
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:162
|
|
func WriteListGroups(qq422016 qtio422016.Writer, r *http.Request, originGroups []APIGroup) {
|
|
//line app/vmalert/web.qtpl:162
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:162
|
|
StreamListGroups(qw422016, r, originGroups)
|
|
//line app/vmalert/web.qtpl:162
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:162
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:162
|
|
func ListGroups(r *http.Request, originGroups []APIGroup) string {
|
|
//line app/vmalert/web.qtpl:162
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:162
|
|
WriteListGroups(qb422016, r, originGroups)
|
|
//line app/vmalert/web.qtpl:162
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:162
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:162
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:162
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:165
|
|
func StreamListAlerts(qw422016 *qt422016.Writer, r *http.Request, groupAlerts []GroupAlerts) {
|
|
//line app/vmalert/web.qtpl:165
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:166
|
|
prefix := utils.Prefix(r.URL.Path)
|
|
|
|
//line app/vmalert/web.qtpl:166
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:167
|
|
tpl.StreamHeader(qw422016, r, navItems, "Alerts", configError())
|
|
//line app/vmalert/web.qtpl:167
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:168
|
|
if len(groupAlerts) > 0 {
|
|
//line app/vmalert/web.qtpl:168
|
|
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 app/vmalert/web.qtpl:171
|
|
for _, ga := range groupAlerts {
|
|
//line app/vmalert/web.qtpl:171
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:172
|
|
g := ga.Group
|
|
|
|
//line app/vmalert/web.qtpl:172
|
|
qw422016.N().S(`
|
|
<div class="group-heading alert-danger" data-bs-target="rules-`)
|
|
//line app/vmalert/web.qtpl:173
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:173
|
|
qw422016.N().S(`">
|
|
<span class="anchor" id="group-`)
|
|
//line app/vmalert/web.qtpl:174
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:174
|
|
qw422016.N().S(`"></span>
|
|
<a href="#group-`)
|
|
//line app/vmalert/web.qtpl:175
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:175
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:175
|
|
qw422016.E().S(g.Name)
|
|
//line app/vmalert/web.qtpl:175
|
|
if g.Type != "prometheus" {
|
|
//line app/vmalert/web.qtpl:175
|
|
qw422016.N().S(` (`)
|
|
//line app/vmalert/web.qtpl:175
|
|
qw422016.E().S(g.Type)
|
|
//line app/vmalert/web.qtpl:175
|
|
qw422016.N().S(`)`)
|
|
//line app/vmalert/web.qtpl:175
|
|
}
|
|
//line app/vmalert/web.qtpl:175
|
|
qw422016.N().S(`</a>
|
|
<span class="badge bg-danger" title="Number of active alerts">`)
|
|
//line app/vmalert/web.qtpl:176
|
|
qw422016.N().D(len(ga.Alerts))
|
|
//line app/vmalert/web.qtpl:176
|
|
qw422016.N().S(`</span>
|
|
<br>
|
|
<p class="fs-6 fw-lighter">`)
|
|
//line app/vmalert/web.qtpl:178
|
|
qw422016.E().S(g.File)
|
|
//line app/vmalert/web.qtpl:178
|
|
qw422016.N().S(`</p>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:181
|
|
var keys []string
|
|
alertsByRule := make(map[string][]*APIAlert)
|
|
for _, alert := range ga.Alerts {
|
|
if len(alertsByRule[alert.RuleID]) < 1 {
|
|
keys = append(keys, alert.RuleID)
|
|
}
|
|
alertsByRule[alert.RuleID] = append(alertsByRule[alert.RuleID], alert)
|
|
}
|
|
sort.Strings(keys)
|
|
|
|
//line app/vmalert/web.qtpl:190
|
|
qw422016.N().S(`
|
|
<div class="collapse" id="rules-`)
|
|
//line app/vmalert/web.qtpl:191
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:191
|
|
qw422016.N().S(`">
|
|
`)
|
|
//line app/vmalert/web.qtpl:192
|
|
for _, ruleID := range keys {
|
|
//line app/vmalert/web.qtpl:192
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:194
|
|
defaultAR := alertsByRule[ruleID][0]
|
|
var labelKeys []string
|
|
for k := range defaultAR.Labels {
|
|
labelKeys = append(labelKeys, k)
|
|
}
|
|
sort.Strings(labelKeys)
|
|
|
|
//line app/vmalert/web.qtpl:200
|
|
qw422016.N().S(`
|
|
<br>
|
|
<b>alert:</b> `)
|
|
//line app/vmalert/web.qtpl:202
|
|
qw422016.E().S(defaultAR.Name)
|
|
//line app/vmalert/web.qtpl:202
|
|
qw422016.N().S(` (`)
|
|
//line app/vmalert/web.qtpl:202
|
|
qw422016.N().D(len(alertsByRule[ruleID]))
|
|
//line app/vmalert/web.qtpl:202
|
|
qw422016.N().S(`)
|
|
| <span><a target="_blank" href="`)
|
|
//line app/vmalert/web.qtpl:203
|
|
qw422016.E().S(defaultAR.SourceLink)
|
|
//line app/vmalert/web.qtpl:203
|
|
qw422016.N().S(`">Source</a></span>
|
|
<br>
|
|
<b>expr:</b><code><pre>`)
|
|
//line app/vmalert/web.qtpl:205
|
|
qw422016.E().S(defaultAR.Expression)
|
|
//line app/vmalert/web.qtpl:205
|
|
qw422016.N().S(`</pre></code>
|
|
<table class="table table-striped table-hover table-sm">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Labels</th>
|
|
<th scope="col">State</th>
|
|
<th scope="col">Active at</th>
|
|
<th scope="col">Value</th>
|
|
<th scope="col">Link</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
`)
|
|
//line app/vmalert/web.qtpl:217
|
|
for _, ar := range alertsByRule[ruleID] {
|
|
//line app/vmalert/web.qtpl:217
|
|
qw422016.N().S(`
|
|
<tr>
|
|
<td>
|
|
`)
|
|
//line app/vmalert/web.qtpl:220
|
|
for _, k := range labelKeys {
|
|
//line app/vmalert/web.qtpl:220
|
|
qw422016.N().S(`
|
|
<span class="ms-1 badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:221
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:221
|
|
qw422016.N().S(`=`)
|
|
//line app/vmalert/web.qtpl:221
|
|
qw422016.E().S(ar.Labels[k])
|
|
//line app/vmalert/web.qtpl:221
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:222
|
|
}
|
|
//line app/vmalert/web.qtpl:222
|
|
qw422016.N().S(`
|
|
</td>
|
|
<td>`)
|
|
//line app/vmalert/web.qtpl:224
|
|
streambadgeState(qw422016, ar.State)
|
|
//line app/vmalert/web.qtpl:224
|
|
qw422016.N().S(`</td>
|
|
<td>
|
|
`)
|
|
//line app/vmalert/web.qtpl:226
|
|
qw422016.E().S(ar.ActiveAt.Format("2006-01-02T15:04:05Z07:00"))
|
|
//line app/vmalert/web.qtpl:226
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:227
|
|
if ar.Restored {
|
|
//line app/vmalert/web.qtpl:227
|
|
streambadgeRestored(qw422016)
|
|
//line app/vmalert/web.qtpl:227
|
|
}
|
|
//line app/vmalert/web.qtpl:227
|
|
qw422016.N().S(`
|
|
</td>
|
|
<td>`)
|
|
//line app/vmalert/web.qtpl:229
|
|
qw422016.E().S(ar.Value)
|
|
//line app/vmalert/web.qtpl:229
|
|
qw422016.N().S(`</td>
|
|
<td>
|
|
<a href="`)
|
|
//line app/vmalert/web.qtpl:231
|
|
qw422016.E().S(prefix + ar.WebLink())
|
|
//line app/vmalert/web.qtpl:231
|
|
qw422016.N().S(`">Details</a>
|
|
</td>
|
|
</tr>
|
|
`)
|
|
//line app/vmalert/web.qtpl:234
|
|
}
|
|
//line app/vmalert/web.qtpl:234
|
|
qw422016.N().S(`
|
|
</tbody>
|
|
</table>
|
|
`)
|
|
//line app/vmalert/web.qtpl:237
|
|
}
|
|
//line app/vmalert/web.qtpl:237
|
|
qw422016.N().S(`
|
|
</div>
|
|
<br>
|
|
`)
|
|
//line app/vmalert/web.qtpl:240
|
|
}
|
|
//line app/vmalert/web.qtpl:240
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:242
|
|
} else {
|
|
//line app/vmalert/web.qtpl:242
|
|
qw422016.N().S(`
|
|
<div>
|
|
<p>No active alerts...</p>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:246
|
|
}
|
|
//line app/vmalert/web.qtpl:246
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:248
|
|
tpl.StreamFooter(qw422016, r)
|
|
//line app/vmalert/web.qtpl:248
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:250
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:250
|
|
func WriteListAlerts(qq422016 qtio422016.Writer, r *http.Request, groupAlerts []GroupAlerts) {
|
|
//line app/vmalert/web.qtpl:250
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:250
|
|
StreamListAlerts(qw422016, r, groupAlerts)
|
|
//line app/vmalert/web.qtpl:250
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:250
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:250
|
|
func ListAlerts(r *http.Request, groupAlerts []GroupAlerts) string {
|
|
//line app/vmalert/web.qtpl:250
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:250
|
|
WriteListAlerts(qb422016, r, groupAlerts)
|
|
//line app/vmalert/web.qtpl:250
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:250
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:250
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:250
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:252
|
|
func StreamListTargets(qw422016 *qt422016.Writer, r *http.Request, targets map[notifier.TargetType][]notifier.Target) {
|
|
//line app/vmalert/web.qtpl:252
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:253
|
|
tpl.StreamHeader(qw422016, r, navItems, "Notifiers", configError())
|
|
//line app/vmalert/web.qtpl:253
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:254
|
|
if len(targets) > 0 {
|
|
//line app/vmalert/web.qtpl:254
|
|
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 app/vmalert/web.qtpl:259
|
|
var keys []string
|
|
for key := range targets {
|
|
keys = append(keys, string(key))
|
|
}
|
|
sort.Strings(keys)
|
|
|
|
//line app/vmalert/web.qtpl:264
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:266
|
|
for i := range keys {
|
|
//line app/vmalert/web.qtpl:266
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:267
|
|
typeK, ns := keys[i], targets[notifier.TargetType(keys[i])]
|
|
count := len(ns)
|
|
|
|
//line app/vmalert/web.qtpl:269
|
|
qw422016.N().S(`
|
|
<div class="group-heading" data-bs-target="notifiers-`)
|
|
//line app/vmalert/web.qtpl:270
|
|
qw422016.E().S(typeK)
|
|
//line app/vmalert/web.qtpl:270
|
|
qw422016.N().S(`">
|
|
<span class="anchor" id="group-`)
|
|
//line app/vmalert/web.qtpl:271
|
|
qw422016.E().S(typeK)
|
|
//line app/vmalert/web.qtpl:271
|
|
qw422016.N().S(`"></span>
|
|
<a href="#group-`)
|
|
//line app/vmalert/web.qtpl:272
|
|
qw422016.E().S(typeK)
|
|
//line app/vmalert/web.qtpl:272
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:272
|
|
qw422016.E().S(typeK)
|
|
//line app/vmalert/web.qtpl:272
|
|
qw422016.N().S(` (`)
|
|
//line app/vmalert/web.qtpl:272
|
|
qw422016.N().D(count)
|
|
//line app/vmalert/web.qtpl:272
|
|
qw422016.N().S(`)</a>
|
|
</div>
|
|
<div class="collapse show" id="notifiers-`)
|
|
//line app/vmalert/web.qtpl:274
|
|
qw422016.E().S(typeK)
|
|
//line app/vmalert/web.qtpl:274
|
|
qw422016.N().S(`">
|
|
<table class="table table-striped table-hover table-sm">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col">Labels</th>
|
|
<th scope="col">Address</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
`)
|
|
//line app/vmalert/web.qtpl:283
|
|
for _, n := range ns {
|
|
//line app/vmalert/web.qtpl:283
|
|
qw422016.N().S(`
|
|
<tr>
|
|
<td>
|
|
`)
|
|
//line app/vmalert/web.qtpl:286
|
|
for _, l := range n.Labels.GetLabels() {
|
|
//line app/vmalert/web.qtpl:286
|
|
qw422016.N().S(`
|
|
<span class="ms-1 badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:287
|
|
qw422016.E().S(l.Name)
|
|
//line app/vmalert/web.qtpl:287
|
|
qw422016.N().S(`=`)
|
|
//line app/vmalert/web.qtpl:287
|
|
qw422016.E().S(l.Value)
|
|
//line app/vmalert/web.qtpl:287
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:288
|
|
}
|
|
//line app/vmalert/web.qtpl:288
|
|
qw422016.N().S(`
|
|
</td>
|
|
<td>`)
|
|
//line app/vmalert/web.qtpl:290
|
|
qw422016.E().S(n.Notifier.Addr())
|
|
//line app/vmalert/web.qtpl:290
|
|
qw422016.N().S(`</td>
|
|
</tr>
|
|
`)
|
|
//line app/vmalert/web.qtpl:292
|
|
}
|
|
//line app/vmalert/web.qtpl:292
|
|
qw422016.N().S(`
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:296
|
|
}
|
|
//line app/vmalert/web.qtpl:296
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:298
|
|
} else {
|
|
//line app/vmalert/web.qtpl:298
|
|
qw422016.N().S(`
|
|
<div>
|
|
<p>No targets...</p>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:302
|
|
}
|
|
//line app/vmalert/web.qtpl:302
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:304
|
|
tpl.StreamFooter(qw422016, r)
|
|
//line app/vmalert/web.qtpl:304
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:306
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:306
|
|
func WriteListTargets(qq422016 qtio422016.Writer, r *http.Request, targets map[notifier.TargetType][]notifier.Target) {
|
|
//line app/vmalert/web.qtpl:306
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:306
|
|
StreamListTargets(qw422016, r, targets)
|
|
//line app/vmalert/web.qtpl:306
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:306
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:306
|
|
func ListTargets(r *http.Request, targets map[notifier.TargetType][]notifier.Target) string {
|
|
//line app/vmalert/web.qtpl:306
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:306
|
|
WriteListTargets(qb422016, r, targets)
|
|
//line app/vmalert/web.qtpl:306
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:306
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:306
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:306
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:308
|
|
func StreamAlert(qw422016 *qt422016.Writer, r *http.Request, alert *APIAlert) {
|
|
//line app/vmalert/web.qtpl:308
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:309
|
|
prefix := utils.Prefix(r.URL.Path)
|
|
|
|
//line app/vmalert/web.qtpl:309
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:310
|
|
tpl.StreamHeader(qw422016, r, navItems, "", configError())
|
|
//line app/vmalert/web.qtpl:310
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:312
|
|
var labelKeys []string
|
|
for k := range alert.Labels {
|
|
labelKeys = append(labelKeys, k)
|
|
}
|
|
sort.Strings(labelKeys)
|
|
|
|
var annotationKeys []string
|
|
for k := range alert.Annotations {
|
|
annotationKeys = append(annotationKeys, k)
|
|
}
|
|
sort.Strings(annotationKeys)
|
|
|
|
//line app/vmalert/web.qtpl:323
|
|
qw422016.N().S(`
|
|
<div class="display-6 pb-3 mb-3">Alert: `)
|
|
//line app/vmalert/web.qtpl:324
|
|
qw422016.E().S(alert.Name)
|
|
//line app/vmalert/web.qtpl:324
|
|
qw422016.N().S(`<span class="ms-2 badge `)
|
|
//line app/vmalert/web.qtpl:324
|
|
if alert.State == "firing" {
|
|
//line app/vmalert/web.qtpl:324
|
|
qw422016.N().S(`bg-danger`)
|
|
//line app/vmalert/web.qtpl:324
|
|
} else {
|
|
//line app/vmalert/web.qtpl:324
|
|
qw422016.N().S(` bg-warning text-dark`)
|
|
//line app/vmalert/web.qtpl:324
|
|
}
|
|
//line app/vmalert/web.qtpl:324
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:324
|
|
qw422016.E().S(alert.State)
|
|
//line app/vmalert/web.qtpl:324
|
|
qw422016.N().S(`</span></div>
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Active at
|
|
</div>
|
|
<div class="col">
|
|
`)
|
|
//line app/vmalert/web.qtpl:331
|
|
qw422016.E().S(alert.ActiveAt.Format("2006-01-02T15:04:05Z07:00"))
|
|
//line app/vmalert/web.qtpl:331
|
|
qw422016.N().S(`
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Expr
|
|
</div>
|
|
<div class="col">
|
|
<code><pre>`)
|
|
//line app/vmalert/web.qtpl:341
|
|
qw422016.E().S(alert.Expression)
|
|
//line app/vmalert/web.qtpl:341
|
|
qw422016.N().S(`</pre></code>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Labels
|
|
</div>
|
|
<div class="col">
|
|
`)
|
|
//line app/vmalert/web.qtpl:351
|
|
for _, k := range labelKeys {
|
|
//line app/vmalert/web.qtpl:351
|
|
qw422016.N().S(`
|
|
<span class="m-1 badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:352
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:352
|
|
qw422016.N().S(`=`)
|
|
//line app/vmalert/web.qtpl:352
|
|
qw422016.E().S(alert.Labels[k])
|
|
//line app/vmalert/web.qtpl:352
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:353
|
|
}
|
|
//line app/vmalert/web.qtpl:353
|
|
qw422016.N().S(`
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Annotations
|
|
</div>
|
|
<div class="col">
|
|
`)
|
|
//line app/vmalert/web.qtpl:363
|
|
for _, k := range annotationKeys {
|
|
//line app/vmalert/web.qtpl:363
|
|
qw422016.N().S(`
|
|
<b>`)
|
|
//line app/vmalert/web.qtpl:364
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:364
|
|
qw422016.N().S(`:</b><br>
|
|
<p>`)
|
|
//line app/vmalert/web.qtpl:365
|
|
qw422016.E().S(alert.Annotations[k])
|
|
//line app/vmalert/web.qtpl:365
|
|
qw422016.N().S(`</p>
|
|
`)
|
|
//line app/vmalert/web.qtpl:366
|
|
}
|
|
//line app/vmalert/web.qtpl:366
|
|
qw422016.N().S(`
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Group
|
|
</div>
|
|
<div class="col">
|
|
<a target="_blank" href="`)
|
|
//line app/vmalert/web.qtpl:376
|
|
qw422016.E().S(prefix)
|
|
//line app/vmalert/web.qtpl:376
|
|
qw422016.N().S(`groups#group-`)
|
|
//line app/vmalert/web.qtpl:376
|
|
qw422016.E().S(alert.GroupID)
|
|
//line app/vmalert/web.qtpl:376
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:376
|
|
qw422016.E().S(alert.GroupID)
|
|
//line app/vmalert/web.qtpl:376
|
|
qw422016.N().S(`</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Source link
|
|
</div>
|
|
<div class="col">
|
|
<a target="_blank" href="`)
|
|
//line app/vmalert/web.qtpl:386
|
|
qw422016.E().S(alert.SourceLink)
|
|
//line app/vmalert/web.qtpl:386
|
|
qw422016.N().S(`">Link</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:390
|
|
tpl.StreamFooter(qw422016, r)
|
|
//line app/vmalert/web.qtpl:390
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:392
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:392
|
|
func WriteAlert(qq422016 qtio422016.Writer, r *http.Request, alert *APIAlert) {
|
|
//line app/vmalert/web.qtpl:392
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:392
|
|
StreamAlert(qw422016, r, alert)
|
|
//line app/vmalert/web.qtpl:392
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:392
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:392
|
|
func Alert(r *http.Request, alert *APIAlert) string {
|
|
//line app/vmalert/web.qtpl:392
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:392
|
|
WriteAlert(qb422016, r, alert)
|
|
//line app/vmalert/web.qtpl:392
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:392
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:392
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:392
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:395
|
|
func StreamRuleDetails(qw422016 *qt422016.Writer, r *http.Request, rule APIRule) {
|
|
//line app/vmalert/web.qtpl:395
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:396
|
|
prefix := utils.Prefix(r.URL.Path)
|
|
|
|
//line app/vmalert/web.qtpl:396
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:397
|
|
tpl.StreamHeader(qw422016, r, navItems, "", configError())
|
|
//line app/vmalert/web.qtpl:397
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:399
|
|
var labelKeys []string
|
|
for k := range rule.Labels {
|
|
labelKeys = append(labelKeys, k)
|
|
}
|
|
sort.Strings(labelKeys)
|
|
|
|
var annotationKeys []string
|
|
for k := range rule.Annotations {
|
|
annotationKeys = append(annotationKeys, k)
|
|
}
|
|
sort.Strings(annotationKeys)
|
|
|
|
var seriesFetchedEnabled bool
|
|
var seriesFetchedWarning bool
|
|
for _, u := range rule.Updates {
|
|
if u.seriesFetched != nil {
|
|
seriesFetchedEnabled = true
|
|
if *u.seriesFetched == 0 && u.samples == 0 {
|
|
seriesFetchedWarning = true
|
|
}
|
|
}
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:422
|
|
qw422016.N().S(`
|
|
<div class="display-6 pb-3 mb-3">Rule: `)
|
|
//line app/vmalert/web.qtpl:423
|
|
qw422016.E().S(rule.Name)
|
|
//line app/vmalert/web.qtpl:423
|
|
qw422016.N().S(`<span class="ms-2 badge `)
|
|
//line app/vmalert/web.qtpl:423
|
|
if rule.Health != "ok" {
|
|
//line app/vmalert/web.qtpl:423
|
|
qw422016.N().S(`bg-danger`)
|
|
//line app/vmalert/web.qtpl:423
|
|
} else {
|
|
//line app/vmalert/web.qtpl:423
|
|
qw422016.N().S(` bg-success text-dark`)
|
|
//line app/vmalert/web.qtpl:423
|
|
}
|
|
//line app/vmalert/web.qtpl:423
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:423
|
|
qw422016.E().S(rule.Health)
|
|
//line app/vmalert/web.qtpl:423
|
|
qw422016.N().S(`</span></div>
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Expr
|
|
</div>
|
|
<div class="col">
|
|
<code><pre>`)
|
|
//line app/vmalert/web.qtpl:430
|
|
qw422016.E().S(rule.Query)
|
|
//line app/vmalert/web.qtpl:430
|
|
qw422016.N().S(`</pre></code>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:434
|
|
if rule.Type == "alerting" {
|
|
//line app/vmalert/web.qtpl:434
|
|
qw422016.N().S(`
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
For
|
|
</div>
|
|
<div class="col">
|
|
`)
|
|
//line app/vmalert/web.qtpl:441
|
|
qw422016.E().V(rule.Duration)
|
|
//line app/vmalert/web.qtpl:441
|
|
qw422016.N().S(` seconds
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:445
|
|
}
|
|
//line app/vmalert/web.qtpl:445
|
|
qw422016.N().S(`
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Labels
|
|
</div>
|
|
<div class="col">
|
|
`)
|
|
//line app/vmalert/web.qtpl:452
|
|
for _, k := range labelKeys {
|
|
//line app/vmalert/web.qtpl:452
|
|
qw422016.N().S(`
|
|
<span class="m-1 badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:453
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:453
|
|
qw422016.N().S(`=`)
|
|
//line app/vmalert/web.qtpl:453
|
|
qw422016.E().S(rule.Labels[k])
|
|
//line app/vmalert/web.qtpl:453
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:454
|
|
}
|
|
//line app/vmalert/web.qtpl:454
|
|
qw422016.N().S(`
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:458
|
|
if rule.Type == "alerting" {
|
|
//line app/vmalert/web.qtpl:458
|
|
qw422016.N().S(`
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Annotations
|
|
</div>
|
|
<div class="col">
|
|
`)
|
|
//line app/vmalert/web.qtpl:465
|
|
for _, k := range annotationKeys {
|
|
//line app/vmalert/web.qtpl:465
|
|
qw422016.N().S(`
|
|
<b>`)
|
|
//line app/vmalert/web.qtpl:466
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:466
|
|
qw422016.N().S(`:</b><br>
|
|
<p>`)
|
|
//line app/vmalert/web.qtpl:467
|
|
qw422016.E().S(rule.Annotations[k])
|
|
//line app/vmalert/web.qtpl:467
|
|
qw422016.N().S(`</p>
|
|
`)
|
|
//line app/vmalert/web.qtpl:468
|
|
}
|
|
//line app/vmalert/web.qtpl:468
|
|
qw422016.N().S(`
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Debug
|
|
</div>
|
|
<div class="col">
|
|
`)
|
|
//line app/vmalert/web.qtpl:478
|
|
qw422016.E().V(rule.Debug)
|
|
//line app/vmalert/web.qtpl:478
|
|
qw422016.N().S(`
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:482
|
|
}
|
|
//line app/vmalert/web.qtpl:482
|
|
qw422016.N().S(`
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Group
|
|
</div>
|
|
<div class="col">
|
|
<a target="_blank" href="`)
|
|
//line app/vmalert/web.qtpl:489
|
|
qw422016.E().S(prefix)
|
|
//line app/vmalert/web.qtpl:489
|
|
qw422016.N().S(`groups#group-`)
|
|
//line app/vmalert/web.qtpl:489
|
|
qw422016.E().S(rule.GroupID)
|
|
//line app/vmalert/web.qtpl:489
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:489
|
|
qw422016.E().S(rule.GroupID)
|
|
//line app/vmalert/web.qtpl:489
|
|
qw422016.N().S(`</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<br>
|
|
`)
|
|
//line app/vmalert/web.qtpl:495
|
|
if seriesFetchedWarning {
|
|
//line app/vmalert/web.qtpl:495
|
|
qw422016.N().S(`
|
|
<div class="alert alert-warning" role="alert">
|
|
<strong>Warning:</strong> some of updates have "Series fetched" equal to 0.<br>
|
|
It might be that either this data is missing in the datasource or there is a typo in rule's expression.
|
|
For example, <strong>foo{label="bar"} > 0</strong> could never trigger because <strong>foo{label="bar"}</strong>
|
|
metric doesn't exist.
|
|
<br>
|
|
Rule's expressions without time series selector, like <strong>expr: 42</strong> or <strong>expr: time()</strong>
|
|
aren't fetching time series from datasource, so they could have "Series fetched" equal to 0 and this won't be a problem.
|
|
<br>
|
|
See more details about this detection <a target="_blank" href="https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4039">here</a>.
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:507
|
|
}
|
|
//line app/vmalert/web.qtpl:507
|
|
qw422016.N().S(`
|
|
<div class="display-6 pb-3">Last `)
|
|
//line app/vmalert/web.qtpl:508
|
|
qw422016.N().D(len(rule.Updates))
|
|
//line app/vmalert/web.qtpl:508
|
|
qw422016.N().S(`/`)
|
|
//line app/vmalert/web.qtpl:508
|
|
qw422016.N().D(rule.MaxUpdates)
|
|
//line app/vmalert/web.qtpl:508
|
|
qw422016.N().S(` updates</span>:</div>
|
|
<table class="table table-striped table-hover table-sm">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" title="The time when event was created">Updated at</th>
|
|
<th scope="col" style="width: 10%" class="text-center" title="How many samples were returned">Samples</th>
|
|
`)
|
|
//line app/vmalert/web.qtpl:514
|
|
if seriesFetchedEnabled {
|
|
//line app/vmalert/web.qtpl:514
|
|
qw422016.N().S(`<th scope="col" style="width: 10%" class="text-center" title="How many series were scanned by datasource during the evaluation">Series fetched</th>`)
|
|
//line app/vmalert/web.qtpl:514
|
|
}
|
|
//line app/vmalert/web.qtpl:514
|
|
qw422016.N().S(`
|
|
<th scope="col" style="width: 10%" class="text-center" title="How many seconds request took">Duration</th>
|
|
<th scope="col" class="text-center" title="Time used for rule execution">Executed at</th>
|
|
<th scope="col" class="text-center" title="cURL command with request example">cURL</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:522
|
|
for _, u := range rule.Updates {
|
|
//line app/vmalert/web.qtpl:522
|
|
qw422016.N().S(`
|
|
<tr`)
|
|
//line app/vmalert/web.qtpl:523
|
|
if u.err != nil {
|
|
//line app/vmalert/web.qtpl:523
|
|
qw422016.N().S(` class="alert-danger"`)
|
|
//line app/vmalert/web.qtpl:523
|
|
}
|
|
//line app/vmalert/web.qtpl:523
|
|
qw422016.N().S(`>
|
|
<td>
|
|
<span class="badge bg-primary rounded-pill me-3" title="Updated at">`)
|
|
//line app/vmalert/web.qtpl:525
|
|
qw422016.E().S(u.time.Format(time.RFC3339))
|
|
//line app/vmalert/web.qtpl:525
|
|
qw422016.N().S(`</span>
|
|
</td>
|
|
<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:527
|
|
qw422016.N().D(u.samples)
|
|
//line app/vmalert/web.qtpl:527
|
|
qw422016.N().S(`</td>
|
|
`)
|
|
//line app/vmalert/web.qtpl:528
|
|
if seriesFetchedEnabled {
|
|
//line app/vmalert/web.qtpl:528
|
|
qw422016.N().S(`<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:528
|
|
if u.seriesFetched != nil {
|
|
//line app/vmalert/web.qtpl:528
|
|
qw422016.N().D(*u.seriesFetched)
|
|
//line app/vmalert/web.qtpl:528
|
|
}
|
|
//line app/vmalert/web.qtpl:528
|
|
qw422016.N().S(`</td>`)
|
|
//line app/vmalert/web.qtpl:528
|
|
}
|
|
//line app/vmalert/web.qtpl:528
|
|
qw422016.N().S(`
|
|
<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:529
|
|
qw422016.N().FPrec(u.duration.Seconds(), 3)
|
|
//line app/vmalert/web.qtpl:529
|
|
qw422016.N().S(`s</td>
|
|
<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:530
|
|
qw422016.E().S(u.at.Format(time.RFC3339))
|
|
//line app/vmalert/web.qtpl:530
|
|
qw422016.N().S(`</td>
|
|
<td>
|
|
<textarea class="curl-area" rows="1" onclick="this.focus();this.select()">`)
|
|
//line app/vmalert/web.qtpl:532
|
|
qw422016.E().S(u.curl)
|
|
//line app/vmalert/web.qtpl:532
|
|
qw422016.N().S(`</textarea>
|
|
</td>
|
|
</tr>
|
|
</li>
|
|
`)
|
|
//line app/vmalert/web.qtpl:536
|
|
if u.err != nil {
|
|
//line app/vmalert/web.qtpl:536
|
|
qw422016.N().S(`
|
|
<tr`)
|
|
//line app/vmalert/web.qtpl:537
|
|
if u.err != nil {
|
|
//line app/vmalert/web.qtpl:537
|
|
qw422016.N().S(` class="alert-danger"`)
|
|
//line app/vmalert/web.qtpl:537
|
|
}
|
|
//line app/vmalert/web.qtpl:537
|
|
qw422016.N().S(`>
|
|
<td colspan="`)
|
|
//line app/vmalert/web.qtpl:538
|
|
if seriesFetchedEnabled {
|
|
//line app/vmalert/web.qtpl:538
|
|
qw422016.N().S(`6`)
|
|
//line app/vmalert/web.qtpl:538
|
|
} else {
|
|
//line app/vmalert/web.qtpl:538
|
|
qw422016.N().S(`5`)
|
|
//line app/vmalert/web.qtpl:538
|
|
}
|
|
//line app/vmalert/web.qtpl:538
|
|
qw422016.N().S(`">
|
|
<span class="alert-danger">`)
|
|
//line app/vmalert/web.qtpl:539
|
|
qw422016.E().V(u.err)
|
|
//line app/vmalert/web.qtpl:539
|
|
qw422016.N().S(`</span>
|
|
</td>
|
|
</tr>
|
|
`)
|
|
//line app/vmalert/web.qtpl:542
|
|
}
|
|
//line app/vmalert/web.qtpl:542
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:543
|
|
}
|
|
//line app/vmalert/web.qtpl:543
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:545
|
|
tpl.StreamFooter(qw422016, r)
|
|
//line app/vmalert/web.qtpl:545
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:546
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:546
|
|
func WriteRuleDetails(qq422016 qtio422016.Writer, r *http.Request, rule APIRule) {
|
|
//line app/vmalert/web.qtpl:546
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:546
|
|
StreamRuleDetails(qw422016, r, rule)
|
|
//line app/vmalert/web.qtpl:546
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:546
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:546
|
|
func RuleDetails(r *http.Request, rule APIRule) string {
|
|
//line app/vmalert/web.qtpl:546
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:546
|
|
WriteRuleDetails(qb422016, r, rule)
|
|
//line app/vmalert/web.qtpl:546
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:546
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:546
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:546
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:550
|
|
func streambadgeState(qw422016 *qt422016.Writer, state string) {
|
|
//line app/vmalert/web.qtpl:550
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:552
|
|
badgeClass := "bg-warning text-dark"
|
|
if state == "firing" {
|
|
badgeClass = "bg-danger"
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:556
|
|
qw422016.N().S(`
|
|
<span class="badge `)
|
|
//line app/vmalert/web.qtpl:557
|
|
qw422016.E().S(badgeClass)
|
|
//line app/vmalert/web.qtpl:557
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:557
|
|
qw422016.E().S(state)
|
|
//line app/vmalert/web.qtpl:557
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:558
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:558
|
|
func writebadgeState(qq422016 qtio422016.Writer, state string) {
|
|
//line app/vmalert/web.qtpl:558
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:558
|
|
streambadgeState(qw422016, state)
|
|
//line app/vmalert/web.qtpl:558
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:558
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:558
|
|
func badgeState(state string) string {
|
|
//line app/vmalert/web.qtpl:558
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:558
|
|
writebadgeState(qb422016, state)
|
|
//line app/vmalert/web.qtpl:558
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:558
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:558
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:558
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:560
|
|
func streambadgeRestored(qw422016 *qt422016.Writer) {
|
|
//line app/vmalert/web.qtpl:560
|
|
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 app/vmalert/web.qtpl:562
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:562
|
|
func writebadgeRestored(qq422016 qtio422016.Writer) {
|
|
//line app/vmalert/web.qtpl:562
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:562
|
|
streambadgeRestored(qw422016)
|
|
//line app/vmalert/web.qtpl:562
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:562
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:562
|
|
func badgeRestored() string {
|
|
//line app/vmalert/web.qtpl:562
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:562
|
|
writebadgeRestored(qb422016)
|
|
//line app/vmalert/web.qtpl:562
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:562
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:562
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:562
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:564
|
|
func streamseriesFetchedWarn(qw422016 *qt422016.Writer, r APIRule) {
|
|
//line app/vmalert/web.qtpl:564
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:565
|
|
if isNoMatch(r) {
|
|
//line app/vmalert/web.qtpl:565
|
|
qw422016.N().S(`
|
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
data-bs-toggle="tooltip"
|
|
title="No match! This rule's last evaluation hasn't selected any time series from the datasource.
|
|
It might be that either this data is missing in the datasource or there is a typo in rule's expression.
|
|
See more in Details."
|
|
width="18" height="18" fill="currentColor" class="bi bi-exclamation-triangle-fill flex-shrink-0 me-2" viewBox="0 0 16 16" role="img" aria-label="Warning:">
|
|
<path d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"/>
|
|
</svg>
|
|
`)
|
|
//line app/vmalert/web.qtpl:574
|
|
}
|
|
//line app/vmalert/web.qtpl:574
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:575
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:575
|
|
func writeseriesFetchedWarn(qq422016 qtio422016.Writer, r APIRule) {
|
|
//line app/vmalert/web.qtpl:575
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:575
|
|
streamseriesFetchedWarn(qw422016, r)
|
|
//line app/vmalert/web.qtpl:575
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:575
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:575
|
|
func seriesFetchedWarn(r APIRule) string {
|
|
//line app/vmalert/web.qtpl:575
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:575
|
|
writeseriesFetchedWarn(qb422016, r)
|
|
//line app/vmalert/web.qtpl:575
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:575
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:575
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:575
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:578
|
|
func isNoMatch(r APIRule) bool {
|
|
return r.LastSamples == 0 && r.LastSeriesFetched != nil && *r.LastSeriesFetched == 0
|
|
}
|