add canary backend name for requests metrics (#7696)

This commit is contained in:
Léopold Jacquot 2021-09-26 19:54:22 +02:00 committed by GitHub
parent 15385c6d56
commit ddbb0be0a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 124 additions and 65 deletions

View file

@ -37,6 +37,7 @@ local function metrics()
namespace = ngx.var.namespace or "-",
ingress = ngx.var.ingress_name or "-",
service = ngx.var.service_name or "-",
canary = ngx.var.proxy_alternative_upstream_name or "-",
path = ngx.var.location_path or "-",
method = ngx.var.request_method or "-",

View file

@ -82,6 +82,7 @@ describe("Monitor", function()
namespace = "default",
ingress_name = "example",
service_name = "http-svc",
proxy_alternative_upstream_name = "default-http-svc-canary-80",
location_path = "/",
request_method = "GET",
@ -114,6 +115,7 @@ describe("Monitor", function()
namespace = "default",
ingress = "example",
service = "http-svc",
canary = "default-http-svc-canary-80",
path = "/",
method = "GET",
@ -131,6 +133,7 @@ describe("Monitor", function()
namespace = "default",
ingress = "example",
service = "http-svc",
canary = "default-http-svc-canary-80",
path = "/",
method = "POST",