Merge pull request #4139 from choffmeister/fix/collect-metrics-if-metrics-per-host-false
Always collect metrics when --metrics-per-host=false
This commit is contained in:
commit
c500bd4b3f
2 changed files with 8 additions and 2 deletions
|
@ -77,3 +77,9 @@ The username and password is `admin`
|
|||
After the login you can import the Grafana dashboard from [official dashboards](https://github.com/kubernetes/ingress-nginx/tree/master/deploy/grafana/dashboards)
|
||||
|
||||

|
||||
|
||||
## Caveats
|
||||
|
||||
### Wildcard ingresses
|
||||
|
||||
By default request metrics are labeled with the hostname. When you have a wildcard domain ingress, then there will be no metrics for that ingress (to prevent the metrics from exploding in cardinality). To get metrics in this case you need to run the ingress controller with `--metrics-per-host=false` (you will lose labeling by hostname, but still have labeling by ingress).
|
||||
|
|
|
@ -230,8 +230,8 @@ func (sc *SocketCollector) handleMessage(msg []byte) {
|
|||
}
|
||||
|
||||
for _, stats := range statsBatch {
|
||||
if !sc.hosts.Has(stats.Host) {
|
||||
klog.V(3).Infof("skiping metric for host %v that is not being served", stats.Host)
|
||||
if sc.metricsPerHost && !sc.hosts.Has(stats.Host) {
|
||||
klog.V(3).Infof("Skipping metric for host %v that is not being served", stats.Host)
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue