plugin/metrics: add 'server' label (#1682)
* plugin/metrics: add 'server' label This uses the new WithServer(ctx) to get the current server from the context. First in a larger refactor to make all plugins do this. * compile * compile * lala test * compile and test * typos * Dont duplicate the code
This commit is contained in:
parent
573ad62b77
commit
08443a9f00
10 changed files with 68 additions and 56 deletions
|
@ -15,14 +15,14 @@ var (
|
|||
Subsystem: "proxy",
|
||||
Name: "request_count_total",
|
||||
Help: "Counter of requests made per protocol, proxy protocol, family and upstream.",
|
||||
}, []string{"proto", "proxy_proto", "family", "to"})
|
||||
}, []string{"server", "proto", "proxy_proto", "family", "to"})
|
||||
RequestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
|
||||
Namespace: plugin.Namespace,
|
||||
Subsystem: "proxy",
|
||||
Name: "request_duration_seconds",
|
||||
Buckets: plugin.TimeBuckets,
|
||||
Help: "Histogram of the time (in seconds) each request took.",
|
||||
}, []string{"proto", "proxy_proto", "family", "to"})
|
||||
}, []string{"server", "proto", "proxy_proto", "family", "to"})
|
||||
)
|
||||
|
||||
// familyToString returns the string form of either 1, or 2. Returns
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue