mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
app/vmalert: show on UI groups error after reload config (#4543)
show on UI groups error after reload config https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4076 Co-authored-by: hagen1778 <roman@victoriametrics.com>
This commit is contained in:
parent
81635d02e8
commit
9bde95bfff
@ -8,6 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/VictoriaMetrics/metrics"
|
"github.com/VictoriaMetrics/metrics"
|
||||||
@ -326,8 +327,7 @@ func configReload(ctx context.Context, m *manager, groupsCfg []config.Group, sig
|
|||||||
}
|
}
|
||||||
|
|
||||||
// init reload metrics with positive values to improve alerting conditions
|
// init reload metrics with positive values to improve alerting conditions
|
||||||
configSuccess.Set(1)
|
setConfigSuccess(fasttime.UnixTimestamp())
|
||||||
configTimestamp.Set(fasttime.UnixTimestamp())
|
|
||||||
parseFn := config.Parse
|
parseFn := config.Parse
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
@ -347,22 +347,19 @@ func configReload(ctx context.Context, m *manager, groupsCfg []config.Group, sig
|
|||||||
parseFn = config.ParseSilent
|
parseFn = config.ParseSilent
|
||||||
}
|
}
|
||||||
if err := notifier.Reload(); err != nil {
|
if err := notifier.Reload(); err != nil {
|
||||||
configReloadErrors.Inc()
|
setConfigError(err)
|
||||||
configSuccess.Set(0)
|
|
||||||
logger.Errorf("failed to reload notifier config: %s", err)
|
logger.Errorf("failed to reload notifier config: %s", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
err := templates.Load(*ruleTemplatesPath, false)
|
err := templates.Load(*ruleTemplatesPath, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
configReloadErrors.Inc()
|
setConfigError(err)
|
||||||
configSuccess.Set(0)
|
|
||||||
logger.Errorf("failed to load new templates: %s", err)
|
logger.Errorf("failed to load new templates: %s", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
newGroupsCfg, err := parseFn(*rulePath, validateTplFn, *validateExpressions)
|
newGroupsCfg, err := parseFn(*rulePath, validateTplFn, *validateExpressions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
configReloadErrors.Inc()
|
setConfigError(err)
|
||||||
configSuccess.Set(0)
|
|
||||||
logger.Errorf("cannot parse configuration file: %s", err)
|
logger.Errorf("cannot parse configuration file: %s", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -371,19 +368,18 @@ func configReload(ctx context.Context, m *manager, groupsCfg []config.Group, sig
|
|||||||
// set success to 1 since previous reload
|
// set success to 1 since previous reload
|
||||||
// could have been unsuccessful
|
// could have been unsuccessful
|
||||||
configSuccess.Set(1)
|
configSuccess.Set(1)
|
||||||
|
setConfigError(nil)
|
||||||
// config didn't change - skip it
|
// config didn't change - skip it
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if err := m.update(ctx, newGroupsCfg, false); err != nil {
|
if err := m.update(ctx, newGroupsCfg, false); err != nil {
|
||||||
configReloadErrors.Inc()
|
setConfigError(err)
|
||||||
configSuccess.Set(0)
|
|
||||||
logger.Errorf("error while reloading rules: %s", err)
|
logger.Errorf("error while reloading rules: %s", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
templates.Reload()
|
templates.Reload()
|
||||||
groupsCfg = newGroupsCfg
|
groupsCfg = newGroupsCfg
|
||||||
configSuccess.Set(1)
|
setConfigSuccess(fasttime.UnixTimestamp())
|
||||||
configTimestamp.Set(fasttime.UnixTimestamp())
|
|
||||||
logger.Infof("Rules reloaded successfully from %q", *rulePath)
|
logger.Infof("Rules reloaded successfully from %q", *rulePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -399,3 +395,40 @@ func configsEqual(a, b []config.Group) bool {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// setConfigSuccess sets config reload status to 1.
|
||||||
|
func setConfigSuccess(at uint64) {
|
||||||
|
configSuccess.Set(1)
|
||||||
|
configTimestamp.Set(fasttime.UnixTimestamp())
|
||||||
|
// reset the error if any
|
||||||
|
setConfigErr(nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
// setConfigError sets config reload status to 0.
|
||||||
|
func setConfigError(err error) {
|
||||||
|
configReloadErrors.Inc()
|
||||||
|
configSuccess.Set(0)
|
||||||
|
setConfigErr(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
configErrMu sync.RWMutex
|
||||||
|
// configErr represent the error message from the last
|
||||||
|
// config reload.
|
||||||
|
configErr error
|
||||||
|
)
|
||||||
|
|
||||||
|
func setConfigErr(err error) {
|
||||||
|
configErrMu.Lock()
|
||||||
|
configErr = err
|
||||||
|
configErrMu.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
|
func configError() error {
|
||||||
|
configErrMu.RLock()
|
||||||
|
defer configErrMu.RUnlock()
|
||||||
|
if configErr != nil {
|
||||||
|
return configErr
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -7,9 +7,11 @@ function collapseAll() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toggleByID(id) {
|
function toggleByID(id) {
|
||||||
let el = $("#" + id);
|
if (id) {
|
||||||
if (el.length > 0) {
|
let el = $("#" + id);
|
||||||
el.click();
|
if (el.length > 0) {
|
||||||
|
el.click();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,4 +38,4 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('[data-bs-toggle="tooltip"]').tooltip();
|
$('[data-bs-toggle="tooltip"]').tooltip();
|
||||||
});
|
});
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/utils"
|
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/utils"
|
||||||
) %}
|
) %}
|
||||||
|
|
||||||
{% func Header(r *http.Request, navItems []NavItem, title string) %}
|
{% func Header(r *http.Request, navItems []NavItem, title string, userErr error) %}
|
||||||
{%code prefix := utils.Prefix(r.URL.Path) %}
|
{%code prefix := utils.Prefix(r.URL.Path) %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
@ -70,8 +70,9 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{%= printNavItems(r, title, navItems) %}
|
{%= printNavItems(r, title, navItems, userErr) %}
|
||||||
<main class="px-2">
|
<main class="px-2">
|
||||||
|
{%= errorBody(userErr) %}
|
||||||
{% endfunc %}
|
{% endfunc %}
|
||||||
|
|
||||||
|
|
||||||
@ -82,7 +83,7 @@ type NavItem struct {
|
|||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
{% func printNavItems(r *http.Request, current string, items []NavItem) %}
|
{% func printNavItems(r *http.Request, current string, items []NavItem, userErr error) %}
|
||||||
{%code
|
{%code
|
||||||
prefix := utils.Prefix(r.URL.Path)
|
prefix := utils.Prefix(r.URL.Path)
|
||||||
%}
|
%}
|
||||||
@ -103,5 +104,30 @@ type NavItem struct {
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
{%= errorIcon(userErr) %}
|
||||||
</nav>
|
</nav>
|
||||||
{% endfunc %}
|
{% endfunc %}
|
||||||
|
|
||||||
|
{% func errorIcon(err error) %}
|
||||||
|
{% if err != nil %}
|
||||||
|
<div class="d-flex" data-bs-toggle="tooltip" data-bs-placement="left" title="Configuration file failed to reload! Click to see more details.">
|
||||||
|
<a type="button" data-bs-toggle="collapse" href="#reload-groups-error">
|
||||||
|
<span class="text-danger">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-exclamation-triangle-fill" viewBox="0 0 16 16">
|
||||||
|
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endfunc %}
|
||||||
|
|
||||||
|
{% func errorBody(err error) %}
|
||||||
|
{% if err != nil %}
|
||||||
|
<div class="collapse mt-2 mb-2" id="reload-groups-error">
|
||||||
|
<div class="card card-body">
|
||||||
|
{%s err.Error() %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endfunc %}
|
||||||
|
@ -27,10 +27,10 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:9
|
//line app/vmalert/tpl/header.qtpl:9
|
||||||
func StreamHeader(qw422016 *qt422016.Writer, r *http.Request, navItems []NavItem, title string) {
|
func StreamHeader(qw422016 *qt422016.Writer, r *http.Request, navItems []NavItem, title string, userErr error) {
|
||||||
//line app/vmalert/tpl/header.qtpl:9
|
//line app/vmalert/tpl/header.qtpl:9
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/header.qtpl:10
|
//line app/vmalert/tpl/header.qtpl:10
|
||||||
prefix := utils.Prefix(r.URL.Path)
|
prefix := utils.Prefix(r.URL.Path)
|
||||||
|
|
||||||
@ -114,135 +114,251 @@ func StreamHeader(qw422016 *qt422016.Writer, r *http.Request, navItems []NavItem
|
|||||||
<body>
|
<body>
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/header.qtpl:73
|
//line app/vmalert/tpl/header.qtpl:73
|
||||||
streamprintNavItems(qw422016, r, title, navItems)
|
streamprintNavItems(qw422016, r, title, navItems, userErr)
|
||||||
//line app/vmalert/tpl/header.qtpl:73
|
//line app/vmalert/tpl/header.qtpl:73
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<main class="px-2">
|
<main class="px-2">
|
||||||
|
`)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:75
|
||||||
|
streamerrorBody(qw422016, userErr)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:75
|
||||||
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
}
|
}
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
func WriteHeader(qq422016 qtio422016.Writer, r *http.Request, navItems []NavItem, title string) {
|
func WriteHeader(qq422016 qtio422016.Writer, r *http.Request, navItems []NavItem, title string, userErr error) {
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
StreamHeader(qw422016, r, navItems, title)
|
StreamHeader(qw422016, r, navItems, title, userErr)
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
}
|
}
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
func Header(r *http.Request, navItems []NavItem, title string) string {
|
func Header(r *http.Request, navItems []NavItem, title string, userErr error) string {
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
WriteHeader(qb422016, r, navItems, title)
|
WriteHeader(qb422016, r, navItems, title, userErr)
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
return qs422016
|
return qs422016
|
||||||
//line app/vmalert/tpl/header.qtpl:75
|
//line app/vmalert/tpl/header.qtpl:76
|
||||||
}
|
}
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:79
|
//line app/vmalert/tpl/header.qtpl:80
|
||||||
type NavItem struct {
|
type NavItem struct {
|
||||||
Name string
|
Name string
|
||||||
Url string
|
Url string
|
||||||
}
|
}
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:85
|
//line app/vmalert/tpl/header.qtpl:86
|
||||||
func streamprintNavItems(qw422016 *qt422016.Writer, r *http.Request, current string, items []NavItem) {
|
func streamprintNavItems(qw422016 *qt422016.Writer, r *http.Request, current string, items []NavItem, userErr error) {
|
||||||
//line app/vmalert/tpl/header.qtpl:85
|
//line app/vmalert/tpl/header.qtpl:86
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/header.qtpl:87
|
//line app/vmalert/tpl/header.qtpl:88
|
||||||
prefix := utils.Prefix(r.URL.Path)
|
prefix := utils.Prefix(r.URL.Path)
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:88
|
//line app/vmalert/tpl/header.qtpl:89
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="collapse navbar-collapse" id="navbarCollapse">
|
<div class="collapse navbar-collapse" id="navbarCollapse">
|
||||||
<ul class="navbar-nav me-auto mb-2 mb-md-0">
|
<ul class="navbar-nav me-auto mb-2 mb-md-0">
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/header.qtpl:93
|
//line app/vmalert/tpl/header.qtpl:94
|
||||||
for _, item := range items {
|
for _, item := range items {
|
||||||
//line app/vmalert/tpl/header.qtpl:93
|
//line app/vmalert/tpl/header.qtpl:94
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/header.qtpl:96
|
//line app/vmalert/tpl/header.qtpl:97
|
||||||
u, _ := url.Parse(item.Url)
|
u, _ := url.Parse(item.Url)
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:97
|
//line app/vmalert/tpl/header.qtpl:98
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<a class="nav-link`)
|
<a class="nav-link`)
|
||||||
//line app/vmalert/tpl/header.qtpl:98
|
//line app/vmalert/tpl/header.qtpl:99
|
||||||
if current == item.Name {
|
if current == item.Name {
|
||||||
//line app/vmalert/tpl/header.qtpl:98
|
//line app/vmalert/tpl/header.qtpl:99
|
||||||
qw422016.N().S(` active`)
|
qw422016.N().S(` active`)
|
||||||
//line app/vmalert/tpl/header.qtpl:98
|
//line app/vmalert/tpl/header.qtpl:99
|
||||||
}
|
}
|
||||||
//line app/vmalert/tpl/header.qtpl:98
|
//line app/vmalert/tpl/header.qtpl:99
|
||||||
qw422016.N().S(`"
|
qw422016.N().S(`"
|
||||||
href="`)
|
href="`)
|
||||||
//line app/vmalert/tpl/header.qtpl:99
|
//line app/vmalert/tpl/header.qtpl:100
|
||||||
if u.IsAbs() {
|
if u.IsAbs() {
|
||||||
//line app/vmalert/tpl/header.qtpl:99
|
//line app/vmalert/tpl/header.qtpl:100
|
||||||
qw422016.E().S(item.Url)
|
qw422016.E().S(item.Url)
|
||||||
//line app/vmalert/tpl/header.qtpl:99
|
//line app/vmalert/tpl/header.qtpl:100
|
||||||
} else {
|
} else {
|
||||||
//line app/vmalert/tpl/header.qtpl:99
|
//line app/vmalert/tpl/header.qtpl:100
|
||||||
qw422016.E().S(path.Join(prefix, item.Url))
|
qw422016.E().S(path.Join(prefix, item.Url))
|
||||||
//line app/vmalert/tpl/header.qtpl:99
|
//line app/vmalert/tpl/header.qtpl:100
|
||||||
}
|
}
|
||||||
//line app/vmalert/tpl/header.qtpl:99
|
//line app/vmalert/tpl/header.qtpl:100
|
||||||
qw422016.N().S(`">
|
qw422016.N().S(`">
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/header.qtpl:100
|
//line app/vmalert/tpl/header.qtpl:101
|
||||||
qw422016.E().S(item.Name)
|
qw422016.E().S(item.Name)
|
||||||
//line app/vmalert/tpl/header.qtpl:100
|
//line app/vmalert/tpl/header.qtpl:101
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/header.qtpl:103
|
//line app/vmalert/tpl/header.qtpl:104
|
||||||
}
|
}
|
||||||
//line app/vmalert/tpl/header.qtpl:103
|
//line app/vmalert/tpl/header.qtpl:104
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
`)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:107
|
||||||
|
streamerrorIcon(qw422016, userErr)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:107
|
||||||
|
qw422016.N().S(`
|
||||||
</nav>
|
</nav>
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
}
|
}
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
func writeprintNavItems(qq422016 qtio422016.Writer, r *http.Request, current string, items []NavItem) {
|
func writeprintNavItems(qq422016 qtio422016.Writer, r *http.Request, current string, items []NavItem, userErr error) {
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
streamprintNavItems(qw422016, r, current, items)
|
streamprintNavItems(qw422016, r, current, items, userErr)
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
}
|
}
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
func printNavItems(r *http.Request, current string, items []NavItem) string {
|
func printNavItems(r *http.Request, current string, items []NavItem, userErr error) string {
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
writeprintNavItems(qb422016, r, current, items)
|
writeprintNavItems(qb422016, r, current, items, userErr)
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
return qs422016
|
return qs422016
|
||||||
//line app/vmalert/tpl/header.qtpl:107
|
//line app/vmalert/tpl/header.qtpl:109
|
||||||
|
}
|
||||||
|
|
||||||
|
//line app/vmalert/tpl/header.qtpl:111
|
||||||
|
func streamerrorIcon(qw422016 *qt422016.Writer, err error) {
|
||||||
|
//line app/vmalert/tpl/header.qtpl:111
|
||||||
|
qw422016.N().S(`
|
||||||
|
`)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:112
|
||||||
|
if err != nil {
|
||||||
|
//line app/vmalert/tpl/header.qtpl:112
|
||||||
|
qw422016.N().S(`
|
||||||
|
<div class="d-flex" data-bs-toggle="tooltip" data-bs-placement="left" title="Configuration file failed to reload! Click to see more details.">
|
||||||
|
<a type="button" data-bs-toggle="collapse" href="#reload-groups-error">
|
||||||
|
<span class="text-danger">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-exclamation-triangle-fill" viewBox="0 0 16 16">
|
||||||
|
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
`)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:122
|
||||||
|
}
|
||||||
|
//line app/vmalert/tpl/header.qtpl:122
|
||||||
|
qw422016.N().S(`
|
||||||
|
`)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
}
|
||||||
|
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
func writeerrorIcon(qq422016 qtio422016.Writer, err error) {
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
streamerrorIcon(qw422016, err)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
qt422016.ReleaseWriter(qw422016)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
}
|
||||||
|
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
func errorIcon(err error) string {
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
writeerrorIcon(qb422016, err)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
qs422016 := string(qb422016.B)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
return qs422016
|
||||||
|
//line app/vmalert/tpl/header.qtpl:123
|
||||||
|
}
|
||||||
|
|
||||||
|
//line app/vmalert/tpl/header.qtpl:125
|
||||||
|
func streamerrorBody(qw422016 *qt422016.Writer, err error) {
|
||||||
|
//line app/vmalert/tpl/header.qtpl:125
|
||||||
|
qw422016.N().S(`
|
||||||
|
`)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:126
|
||||||
|
if err != nil {
|
||||||
|
//line app/vmalert/tpl/header.qtpl:126
|
||||||
|
qw422016.N().S(`
|
||||||
|
<div class="collapse mt-2 mb-2" id="reload-groups-error">
|
||||||
|
<div class="card card-body">
|
||||||
|
`)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:129
|
||||||
|
qw422016.E().S(err.Error())
|
||||||
|
//line app/vmalert/tpl/header.qtpl:129
|
||||||
|
qw422016.N().S(`
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:132
|
||||||
|
}
|
||||||
|
//line app/vmalert/tpl/header.qtpl:132
|
||||||
|
qw422016.N().S(`
|
||||||
|
`)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
}
|
||||||
|
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
func writeerrorBody(qq422016 qtio422016.Writer, err error) {
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
streamerrorBody(qw422016, err)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
qt422016.ReleaseWriter(qw422016)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
}
|
||||||
|
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
func errorBody(err error) string {
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
writeerrorBody(qb422016, err)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
qs422016 := string(qb422016.B)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
|
return qs422016
|
||||||
|
//line app/vmalert/tpl/header.qtpl:133
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
|
|
||||||
{% func Welcome(r *http.Request) %}
|
{% func Welcome(r *http.Request) %}
|
||||||
{%= tpl.Header(r, navItems, "vmalert") %}
|
{%= tpl.Header(r, navItems, "vmalert", configError()) %}
|
||||||
<p>
|
<p>
|
||||||
API:<br>
|
API:<br>
|
||||||
{% for _, p := range apiLinks %}
|
{% for _, p := range apiLinks %}
|
||||||
@ -40,7 +40,7 @@ btn-primary
|
|||||||
|
|
||||||
{% func ListGroups(r *http.Request, originGroups []APIGroup) %}
|
{% func ListGroups(r *http.Request, originGroups []APIGroup) %}
|
||||||
{%code prefix := utils.Prefix(r.URL.Path) %}
|
{%code prefix := utils.Prefix(r.URL.Path) %}
|
||||||
{%= tpl.Header(r, navItems, "Groups") %}
|
{%= tpl.Header(r, navItems, "Groups", configError()) %}
|
||||||
{%code
|
{%code
|
||||||
filter := r.URL.Query().Get("filter")
|
filter := r.URL.Query().Get("filter")
|
||||||
rOk := make(map[string]int)
|
rOk := make(map[string]int)
|
||||||
@ -164,7 +164,7 @@ btn-primary
|
|||||||
|
|
||||||
{% func ListAlerts(r *http.Request, groupAlerts []GroupAlerts) %}
|
{% func ListAlerts(r *http.Request, groupAlerts []GroupAlerts) %}
|
||||||
{%code prefix := utils.Prefix(r.URL.Path) %}
|
{%code prefix := utils.Prefix(r.URL.Path) %}
|
||||||
{%= tpl.Header(r, navItems, "Alerts") %}
|
{%= tpl.Header(r, navItems, "Alerts", configError()) %}
|
||||||
{% if len(groupAlerts) > 0 %}
|
{% if len(groupAlerts) > 0 %}
|
||||||
<a class="btn btn-primary" role="button" onclick="collapseAll()">Collapse 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 btn-primary" role="button" onclick="expandAll()">Expand All</a>
|
||||||
@ -250,7 +250,7 @@ btn-primary
|
|||||||
{% endfunc %}
|
{% endfunc %}
|
||||||
|
|
||||||
{% func ListTargets(r *http.Request, targets map[notifier.TargetType][]notifier.Target) %}
|
{% func ListTargets(r *http.Request, targets map[notifier.TargetType][]notifier.Target) %}
|
||||||
{%= tpl.Header(r, navItems, "Notifiers") %}
|
{%= tpl.Header(r, navItems, "Notifiers", configError()) %}
|
||||||
{% if len(targets) > 0 %}
|
{% if len(targets) > 0 %}
|
||||||
<a class="btn btn-primary" role="button" onclick="collapseAll()">Collapse 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 btn-primary" role="button" onclick="expandAll()">Expand All</a>
|
||||||
@ -307,7 +307,7 @@ btn-primary
|
|||||||
|
|
||||||
{% func Alert(r *http.Request, alert *APIAlert) %}
|
{% func Alert(r *http.Request, alert *APIAlert) %}
|
||||||
{%code prefix := utils.Prefix(r.URL.Path) %}
|
{%code prefix := utils.Prefix(r.URL.Path) %}
|
||||||
{%= tpl.Header(r, navItems, "") %}
|
{%= tpl.Header(r, navItems, "", configError()) %}
|
||||||
{%code
|
{%code
|
||||||
var labelKeys []string
|
var labelKeys []string
|
||||||
for k := range alert.Labels {
|
for k := range alert.Labels {
|
||||||
@ -394,7 +394,7 @@ btn-primary
|
|||||||
|
|
||||||
{% func RuleDetails(r *http.Request, rule APIRule) %}
|
{% func RuleDetails(r *http.Request, rule APIRule) %}
|
||||||
{%code prefix := utils.Prefix(r.URL.Path) %}
|
{%code prefix := utils.Prefix(r.URL.Path) %}
|
||||||
{%= tpl.Header(r, navItems, "") %}
|
{%= tpl.Header(r, navItems, "", configError()) %}
|
||||||
{%code
|
{%code
|
||||||
var labelKeys []string
|
var labelKeys []string
|
||||||
for k := range rule.Labels {
|
for k := range rule.Labels {
|
||||||
@ -578,4 +578,4 @@ btn-primary
|
|||||||
func isNoMatch (r APIRule) bool {
|
func isNoMatch (r APIRule) bool {
|
||||||
return r.LastSamples == 0 && r.LastSeriesFetched != nil && *r.LastSeriesFetched == 0
|
return r.LastSamples == 0 && r.LastSeriesFetched != nil && *r.LastSeriesFetched == 0
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
@ -34,7 +34,7 @@ func StreamWelcome(qw422016 *qt422016.Writer, r *http.Request) {
|
|||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/web.qtpl:15
|
//line app/vmalert/web.qtpl:15
|
||||||
tpl.StreamHeader(qw422016, r, navItems, "vmalert")
|
tpl.StreamHeader(qw422016, r, navItems, "vmalert", configError())
|
||||||
//line app/vmalert/web.qtpl:15
|
//line app/vmalert/web.qtpl:15
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<p>
|
<p>
|
||||||
@ -207,7 +207,7 @@ func StreamListGroups(qw422016 *qt422016.Writer, r *http.Request, originGroups [
|
|||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/web.qtpl:43
|
//line app/vmalert/web.qtpl:43
|
||||||
tpl.StreamHeader(qw422016, r, navItems, "Groups")
|
tpl.StreamHeader(qw422016, r, navItems, "Groups", configError())
|
||||||
//line app/vmalert/web.qtpl:43
|
//line app/vmalert/web.qtpl:43
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
@ -619,7 +619,7 @@ func StreamListAlerts(qw422016 *qt422016.Writer, r *http.Request, groupAlerts []
|
|||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/web.qtpl:167
|
//line app/vmalert/web.qtpl:167
|
||||||
tpl.StreamHeader(qw422016, r, navItems, "Alerts")
|
tpl.StreamHeader(qw422016, r, navItems, "Alerts", configError())
|
||||||
//line app/vmalert/web.qtpl:167
|
//line app/vmalert/web.qtpl:167
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
@ -885,7 +885,7 @@ func StreamListTargets(qw422016 *qt422016.Writer, r *http.Request, targets map[n
|
|||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/web.qtpl:253
|
//line app/vmalert/web.qtpl:253
|
||||||
tpl.StreamHeader(qw422016, r, navItems, "Notifiers")
|
tpl.StreamHeader(qw422016, r, navItems, "Notifiers", configError())
|
||||||
//line app/vmalert/web.qtpl:253
|
//line app/vmalert/web.qtpl:253
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
@ -1065,7 +1065,7 @@ func StreamAlert(qw422016 *qt422016.Writer, r *http.Request, alert *APIAlert) {
|
|||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/web.qtpl:310
|
//line app/vmalert/web.qtpl:310
|
||||||
tpl.StreamHeader(qw422016, r, navItems, "")
|
tpl.StreamHeader(qw422016, r, navItems, "", configError())
|
||||||
//line app/vmalert/web.qtpl:310
|
//line app/vmalert/web.qtpl:310
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
@ -1274,7 +1274,7 @@ func StreamRuleDetails(qw422016 *qt422016.Writer, r *http.Request, rule APIRule)
|
|||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/web.qtpl:397
|
//line app/vmalert/web.qtpl:397
|
||||||
tpl.StreamHeader(qw422016, r, navItems, "")
|
tpl.StreamHeader(qw422016, r, navItems, "", configError())
|
||||||
//line app/vmalert/web.qtpl:397
|
//line app/vmalert/web.qtpl:397
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
|
@ -33,6 +33,7 @@ The following tip changes can be tested by building VictoriaMetrics components f
|
|||||||
* FEATURE: accept timestamps in milliseconds at `start`, `end` and `time` query args in [Prometheus querying API](https://docs.victoriametrics.com/#prometheus-querying-api-usage). See [these docs](https://docs.victoriametrics.com/#timestamp-formats) and [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4459).
|
* FEATURE: accept timestamps in milliseconds at `start`, `end` and `time` query args in [Prometheus querying API](https://docs.victoriametrics.com/#prometheus-querying-api-usage). See [these docs](https://docs.victoriametrics.com/#timestamp-formats) and [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4459).
|
||||||
* FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert.html): update retry policy for pushing data to `-remoteWrite.url`. By default, vmalert will make multiple retry attempts with exponential delay. The total time spent during retry attempts shouldn't exceed `-remoteWrite.retryMaxTime` (default is 30s). When retry time is exceeded vmalert drops the data dedicated for `-remoteWrite.url`. Before, vmalert dropped data after 5 retry attempts with 1s delay between attempts (not configurable). See `-remoteWrite.retryMinInterval` and `-remoteWrite.retryMaxTime` cmd-line flags.
|
* FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert.html): update retry policy for pushing data to `-remoteWrite.url`. By default, vmalert will make multiple retry attempts with exponential delay. The total time spent during retry attempts shouldn't exceed `-remoteWrite.retryMaxTime` (default is 30s). When retry time is exceeded vmalert drops the data dedicated for `-remoteWrite.url`. Before, vmalert dropped data after 5 retry attempts with 1s delay between attempts (not configurable). See `-remoteWrite.retryMinInterval` and `-remoteWrite.retryMaxTime` cmd-line flags.
|
||||||
* FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert.html): expose `vmalert_remotewrite_send_duration_seconds_total` counter, which can be used for determining high saturation of every connection to remote storage with an alerting query `sum(rate(vmalert_remotewrite_send_duration_seconds_total[5m])) by(job, instance) > 0.9 * max(vmalert_remotewrite_concurrency) by(job, instance)`. This query triggers when a connection is saturated by more than 90%. This usually means that `-remoteWrite.concurrency` command-line flag must be increased in order to increase the number of concurrent writings into remote endpoint. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4516).
|
* FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert.html): expose `vmalert_remotewrite_send_duration_seconds_total` counter, which can be used for determining high saturation of every connection to remote storage with an alerting query `sum(rate(vmalert_remotewrite_send_duration_seconds_total[5m])) by(job, instance) > 0.9 * max(vmalert_remotewrite_concurrency) by(job, instance)`. This query triggers when a connection is saturated by more than 90%. This usually means that `-remoteWrite.concurrency` command-line flag must be increased in order to increase the number of concurrent writings into remote endpoint. See [this feature request](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4516).
|
||||||
|
* FEATUTE: [vmalert](https://docs.victoriametrics.com/vmalert.html): display the error message received during unsuccessful config reload in vmalert's UI. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4076) for details.
|
||||||
* FEATURE: [vmauth](https://docs.victoriametrics.com/vmauth.html): expose `vmauth_user_request_duration_seconds` and `vmauth_unauthorized_user_request_duration_seconds` summary metrics for measuring requests latency per user.
|
* FEATURE: [vmauth](https://docs.victoriametrics.com/vmauth.html): expose `vmauth_user_request_duration_seconds` and `vmauth_unauthorized_user_request_duration_seconds` summary metrics for measuring requests latency per user.
|
||||||
* FEATURE: [vmbackup](https://docs.victoriametrics.com/vmbackup.html): show backup progress percentage in log during backup uploading. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4460).
|
* FEATURE: [vmbackup](https://docs.victoriametrics.com/vmbackup.html): show backup progress percentage in log during backup uploading. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4460).
|
||||||
* FEATURE: [vmrestore](https://docs.victoriametrics.com/vmrestore.html): show restoring progress percentage in log during backup downloading. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4460).
|
* FEATURE: [vmrestore](https://docs.victoriametrics.com/vmrestore.html): show restoring progress percentage in log during backup downloading. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4460).
|
||||||
|
Loading…
Reference in New Issue
Block a user