mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-21 07:56:26 +01:00
130e0ea5f0
1. split package rule under /app/vmalert, expose needed objects 2. add vmalert-tool with unittest subcmd https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2945
1911 lines
55 KiB
Go
1911 lines
55 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", getLastConfigError())
|
|
//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", getLastConfigError())
|
|
//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(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:119
|
|
if r.KeepFiringFor > 0 {
|
|
//line app/vmalert/web.qtpl:119
|
|
qw422016.N().S(`
|
|
<b>alert:</b> `)
|
|
//line app/vmalert/web.qtpl:120
|
|
qw422016.E().S(r.Name)
|
|
//line app/vmalert/web.qtpl:120
|
|
qw422016.N().S(` (for: `)
|
|
//line app/vmalert/web.qtpl:120
|
|
qw422016.E().V(r.Duration)
|
|
//line app/vmalert/web.qtpl:120
|
|
qw422016.N().S(` seconds, keep_firing_for: `)
|
|
//line app/vmalert/web.qtpl:120
|
|
qw422016.E().V(r.KeepFiringFor)
|
|
//line app/vmalert/web.qtpl:120
|
|
qw422016.N().S(` seconds)
|
|
`)
|
|
//line app/vmalert/web.qtpl:121
|
|
} else {
|
|
//line app/vmalert/web.qtpl:121
|
|
qw422016.N().S(`
|
|
<b>alert:</b> `)
|
|
//line app/vmalert/web.qtpl:122
|
|
qw422016.E().S(r.Name)
|
|
//line app/vmalert/web.qtpl:122
|
|
qw422016.N().S(` (for: `)
|
|
//line app/vmalert/web.qtpl:122
|
|
qw422016.E().V(r.Duration)
|
|
//line app/vmalert/web.qtpl:122
|
|
qw422016.N().S(` seconds)
|
|
`)
|
|
//line app/vmalert/web.qtpl:123
|
|
}
|
|
//line app/vmalert/web.qtpl:123
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:124
|
|
} else {
|
|
//line app/vmalert/web.qtpl:124
|
|
qw422016.N().S(`
|
|
<b>record:</b> `)
|
|
//line app/vmalert/web.qtpl:125
|
|
qw422016.E().S(r.Name)
|
|
//line app/vmalert/web.qtpl:125
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:126
|
|
}
|
|
//line app/vmalert/web.qtpl:126
|
|
qw422016.N().S(`
|
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:128
|
|
streamseriesFetchedWarn(qw422016, r)
|
|
//line app/vmalert/web.qtpl:128
|
|
qw422016.N().S(`
|
|
<span><a target="_blank" href="`)
|
|
//line app/vmalert/web.qtpl:129
|
|
qw422016.E().S(prefix + r.WebLink())
|
|
//line app/vmalert/web.qtpl:129
|
|
qw422016.N().S(`">Details</a></span>
|
|
</div>
|
|
<div class="col-12">
|
|
<code><pre>`)
|
|
//line app/vmalert/web.qtpl:132
|
|
qw422016.E().S(r.Query)
|
|
//line app/vmalert/web.qtpl:132
|
|
qw422016.N().S(`</pre></code>
|
|
</div>
|
|
<div class="col-12 mb-2">
|
|
`)
|
|
//line app/vmalert/web.qtpl:135
|
|
if len(r.Labels) > 0 {
|
|
//line app/vmalert/web.qtpl:135
|
|
qw422016.N().S(` <b>Labels:</b>`)
|
|
//line app/vmalert/web.qtpl:135
|
|
}
|
|
//line app/vmalert/web.qtpl:135
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:136
|
|
for k, v := range r.Labels {
|
|
//line app/vmalert/web.qtpl:136
|
|
qw422016.N().S(`
|
|
<span class="ms-1 badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:137
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:137
|
|
qw422016.N().S(`=`)
|
|
//line app/vmalert/web.qtpl:137
|
|
qw422016.E().S(v)
|
|
//line app/vmalert/web.qtpl:137
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:138
|
|
}
|
|
//line app/vmalert/web.qtpl:138
|
|
qw422016.N().S(`
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:140
|
|
if r.LastError != "" {
|
|
//line app/vmalert/web.qtpl:140
|
|
qw422016.N().S(`
|
|
<div class="col-12">
|
|
<b>Error:</b>
|
|
<div class="error-cell">
|
|
`)
|
|
//line app/vmalert/web.qtpl:144
|
|
qw422016.E().S(r.LastError)
|
|
//line app/vmalert/web.qtpl:144
|
|
qw422016.N().S(`
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:147
|
|
}
|
|
//line app/vmalert/web.qtpl:147
|
|
qw422016.N().S(`
|
|
</div>
|
|
</td>
|
|
<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:150
|
|
qw422016.N().D(r.LastSamples)
|
|
//line app/vmalert/web.qtpl:150
|
|
qw422016.N().S(`</td>
|
|
<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:151
|
|
qw422016.N().FPrec(time.Since(r.LastEvaluation).Seconds(), 3)
|
|
//line app/vmalert/web.qtpl:151
|
|
qw422016.N().S(`s ago</td>
|
|
</tr>
|
|
`)
|
|
//line app/vmalert/web.qtpl:153
|
|
}
|
|
//line app/vmalert/web.qtpl:153
|
|
qw422016.N().S(`
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:157
|
|
}
|
|
//line app/vmalert/web.qtpl:157
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:158
|
|
} else {
|
|
//line app/vmalert/web.qtpl:158
|
|
qw422016.N().S(`
|
|
<div>
|
|
<p>No groups...</p>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:162
|
|
}
|
|
//line app/vmalert/web.qtpl:162
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:164
|
|
tpl.StreamFooter(qw422016, r)
|
|
//line app/vmalert/web.qtpl:164
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:166
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:166
|
|
func WriteListGroups(qq422016 qtio422016.Writer, r *http.Request, originGroups []apiGroup) {
|
|
//line app/vmalert/web.qtpl:166
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:166
|
|
StreamListGroups(qw422016, r, originGroups)
|
|
//line app/vmalert/web.qtpl:166
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:166
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:166
|
|
func ListGroups(r *http.Request, originGroups []apiGroup) string {
|
|
//line app/vmalert/web.qtpl:166
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:166
|
|
WriteListGroups(qb422016, r, originGroups)
|
|
//line app/vmalert/web.qtpl:166
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:166
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:166
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:166
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:169
|
|
func StreamListAlerts(qw422016 *qt422016.Writer, r *http.Request, groupAlerts []groupAlerts) {
|
|
//line app/vmalert/web.qtpl:169
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:170
|
|
prefix := utils.Prefix(r.URL.Path)
|
|
|
|
//line app/vmalert/web.qtpl:170
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:171
|
|
tpl.StreamHeader(qw422016, r, navItems, "Alerts", getLastConfigError())
|
|
//line app/vmalert/web.qtpl:171
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:172
|
|
if len(groupAlerts) > 0 {
|
|
//line app/vmalert/web.qtpl:172
|
|
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:175
|
|
for _, ga := range groupAlerts {
|
|
//line app/vmalert/web.qtpl:175
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:176
|
|
g := ga.Group
|
|
|
|
//line app/vmalert/web.qtpl:176
|
|
qw422016.N().S(`
|
|
<div class="group-heading alert-danger" data-bs-target="rules-`)
|
|
//line app/vmalert/web.qtpl:177
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:177
|
|
qw422016.N().S(`">
|
|
<span class="anchor" id="group-`)
|
|
//line app/vmalert/web.qtpl:178
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:178
|
|
qw422016.N().S(`"></span>
|
|
<a href="#group-`)
|
|
//line app/vmalert/web.qtpl:179
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:179
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:179
|
|
qw422016.E().S(g.Name)
|
|
//line app/vmalert/web.qtpl:179
|
|
if g.Type != "prometheus" {
|
|
//line app/vmalert/web.qtpl:179
|
|
qw422016.N().S(` (`)
|
|
//line app/vmalert/web.qtpl:179
|
|
qw422016.E().S(g.Type)
|
|
//line app/vmalert/web.qtpl:179
|
|
qw422016.N().S(`)`)
|
|
//line app/vmalert/web.qtpl:179
|
|
}
|
|
//line app/vmalert/web.qtpl:179
|
|
qw422016.N().S(`</a>
|
|
<span class="badge bg-danger" title="Number of active alerts">`)
|
|
//line app/vmalert/web.qtpl:180
|
|
qw422016.N().D(len(ga.Alerts))
|
|
//line app/vmalert/web.qtpl:180
|
|
qw422016.N().S(`</span>
|
|
<br>
|
|
<p class="fs-6 fw-lighter">`)
|
|
//line app/vmalert/web.qtpl:182
|
|
qw422016.E().S(g.File)
|
|
//line app/vmalert/web.qtpl:182
|
|
qw422016.N().S(`</p>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:185
|
|
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:194
|
|
qw422016.N().S(`
|
|
<div class="collapse" id="rules-`)
|
|
//line app/vmalert/web.qtpl:195
|
|
qw422016.E().S(g.ID)
|
|
//line app/vmalert/web.qtpl:195
|
|
qw422016.N().S(`">
|
|
`)
|
|
//line app/vmalert/web.qtpl:196
|
|
for _, ruleID := range keys {
|
|
//line app/vmalert/web.qtpl:196
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:198
|
|
defaultAR := alertsByRule[ruleID][0]
|
|
var labelKeys []string
|
|
for k := range defaultAR.Labels {
|
|
labelKeys = append(labelKeys, k)
|
|
}
|
|
sort.Strings(labelKeys)
|
|
|
|
//line app/vmalert/web.qtpl:204
|
|
qw422016.N().S(`
|
|
<br>
|
|
<b>alert:</b> `)
|
|
//line app/vmalert/web.qtpl:206
|
|
qw422016.E().S(defaultAR.Name)
|
|
//line app/vmalert/web.qtpl:206
|
|
qw422016.N().S(` (`)
|
|
//line app/vmalert/web.qtpl:206
|
|
qw422016.N().D(len(alertsByRule[ruleID]))
|
|
//line app/vmalert/web.qtpl:206
|
|
qw422016.N().S(`)
|
|
| <span><a target="_blank" href="`)
|
|
//line app/vmalert/web.qtpl:207
|
|
qw422016.E().S(defaultAR.SourceLink)
|
|
//line app/vmalert/web.qtpl:207
|
|
qw422016.N().S(`">Source</a></span>
|
|
<br>
|
|
<b>expr:</b><code><pre>`)
|
|
//line app/vmalert/web.qtpl:209
|
|
qw422016.E().S(defaultAR.Expression)
|
|
//line app/vmalert/web.qtpl:209
|
|
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:221
|
|
for _, ar := range alertsByRule[ruleID] {
|
|
//line app/vmalert/web.qtpl:221
|
|
qw422016.N().S(`
|
|
<tr>
|
|
<td>
|
|
`)
|
|
//line app/vmalert/web.qtpl:224
|
|
for _, k := range labelKeys {
|
|
//line app/vmalert/web.qtpl:224
|
|
qw422016.N().S(`
|
|
<span class="ms-1 badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:225
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:225
|
|
qw422016.N().S(`=`)
|
|
//line app/vmalert/web.qtpl:225
|
|
qw422016.E().S(ar.Labels[k])
|
|
//line app/vmalert/web.qtpl:225
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:226
|
|
}
|
|
//line app/vmalert/web.qtpl:226
|
|
qw422016.N().S(`
|
|
</td>
|
|
<td>`)
|
|
//line app/vmalert/web.qtpl:228
|
|
streambadgeState(qw422016, ar.State)
|
|
//line app/vmalert/web.qtpl:228
|
|
qw422016.N().S(`</td>
|
|
<td>
|
|
`)
|
|
//line app/vmalert/web.qtpl:230
|
|
qw422016.E().S(ar.ActiveAt.Format("2006-01-02T15:04:05Z07:00"))
|
|
//line app/vmalert/web.qtpl:230
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:231
|
|
if ar.Restored {
|
|
//line app/vmalert/web.qtpl:231
|
|
streambadgeRestored(qw422016)
|
|
//line app/vmalert/web.qtpl:231
|
|
}
|
|
//line app/vmalert/web.qtpl:231
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:232
|
|
if ar.Stabilizing {
|
|
//line app/vmalert/web.qtpl:232
|
|
streambadgeStabilizing(qw422016)
|
|
//line app/vmalert/web.qtpl:232
|
|
}
|
|
//line app/vmalert/web.qtpl:232
|
|
qw422016.N().S(`
|
|
</td>
|
|
<td>`)
|
|
//line app/vmalert/web.qtpl:234
|
|
qw422016.E().S(ar.Value)
|
|
//line app/vmalert/web.qtpl:234
|
|
qw422016.N().S(`</td>
|
|
<td>
|
|
<a href="`)
|
|
//line app/vmalert/web.qtpl:236
|
|
qw422016.E().S(prefix + ar.WebLink())
|
|
//line app/vmalert/web.qtpl:236
|
|
qw422016.N().S(`">Details</a>
|
|
</td>
|
|
</tr>
|
|
`)
|
|
//line app/vmalert/web.qtpl:239
|
|
}
|
|
//line app/vmalert/web.qtpl:239
|
|
qw422016.N().S(`
|
|
</tbody>
|
|
</table>
|
|
`)
|
|
//line app/vmalert/web.qtpl:242
|
|
}
|
|
//line app/vmalert/web.qtpl:242
|
|
qw422016.N().S(`
|
|
</div>
|
|
<br>
|
|
`)
|
|
//line app/vmalert/web.qtpl:245
|
|
}
|
|
//line app/vmalert/web.qtpl:245
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:247
|
|
} else {
|
|
//line app/vmalert/web.qtpl:247
|
|
qw422016.N().S(`
|
|
<div>
|
|
<p>No active alerts...</p>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:251
|
|
}
|
|
//line app/vmalert/web.qtpl:251
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:253
|
|
tpl.StreamFooter(qw422016, r)
|
|
//line app/vmalert/web.qtpl:253
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:255
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:255
|
|
func WriteListAlerts(qq422016 qtio422016.Writer, r *http.Request, groupAlerts []groupAlerts) {
|
|
//line app/vmalert/web.qtpl:255
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:255
|
|
StreamListAlerts(qw422016, r, groupAlerts)
|
|
//line app/vmalert/web.qtpl:255
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:255
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:255
|
|
func ListAlerts(r *http.Request, groupAlerts []groupAlerts) string {
|
|
//line app/vmalert/web.qtpl:255
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:255
|
|
WriteListAlerts(qb422016, r, groupAlerts)
|
|
//line app/vmalert/web.qtpl:255
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:255
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:255
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:255
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:257
|
|
func StreamListTargets(qw422016 *qt422016.Writer, r *http.Request, targets map[notifier.TargetType][]notifier.Target) {
|
|
//line app/vmalert/web.qtpl:257
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:258
|
|
tpl.StreamHeader(qw422016, r, navItems, "Notifiers", getLastConfigError())
|
|
//line app/vmalert/web.qtpl:258
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:259
|
|
if len(targets) > 0 {
|
|
//line app/vmalert/web.qtpl:259
|
|
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:264
|
|
var keys []string
|
|
for key := range targets {
|
|
keys = append(keys, string(key))
|
|
}
|
|
sort.Strings(keys)
|
|
|
|
//line app/vmalert/web.qtpl:269
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:271
|
|
for i := range keys {
|
|
//line app/vmalert/web.qtpl:271
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:272
|
|
typeK, ns := keys[i], targets[notifier.TargetType(keys[i])]
|
|
count := len(ns)
|
|
|
|
//line app/vmalert/web.qtpl:274
|
|
qw422016.N().S(`
|
|
<div class="group-heading" data-bs-target="notifiers-`)
|
|
//line app/vmalert/web.qtpl:275
|
|
qw422016.E().S(typeK)
|
|
//line app/vmalert/web.qtpl:275
|
|
qw422016.N().S(`">
|
|
<span class="anchor" id="group-`)
|
|
//line app/vmalert/web.qtpl:276
|
|
qw422016.E().S(typeK)
|
|
//line app/vmalert/web.qtpl:276
|
|
qw422016.N().S(`"></span>
|
|
<a href="#group-`)
|
|
//line app/vmalert/web.qtpl:277
|
|
qw422016.E().S(typeK)
|
|
//line app/vmalert/web.qtpl:277
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:277
|
|
qw422016.E().S(typeK)
|
|
//line app/vmalert/web.qtpl:277
|
|
qw422016.N().S(` (`)
|
|
//line app/vmalert/web.qtpl:277
|
|
qw422016.N().D(count)
|
|
//line app/vmalert/web.qtpl:277
|
|
qw422016.N().S(`)</a>
|
|
</div>
|
|
<div class="collapse show" id="notifiers-`)
|
|
//line app/vmalert/web.qtpl:279
|
|
qw422016.E().S(typeK)
|
|
//line app/vmalert/web.qtpl:279
|
|
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:288
|
|
for _, n := range ns {
|
|
//line app/vmalert/web.qtpl:288
|
|
qw422016.N().S(`
|
|
<tr>
|
|
<td>
|
|
`)
|
|
//line app/vmalert/web.qtpl:291
|
|
for _, l := range n.Labels.GetLabels() {
|
|
//line app/vmalert/web.qtpl:291
|
|
qw422016.N().S(`
|
|
<span class="ms-1 badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:292
|
|
qw422016.E().S(l.Name)
|
|
//line app/vmalert/web.qtpl:292
|
|
qw422016.N().S(`=`)
|
|
//line app/vmalert/web.qtpl:292
|
|
qw422016.E().S(l.Value)
|
|
//line app/vmalert/web.qtpl:292
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:293
|
|
}
|
|
//line app/vmalert/web.qtpl:293
|
|
qw422016.N().S(`
|
|
</td>
|
|
<td>`)
|
|
//line app/vmalert/web.qtpl:295
|
|
qw422016.E().S(n.Notifier.Addr())
|
|
//line app/vmalert/web.qtpl:295
|
|
qw422016.N().S(`</td>
|
|
</tr>
|
|
`)
|
|
//line app/vmalert/web.qtpl:297
|
|
}
|
|
//line app/vmalert/web.qtpl:297
|
|
qw422016.N().S(`
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:301
|
|
}
|
|
//line app/vmalert/web.qtpl:301
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:303
|
|
} else {
|
|
//line app/vmalert/web.qtpl:303
|
|
qw422016.N().S(`
|
|
<div>
|
|
<p>No targets...</p>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:307
|
|
}
|
|
//line app/vmalert/web.qtpl:307
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:309
|
|
tpl.StreamFooter(qw422016, r)
|
|
//line app/vmalert/web.qtpl:309
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:311
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:311
|
|
func WriteListTargets(qq422016 qtio422016.Writer, r *http.Request, targets map[notifier.TargetType][]notifier.Target) {
|
|
//line app/vmalert/web.qtpl:311
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:311
|
|
StreamListTargets(qw422016, r, targets)
|
|
//line app/vmalert/web.qtpl:311
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:311
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:311
|
|
func ListTargets(r *http.Request, targets map[notifier.TargetType][]notifier.Target) string {
|
|
//line app/vmalert/web.qtpl:311
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:311
|
|
WriteListTargets(qb422016, r, targets)
|
|
//line app/vmalert/web.qtpl:311
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:311
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:311
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:311
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:313
|
|
func StreamAlert(qw422016 *qt422016.Writer, r *http.Request, alert *apiAlert) {
|
|
//line app/vmalert/web.qtpl:313
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:314
|
|
prefix := utils.Prefix(r.URL.Path)
|
|
|
|
//line app/vmalert/web.qtpl:314
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:315
|
|
tpl.StreamHeader(qw422016, r, navItems, "", getLastConfigError())
|
|
//line app/vmalert/web.qtpl:315
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:317
|
|
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:328
|
|
qw422016.N().S(`
|
|
<div class="display-6 pb-3 mb-3">Alert: `)
|
|
//line app/vmalert/web.qtpl:329
|
|
qw422016.E().S(alert.Name)
|
|
//line app/vmalert/web.qtpl:329
|
|
qw422016.N().S(`<span class="ms-2 badge `)
|
|
//line app/vmalert/web.qtpl:329
|
|
if alert.State == "firing" {
|
|
//line app/vmalert/web.qtpl:329
|
|
qw422016.N().S(`bg-danger`)
|
|
//line app/vmalert/web.qtpl:329
|
|
} else {
|
|
//line app/vmalert/web.qtpl:329
|
|
qw422016.N().S(` bg-warning text-dark`)
|
|
//line app/vmalert/web.qtpl:329
|
|
}
|
|
//line app/vmalert/web.qtpl:329
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:329
|
|
qw422016.E().S(alert.State)
|
|
//line app/vmalert/web.qtpl:329
|
|
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:336
|
|
qw422016.E().S(alert.ActiveAt.Format("2006-01-02T15:04:05Z07:00"))
|
|
//line app/vmalert/web.qtpl:336
|
|
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:346
|
|
qw422016.E().S(alert.Expression)
|
|
//line app/vmalert/web.qtpl:346
|
|
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:356
|
|
for _, k := range labelKeys {
|
|
//line app/vmalert/web.qtpl:356
|
|
qw422016.N().S(`
|
|
<span class="m-1 badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:357
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:357
|
|
qw422016.N().S(`=`)
|
|
//line app/vmalert/web.qtpl:357
|
|
qw422016.E().S(alert.Labels[k])
|
|
//line app/vmalert/web.qtpl:357
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:358
|
|
}
|
|
//line app/vmalert/web.qtpl:358
|
|
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:368
|
|
for _, k := range annotationKeys {
|
|
//line app/vmalert/web.qtpl:368
|
|
qw422016.N().S(`
|
|
<b>`)
|
|
//line app/vmalert/web.qtpl:369
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:369
|
|
qw422016.N().S(`:</b><br>
|
|
<p>`)
|
|
//line app/vmalert/web.qtpl:370
|
|
qw422016.E().S(alert.Annotations[k])
|
|
//line app/vmalert/web.qtpl:370
|
|
qw422016.N().S(`</p>
|
|
`)
|
|
//line app/vmalert/web.qtpl:371
|
|
}
|
|
//line app/vmalert/web.qtpl:371
|
|
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:381
|
|
qw422016.E().S(prefix)
|
|
//line app/vmalert/web.qtpl:381
|
|
qw422016.N().S(`groups#group-`)
|
|
//line app/vmalert/web.qtpl:381
|
|
qw422016.E().S(alert.GroupID)
|
|
//line app/vmalert/web.qtpl:381
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:381
|
|
qw422016.E().S(alert.GroupID)
|
|
//line app/vmalert/web.qtpl:381
|
|
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:391
|
|
qw422016.E().S(alert.SourceLink)
|
|
//line app/vmalert/web.qtpl:391
|
|
qw422016.N().S(`">Link</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:395
|
|
tpl.StreamFooter(qw422016, r)
|
|
//line app/vmalert/web.qtpl:395
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:397
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:397
|
|
func WriteAlert(qq422016 qtio422016.Writer, r *http.Request, alert *apiAlert) {
|
|
//line app/vmalert/web.qtpl:397
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:397
|
|
StreamAlert(qw422016, r, alert)
|
|
//line app/vmalert/web.qtpl:397
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:397
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:397
|
|
func Alert(r *http.Request, alert *apiAlert) string {
|
|
//line app/vmalert/web.qtpl:397
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:397
|
|
WriteAlert(qb422016, r, alert)
|
|
//line app/vmalert/web.qtpl:397
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:397
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:397
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:397
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:400
|
|
func StreamRuleDetails(qw422016 *qt422016.Writer, r *http.Request, rule apiRule) {
|
|
//line app/vmalert/web.qtpl:400
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:401
|
|
prefix := utils.Prefix(r.URL.Path)
|
|
|
|
//line app/vmalert/web.qtpl:401
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:402
|
|
tpl.StreamHeader(qw422016, r, navItems, "", getLastConfigError())
|
|
//line app/vmalert/web.qtpl:402
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:404
|
|
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:427
|
|
qw422016.N().S(`
|
|
<div class="display-6 pb-3 mb-3">Rule: `)
|
|
//line app/vmalert/web.qtpl:428
|
|
qw422016.E().S(rule.Name)
|
|
//line app/vmalert/web.qtpl:428
|
|
qw422016.N().S(`<span class="ms-2 badge `)
|
|
//line app/vmalert/web.qtpl:428
|
|
if rule.Health != "ok" {
|
|
//line app/vmalert/web.qtpl:428
|
|
qw422016.N().S(`bg-danger`)
|
|
//line app/vmalert/web.qtpl:428
|
|
} else {
|
|
//line app/vmalert/web.qtpl:428
|
|
qw422016.N().S(` bg-success text-dark`)
|
|
//line app/vmalert/web.qtpl:428
|
|
}
|
|
//line app/vmalert/web.qtpl:428
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:428
|
|
qw422016.E().S(rule.Health)
|
|
//line app/vmalert/web.qtpl:428
|
|
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:435
|
|
qw422016.E().S(rule.Query)
|
|
//line app/vmalert/web.qtpl:435
|
|
qw422016.N().S(`</pre></code>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:439
|
|
if rule.Type == "alerting" {
|
|
//line app/vmalert/web.qtpl:439
|
|
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:446
|
|
qw422016.E().V(rule.Duration)
|
|
//line app/vmalert/web.qtpl:446
|
|
qw422016.N().S(` seconds
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:450
|
|
if rule.KeepFiringFor > 0 {
|
|
//line app/vmalert/web.qtpl:450
|
|
qw422016.N().S(`
|
|
<div class="container border-bottom p-2">
|
|
<div class="row">
|
|
<div class="col-2">
|
|
Keep firing for
|
|
</div>
|
|
<div class="col">
|
|
`)
|
|
//line app/vmalert/web.qtpl:457
|
|
qw422016.E().V(rule.KeepFiringFor)
|
|
//line app/vmalert/web.qtpl:457
|
|
qw422016.N().S(` seconds
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:461
|
|
}
|
|
//line app/vmalert/web.qtpl:461
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:462
|
|
}
|
|
//line app/vmalert/web.qtpl:462
|
|
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:469
|
|
for _, k := range labelKeys {
|
|
//line app/vmalert/web.qtpl:469
|
|
qw422016.N().S(`
|
|
<span class="m-1 badge bg-primary">`)
|
|
//line app/vmalert/web.qtpl:470
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:470
|
|
qw422016.N().S(`=`)
|
|
//line app/vmalert/web.qtpl:470
|
|
qw422016.E().S(rule.Labels[k])
|
|
//line app/vmalert/web.qtpl:470
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:471
|
|
}
|
|
//line app/vmalert/web.qtpl:471
|
|
qw422016.N().S(`
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:475
|
|
if rule.Type == "alerting" {
|
|
//line app/vmalert/web.qtpl:475
|
|
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:482
|
|
for _, k := range annotationKeys {
|
|
//line app/vmalert/web.qtpl:482
|
|
qw422016.N().S(`
|
|
<b>`)
|
|
//line app/vmalert/web.qtpl:483
|
|
qw422016.E().S(k)
|
|
//line app/vmalert/web.qtpl:483
|
|
qw422016.N().S(`:</b><br>
|
|
<p>`)
|
|
//line app/vmalert/web.qtpl:484
|
|
qw422016.E().S(rule.Annotations[k])
|
|
//line app/vmalert/web.qtpl:484
|
|
qw422016.N().S(`</p>
|
|
`)
|
|
//line app/vmalert/web.qtpl:485
|
|
}
|
|
//line app/vmalert/web.qtpl:485
|
|
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:495
|
|
qw422016.E().V(rule.Debug)
|
|
//line app/vmalert/web.qtpl:495
|
|
qw422016.N().S(`
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`)
|
|
//line app/vmalert/web.qtpl:499
|
|
}
|
|
//line app/vmalert/web.qtpl:499
|
|
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:506
|
|
qw422016.E().S(prefix)
|
|
//line app/vmalert/web.qtpl:506
|
|
qw422016.N().S(`groups#group-`)
|
|
//line app/vmalert/web.qtpl:506
|
|
qw422016.E().S(rule.GroupID)
|
|
//line app/vmalert/web.qtpl:506
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:506
|
|
qw422016.E().S(rule.GroupID)
|
|
//line app/vmalert/web.qtpl:506
|
|
qw422016.N().S(`</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<br>
|
|
`)
|
|
//line app/vmalert/web.qtpl:512
|
|
if seriesFetchedWarning {
|
|
//line app/vmalert/web.qtpl:512
|
|
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:524
|
|
}
|
|
//line app/vmalert/web.qtpl:524
|
|
qw422016.N().S(`
|
|
<div class="display-6 pb-3">Last `)
|
|
//line app/vmalert/web.qtpl:525
|
|
qw422016.N().D(len(rule.Updates))
|
|
//line app/vmalert/web.qtpl:525
|
|
qw422016.N().S(`/`)
|
|
//line app/vmalert/web.qtpl:525
|
|
qw422016.N().D(rule.MaxUpdates)
|
|
//line app/vmalert/web.qtpl:525
|
|
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:531
|
|
if seriesFetchedEnabled {
|
|
//line app/vmalert/web.qtpl:531
|
|
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:531
|
|
}
|
|
//line app/vmalert/web.qtpl:531
|
|
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:539
|
|
for _, u := range rule.Updates {
|
|
//line app/vmalert/web.qtpl:539
|
|
qw422016.N().S(`
|
|
<tr`)
|
|
//line app/vmalert/web.qtpl:540
|
|
if u.Err != nil {
|
|
//line app/vmalert/web.qtpl:540
|
|
qw422016.N().S(` class="alert-danger"`)
|
|
//line app/vmalert/web.qtpl:540
|
|
}
|
|
//line app/vmalert/web.qtpl:540
|
|
qw422016.N().S(`>
|
|
<td>
|
|
<span class="badge bg-primary rounded-pill me-3" title="Updated at">`)
|
|
//line app/vmalert/web.qtpl:542
|
|
qw422016.E().S(u.Time.Format(time.RFC3339))
|
|
//line app/vmalert/web.qtpl:542
|
|
qw422016.N().S(`</span>
|
|
</td>
|
|
<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:544
|
|
qw422016.N().D(u.Samples)
|
|
//line app/vmalert/web.qtpl:544
|
|
qw422016.N().S(`</td>
|
|
`)
|
|
//line app/vmalert/web.qtpl:545
|
|
if seriesFetchedEnabled {
|
|
//line app/vmalert/web.qtpl:545
|
|
qw422016.N().S(`<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:545
|
|
if u.SeriesFetched != nil {
|
|
//line app/vmalert/web.qtpl:545
|
|
qw422016.N().D(*u.SeriesFetched)
|
|
//line app/vmalert/web.qtpl:545
|
|
}
|
|
//line app/vmalert/web.qtpl:545
|
|
qw422016.N().S(`</td>`)
|
|
//line app/vmalert/web.qtpl:545
|
|
}
|
|
//line app/vmalert/web.qtpl:545
|
|
qw422016.N().S(`
|
|
<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:546
|
|
qw422016.N().FPrec(u.Duration.Seconds(), 3)
|
|
//line app/vmalert/web.qtpl:546
|
|
qw422016.N().S(`s</td>
|
|
<td class="text-center">`)
|
|
//line app/vmalert/web.qtpl:547
|
|
qw422016.E().S(u.At.Format(time.RFC3339))
|
|
//line app/vmalert/web.qtpl:547
|
|
qw422016.N().S(`</td>
|
|
<td>
|
|
<textarea class="curl-area" rows="1" onclick="this.focus();this.select()">`)
|
|
//line app/vmalert/web.qtpl:549
|
|
qw422016.E().S(u.Curl)
|
|
//line app/vmalert/web.qtpl:549
|
|
qw422016.N().S(`</textarea>
|
|
</td>
|
|
</tr>
|
|
</li>
|
|
`)
|
|
//line app/vmalert/web.qtpl:553
|
|
if u.Err != nil {
|
|
//line app/vmalert/web.qtpl:553
|
|
qw422016.N().S(`
|
|
<tr`)
|
|
//line app/vmalert/web.qtpl:554
|
|
if u.Err != nil {
|
|
//line app/vmalert/web.qtpl:554
|
|
qw422016.N().S(` class="alert-danger"`)
|
|
//line app/vmalert/web.qtpl:554
|
|
}
|
|
//line app/vmalert/web.qtpl:554
|
|
qw422016.N().S(`>
|
|
<td colspan="`)
|
|
//line app/vmalert/web.qtpl:555
|
|
if seriesFetchedEnabled {
|
|
//line app/vmalert/web.qtpl:555
|
|
qw422016.N().S(`6`)
|
|
//line app/vmalert/web.qtpl:555
|
|
} else {
|
|
//line app/vmalert/web.qtpl:555
|
|
qw422016.N().S(`5`)
|
|
//line app/vmalert/web.qtpl:555
|
|
}
|
|
//line app/vmalert/web.qtpl:555
|
|
qw422016.N().S(`">
|
|
<span class="alert-danger">`)
|
|
//line app/vmalert/web.qtpl:556
|
|
qw422016.E().V(u.Err)
|
|
//line app/vmalert/web.qtpl:556
|
|
qw422016.N().S(`</span>
|
|
</td>
|
|
</tr>
|
|
`)
|
|
//line app/vmalert/web.qtpl:559
|
|
}
|
|
//line app/vmalert/web.qtpl:559
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:560
|
|
}
|
|
//line app/vmalert/web.qtpl:560
|
|
qw422016.N().S(`
|
|
|
|
`)
|
|
//line app/vmalert/web.qtpl:562
|
|
tpl.StreamFooter(qw422016, r)
|
|
//line app/vmalert/web.qtpl:562
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:563
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:563
|
|
func WriteRuleDetails(qq422016 qtio422016.Writer, r *http.Request, rule apiRule) {
|
|
//line app/vmalert/web.qtpl:563
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:563
|
|
StreamRuleDetails(qw422016, r, rule)
|
|
//line app/vmalert/web.qtpl:563
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:563
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:563
|
|
func RuleDetails(r *http.Request, rule apiRule) string {
|
|
//line app/vmalert/web.qtpl:563
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:563
|
|
WriteRuleDetails(qb422016, r, rule)
|
|
//line app/vmalert/web.qtpl:563
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:563
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:563
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:563
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:567
|
|
func streambadgeState(qw422016 *qt422016.Writer, state string) {
|
|
//line app/vmalert/web.qtpl:567
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:569
|
|
badgeClass := "bg-warning text-dark"
|
|
if state == "firing" {
|
|
badgeClass = "bg-danger"
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:573
|
|
qw422016.N().S(`
|
|
<span class="badge `)
|
|
//line app/vmalert/web.qtpl:574
|
|
qw422016.E().S(badgeClass)
|
|
//line app/vmalert/web.qtpl:574
|
|
qw422016.N().S(`">`)
|
|
//line app/vmalert/web.qtpl:574
|
|
qw422016.E().S(state)
|
|
//line app/vmalert/web.qtpl:574
|
|
qw422016.N().S(`</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:575
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:575
|
|
func writebadgeState(qq422016 qtio422016.Writer, state string) {
|
|
//line app/vmalert/web.qtpl:575
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:575
|
|
streambadgeState(qw422016, state)
|
|
//line app/vmalert/web.qtpl:575
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:575
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:575
|
|
func badgeState(state string) string {
|
|
//line app/vmalert/web.qtpl:575
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:575
|
|
writebadgeState(qb422016, state)
|
|
//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:577
|
|
func streambadgeRestored(qw422016 *qt422016.Writer) {
|
|
//line app/vmalert/web.qtpl:577
|
|
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:579
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:579
|
|
func writebadgeRestored(qq422016 qtio422016.Writer) {
|
|
//line app/vmalert/web.qtpl:579
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:579
|
|
streambadgeRestored(qw422016)
|
|
//line app/vmalert/web.qtpl:579
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:579
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:579
|
|
func badgeRestored() string {
|
|
//line app/vmalert/web.qtpl:579
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:579
|
|
writebadgeRestored(qb422016)
|
|
//line app/vmalert/web.qtpl:579
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:579
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:579
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:579
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:581
|
|
func streambadgeStabilizing(qw422016 *qt422016.Writer) {
|
|
//line app/vmalert/web.qtpl:581
|
|
qw422016.N().S(`
|
|
<span class="badge bg-warning text-dark" title="This firing state is kept because of `)
|
|
//line app/vmalert/web.qtpl:581
|
|
qw422016.N().S("`")
|
|
//line app/vmalert/web.qtpl:581
|
|
qw422016.N().S(`keep_firing_for`)
|
|
//line app/vmalert/web.qtpl:581
|
|
qw422016.N().S("`")
|
|
//line app/vmalert/web.qtpl:581
|
|
qw422016.N().S(`">stabilizing</span>
|
|
`)
|
|
//line app/vmalert/web.qtpl:583
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:583
|
|
func writebadgeStabilizing(qq422016 qtio422016.Writer) {
|
|
//line app/vmalert/web.qtpl:583
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:583
|
|
streambadgeStabilizing(qw422016)
|
|
//line app/vmalert/web.qtpl:583
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:583
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:583
|
|
func badgeStabilizing() string {
|
|
//line app/vmalert/web.qtpl:583
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:583
|
|
writebadgeStabilizing(qb422016)
|
|
//line app/vmalert/web.qtpl:583
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:583
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:583
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:583
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:585
|
|
func streamseriesFetchedWarn(qw422016 *qt422016.Writer, r apiRule) {
|
|
//line app/vmalert/web.qtpl:585
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:586
|
|
if isNoMatch(r) {
|
|
//line app/vmalert/web.qtpl:586
|
|
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:595
|
|
}
|
|
//line app/vmalert/web.qtpl:595
|
|
qw422016.N().S(`
|
|
`)
|
|
//line app/vmalert/web.qtpl:596
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:596
|
|
func writeseriesFetchedWarn(qq422016 qtio422016.Writer, r apiRule) {
|
|
//line app/vmalert/web.qtpl:596
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line app/vmalert/web.qtpl:596
|
|
streamseriesFetchedWarn(qw422016, r)
|
|
//line app/vmalert/web.qtpl:596
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line app/vmalert/web.qtpl:596
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:596
|
|
func seriesFetchedWarn(r apiRule) string {
|
|
//line app/vmalert/web.qtpl:596
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line app/vmalert/web.qtpl:596
|
|
writeseriesFetchedWarn(qb422016, r)
|
|
//line app/vmalert/web.qtpl:596
|
|
qs422016 := string(qb422016.B)
|
|
//line app/vmalert/web.qtpl:596
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line app/vmalert/web.qtpl:596
|
|
return qs422016
|
|
//line app/vmalert/web.qtpl:596
|
|
}
|
|
|
|
//line app/vmalert/web.qtpl:599
|
|
func isNoMatch(r apiRule) bool {
|
|
return r.LastSamples == 0 && r.LastSeriesFetched != nil && *r.LastSeriesFetched == 0
|
|
}
|