Fix forward metrics for backwards compatibility (#6178)

This commit is contained in:
Pat Downey
2023-07-04 15:35:55 +01:00
committed by GitHub
parent 6e1263d3d9
commit ea293da1d6
14 changed files with 87 additions and 78 deletions

View File

@@ -12,8 +12,9 @@ import (
// Proxy defines an upstream host.
type Proxy struct {
fails uint32
addr string
fails uint32
addr string
proxyName string
transport *Transport
@@ -25,15 +26,17 @@ type Proxy struct {
}
// NewProxy returns a new proxy.
func NewProxy(addr, trans string) *Proxy {
func NewProxy(proxyName, addr, trans string) *Proxy {
p := &Proxy{
addr: addr,
fails: 0,
probe: up.New(),
readTimeout: 2 * time.Second,
transport: newTransport(addr),
transport: newTransport(proxyName, addr),
health: NewHealthChecker(proxyName, trans, true, "."),
proxyName: proxyName,
}
p.health = NewHealthChecker(trans, true, ".")
runtime.SetFinalizer(p, (*Proxy).finalizer)
return p
}