From e61e3bf174106b075cc671c45856005df4030167 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 11 Jan 2021 18:52:08 +0200 Subject: [PATCH 1/2] docs/Single-server-VictoriaMetrics.md: mention about https://github.com/aorfanos/vmalert-cli in `Integrations` section --- README.md | 1 + docs/Single-server-VictoriaMetrics.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index b0df5c4e6..44aa967b2 100644 --- a/README.md +++ b/README.md @@ -1424,6 +1424,7 @@ The collected profiles may be analyzed with [go tool pprof](https://github.com/g * [Ansible role for installing single-node VictoriaMetrics](https://github.com/dreamteam-gg/ansible-victoriametrics-role). * [Ansible role for installing cluster VictoriaMetrics](https://github.com/Slapper/ansible-victoriametrics-cluster-role). * [Snap package for VictoriaMetrics](https://snapcraft.io/victoriametrics). +* [vmalert-cli](https://github.com/aorfanos/vmalert-cli) - a CLI application for managing [vmalert](https://victoriametrics.github.io/vmalert.html). ## Third-party contributions diff --git a/docs/Single-server-VictoriaMetrics.md b/docs/Single-server-VictoriaMetrics.md index b0df5c4e6..44aa967b2 100644 --- a/docs/Single-server-VictoriaMetrics.md +++ b/docs/Single-server-VictoriaMetrics.md @@ -1424,6 +1424,7 @@ The collected profiles may be analyzed with [go tool pprof](https://github.com/g * [Ansible role for installing single-node VictoriaMetrics](https://github.com/dreamteam-gg/ansible-victoriametrics-role). * [Ansible role for installing cluster VictoriaMetrics](https://github.com/Slapper/ansible-victoriametrics-cluster-role). * [Snap package for VictoriaMetrics](https://snapcraft.io/victoriametrics). +* [vmalert-cli](https://github.com/aorfanos/vmalert-cli) - a CLI application for managing [vmalert](https://victoriametrics.github.io/vmalert.html). ## Third-party contributions From 2c44f9989a0a0173e42468d5e3e66ee5f29cbe46 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 11 Jan 2021 21:14:44 +0200 Subject: [PATCH 2/2] lib/promscrape: properly show scrape duration on `/targets` page Previously it has been shown as 0.000s for any scrape duration. --- docs/CHANGELOG.md | 1 + lib/promscrape/targetstatus.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 1aa1d1213..8fba25b80 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,7 @@ # tip * BUGFIX: vmagent: prevent from `dialing to the given TCP address time out` error when scraping big number of unavailable targets. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/987 +* BUGFIX: vmagent: properly show scrape duration on `/targets` page. Previously it was incorrectly shown as 0.000s. * BUGFIX: vmalert: return non-empty result in template func `query` stub to pass validation. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/989 . * FEATURE: provide a sample list of alerting rules for VictoriaMetrics components. It is available [here](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/deployment/docker/alerts.yml). diff --git a/lib/promscrape/targetstatus.go b/lib/promscrape/targetstatus.go index f8804668a..47b26f4df 100644 --- a/lib/promscrape/targetstatus.go +++ b/lib/promscrape/targetstatus.go @@ -312,7 +312,7 @@ func (tsm *targetStatusMap) getTargetsStatusByJob() []jobTargetsStatuses { labels: promrelabel.FinalizeLabels(nil, st.sw.Labels), originalLabels: st.sw.OriginalLabels, lastScrapeTime: st.getDurationFromLastScrape(), - scrapeDuration: time.Duration(st.scrapeDuration), + scrapeDuration: time.Duration(st.scrapeDuration) * time.Millisecond, error: errMsg, }) }