1
0
Fork 0

Fix expr for per backend sessions

haproxy_scur{sv="BACKEND"} gives you a sum for FORNTEND
Replace with sum per sv with server type

Regex matches 1st group for:

  ntw01-1
  ntw01
  etc..

sv_new contains clean hostname

Change-Id: I3143e7f495237bbe688130dd8b73ed0495286b58
Bug-Related: PROD-23548
This commit is contained in:
Dmitry Kalashnik 2018-10-02 17:19:43 +04:00
parent 23248a862c
commit 1dc8d94353
2 changed files with 10 additions and 10 deletions

View File

@ -416,26 +416,26 @@
"steppedLine": false,
"targets": [
{
"expr": "min(haproxy_scur{environment=\"$environment\", host=~\"$host\", proxy=~\"contrail.api\", sv=\"BACKEND\"}) by (host)",
"expr": "sum(label_replace(haproxy_scur{environment=\"$environment\", proxy=~\"contrail.api\", type=\"server\"}, \"sv_new\", \"$1\", \"sv\", \"([a-zA-Z0-9_]+)(?:-.*)?\")) by (sv_new)",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "contrail @{{ host }}",
"legendFormat": "contrail @{{ sv_new }}",
"refId": "A",
"step": 2
},
{
"expr": "min(haproxy_scur{environment=\"$environment\", host=~\"$host\",proxy=~\"contrail.analytics\", sv=\"BACKEND\"}) by (host)",
"expr": "sum(label_replace(environment=\"$environment\", haproxy_scur{proxy=~\"contrail.analytics\", type=\"server\"}, \"sv_new\", \"$1\", \"sv\", \"([a-zA-Z0-9_]+)(?:-.*)?\")) by (sv_new)",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "analytics @{{ host }}",
"legendFormat": "analytics @{{ sv_new }}",
"refId": "B",
"step": 2
},
{
"expr": "min(haproxy_scur{environment=\"$environment\", host=~\"$host\",proxy=~\"contrail.discovery\", sv=\"BACKEND\"}) by (host)",
"expr": "sum(label_replace(environment=\"$environment\", haproxy_scur{proxy=~\"contrail.discovery\", type=\"server\"}, \"sv_new\", \"$1\", \"sv\", \"([a-zA-Z0-9_]+)(?:-.*)?\")) by (sv_new)",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "discovery @{{ host }}",
"legendFormat": "discovery @{{ sv_new }}",
"refId": "C"
}
],

View File

@ -334,18 +334,18 @@
"steppedLine": false,
"targets": [
{
"expr": "min(haproxy_scur{environment=\"$environment\", host=~\"$host\", proxy=~\"contrail.api\", sv=\"BACKEND\"}) by (host)",
"expr": "sum(label_replace(haproxy_scur{environment=\"$environment\", proxy=~\"contrail.api\", type=\"server\"}, \"sv_new\", \"$1\", \"sv\", \"([a-zA-Z0-9_]+)(?:-.*)?\")) by (sv_new)",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "contrail @{{ host }}",
"legendFormat": "contrail @{{ sv_new }}",
"refId": "A",
"step": 2
},
{
"expr": "min(haproxy_scur{environment=\"$environment\", host=~\"$host\",proxy=~\"contrail.analytics\", sv=\"BACKEND\"}) by (host)",
"expr": "sum(label_replace(haproxy_scur{environment=\"$environment\", proxy=~\"contrail.analytics\", type=\"server\"}, \"sv_new\", \"$1\", \"sv\", \"([a-zA-Z0-9_]+)(?:-.*)?\")) by (sv_new)",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "analytics @{{ host }}",
"legendFormat": "analytics @{{ sv_new }}",
"refId": "B",
"step": 2
}