mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/promscrape: show only unhealthy targets if show_only_unhealthy
filter is enabled (#6960)
### Describe Your Changes It is better to show only unhealthy targets instead of all of them when `show_only_unhealthy` filter is enabled. Related issue: https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3536 ### Checklist The following checks are **mandatory**: - [x] My change adheres [VictoriaMetrics contributing guidelines](https://docs.victoriametrics.com/contributing/). --------- Co-authored-by: Roman Khavronenko <roman@victoriametrics.com>
This commit is contained in:
parent
df665a13c9
commit
cbeb7d50e8
2 changed files with 5 additions and 1 deletions
|
@ -28,6 +28,7 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/).
|
|||
* FEATURE: [vmui](https://docs.victoriametrics.com/#vmui): change request method for `/query_range` and `/query` calls from `GET` to `POST`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6288).
|
||||
* FEATURE: [dashboards](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/dashboards) for VM single-node, cluster, vmalert, vmagent, VictoriaLogs: add `Go scheduling latency` panel to show the 99th quantile of Go goroutines scheduling. This panel should help identifying insufficient CPU resources for the service. It is especially useful if CPU gets throttled, which now should be visible on this panel.
|
||||
* FEATURE: [alerts](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/deployment/docker/alerts-health.yml): add alerting rule to track the Go scheduling latency for goroutines. It should notify users if VM component doesn't have enough CPU to run or gets throttled.
|
||||
* FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent/) and [Single-node VictoriaMetrics](https://docs.victoriametrics.com/): hide jobs that contain only healthy targets when `show_only_unhealthy` filter is enabled. Before, jobs without unhealthy targets were still displayed on the page. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3536).
|
||||
|
||||
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent/) fix service discovery of Azure Virtual Machines for response contains `nextLink` in `Host:Port` format. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6912).
|
||||
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent/): properly consume messages [from kafka](https://docs.victoriametrics.com/vmagent/#kafka-integration). Previously vmagent could skip some messages during start-up.
|
||||
|
|
|
@ -475,6 +475,9 @@ func (tsm *targetStatusMap) getTargetsStatusByJob(filter *requestFilter) *target
|
|||
}
|
||||
targetsStatuses = append(targetsStatuses, ts)
|
||||
}
|
||||
if filter.showOnlyUnhealthy && len(targetsStatuses) == 0 {
|
||||
continue
|
||||
}
|
||||
jts = append(jts, &jobTargetsStatuses{
|
||||
jobName: jobName,
|
||||
upCount: ups,
|
||||
|
@ -488,7 +491,7 @@ func (tsm *targetStatusMap) getTargetsStatusByJob(filter *requestFilter) *target
|
|||
emptyJobs := getEmptyJobs(jts, jobNames)
|
||||
var err error
|
||||
jts, err = filterTargets(jts, filter.endpointSearch, filter.labelSearch)
|
||||
if len(filter.endpointSearch) > 0 || len(filter.labelSearch) > 0 {
|
||||
if len(filter.endpointSearch) > 0 || len(filter.labelSearch) > 0 || filter.showOnlyUnhealthy {
|
||||
// Do not show empty jobs if target filters are set.
|
||||
emptyJobs = nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue