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:
parent
23248a862c
commit
1dc8d94353
2 changed files with 10 additions and 10 deletions
|
@ -416,26 +416,26 @@
|
||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"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",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "contrail @{{ host }}",
|
"legendFormat": "contrail @{{ sv_new }}",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
"step": 2
|
"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",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "analytics @{{ host }}",
|
"legendFormat": "analytics @{{ sv_new }}",
|
||||||
"refId": "B",
|
"refId": "B",
|
||||||
"step": 2
|
"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",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "discovery @{{ host }}",
|
"legendFormat": "discovery @{{ sv_new }}",
|
||||||
"refId": "C"
|
"refId": "C"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -334,18 +334,18 @@
|
||||||
"steppedLine": false,
|
"steppedLine": false,
|
||||||
"targets": [
|
"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",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "contrail @{{ host }}",
|
"legendFormat": "contrail @{{ sv_new }}",
|
||||||
"refId": "A",
|
"refId": "A",
|
||||||
"step": 2
|
"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",
|
"format": "time_series",
|
||||||
"intervalFactor": 2,
|
"intervalFactor": 2,
|
||||||
"legendFormat": "analytics @{{ host }}",
|
"legendFormat": "analytics @{{ sv_new }}",
|
||||||
"refId": "B",
|
"refId": "B",
|
||||||
"step": 2
|
"step": 2
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue