Metrics router fix
Co-authored-by: Michael <michael.matur@gmail.com> Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
parent
a72d124551
commit
6e28db513c
4 changed files with 39 additions and 16 deletions
|
@ -380,6 +380,12 @@ func (ps *prometheusState) isOutdated(collector *collector) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
if routerName, ok := labels["router"]; ok {
|
||||
if !ps.dynamicConfig.hasRouter(routerName) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if serviceName, ok := labels["service"]; ok {
|
||||
if !ps.dynamicConfig.hasService(serviceName) {
|
||||
return true
|
||||
|
@ -420,6 +426,11 @@ func (d *dynamicConfig) hasService(serviceName string) bool {
|
|||
return ok
|
||||
}
|
||||
|
||||
func (d *dynamicConfig) hasRouter(routerName string) bool {
|
||||
_, ok := d.routers[routerName]
|
||||
return ok
|
||||
}
|
||||
|
||||
func (d *dynamicConfig) hasServerURL(serviceName, serverURL string) bool {
|
||||
if service, hasService := d.services[serviceName]; hasService {
|
||||
_, ok := service[serverURL]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue