Allow to disable NGINX metrics

This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-12-04 16:59:54 -03:00
parent c4ba23832a
commit 06d33c16b5
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
9 changed files with 42 additions and 9 deletions

View file

@ -914,13 +914,15 @@ func proxySetHeader(loc interface{}) string {
// buildCustomErrorDeps is a utility function returning a struct wrapper with
// the data required to build the 'CUSTOM_ERRORS' template
func buildCustomErrorDeps(proxySetHeaders map[string]string, errorCodes []int) interface{} {
func buildCustomErrorDeps(proxySetHeaders map[string]string, errorCodes []int, enableMetrics bool) interface{} {
return struct {
ProxySetHeaders map[string]string
ErrorCodes []int
EnableMetrics bool
}{
ProxySetHeaders: proxySetHeaders,
ErrorCodes: errorCodes,
EnableMetrics: enableMetrics,
}
}

View file

@ -826,7 +826,7 @@ func TestEscapeLiteralDollar(t *testing.T) {
}
}
func Test_opentracingPropagateContext(t *testing.T) {
func TestOpentracingPropagateContext(t *testing.T) {
tests := map[interface{}]string{
&ingress.Location{BackendProtocol: "HTTP"}: "opentracing_propagate_context",
&ingress.Location{BackendProtocol: "HTTPS"}: "opentracing_propagate_context",