Collect nginx metrics keyed by Ingress too
Store the ingress resource that created a particular location so that we can then aggregate nginx metrics based on the ingress name too.
This commit is contained in:
parent
5159e0c0f7
commit
20b64eb069
2 changed files with 7 additions and 1 deletions
|
@ -781,10 +781,15 @@ stream {
|
||||||
proxy_set_header Accept-Encoding "";
|
proxy_set_header Accept-Encoding "";
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if (and $all.Cfg.EnableVtsStatus $location.Service) }}
|
{{ if $all.Cfg.EnableVtsStatus }}
|
||||||
|
{{ if $location.Service }}
|
||||||
vhost_traffic_status_filter_by_set_key {{ $location.Service.ObjectMeta.Namespace }} kubernetes::namespace;
|
vhost_traffic_status_filter_by_set_key {{ $location.Service.ObjectMeta.Namespace }} kubernetes::namespace;
|
||||||
vhost_traffic_status_filter_by_set_key {{ $location.Service.ObjectMeta.Namespace }}.{{ $location.Service.ObjectMeta.Name }} kubernetes::service;
|
vhost_traffic_status_filter_by_set_key {{ $location.Service.ObjectMeta.Namespace }}.{{ $location.Service.ObjectMeta.Name }} kubernetes::service;
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ if $location.Ingress }}
|
||||||
|
vhost_traffic_status_filter_by_set_key {{ $location.Ingress.ObjectMeta.Namespace }}.{{ $location.Ingress.ObjectMeta.Name }} kubernetes::ingress;
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{/* Add any additional configuration defined */}}
|
{{/* Add any additional configuration defined */}}
|
||||||
{{ $location.ConfigurationSnippet }}
|
{{ $location.ConfigurationSnippet }}
|
||||||
|
|
|
@ -979,6 +979,7 @@ func (ic *GenericController) createServers(data []*extensions.Ingress,
|
||||||
Backend: un,
|
Backend: un,
|
||||||
Proxy: ngxProxy,
|
Proxy: ngxProxy,
|
||||||
Service: &apiv1.Service{},
|
Service: &apiv1.Service{},
|
||||||
|
Ingress: ing,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
SSLPassthrough: sslpt,
|
SSLPassthrough: sslpt,
|
||||||
|
|
Loading…
Reference in a new issue