egress board: join the host tables by labels, one row per group
labelsToFields and merge left a __name__ column and one row per stat on the multi-stat table. joinByLabels gives a column per stat.
This commit is contained in:
parent
728e1beb6a
commit
ed86356928
2 changed files with 28 additions and 35 deletions
|
|
@ -798,17 +798,13 @@
|
||||||
],
|
],
|
||||||
"transformations": [
|
"transformations": [
|
||||||
{
|
{
|
||||||
"kind": "labelsToFields",
|
"kind": "joinByLabels",
|
||||||
"spec": {
|
"spec": {
|
||||||
"id": "labelsToFields",
|
"id": "joinByLabels",
|
||||||
"options": {}
|
"options": {
|
||||||
}
|
"join": ["dest"],
|
||||||
},
|
"value": "__name__"
|
||||||
{
|
}
|
||||||
"kind": "merge",
|
|
||||||
"spec": {
|
|
||||||
"id": "merge",
|
|
||||||
"options": {}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1038,17 +1034,13 @@
|
||||||
],
|
],
|
||||||
"transformations": [
|
"transformations": [
|
||||||
{
|
{
|
||||||
"kind": "labelsToFields",
|
"kind": "joinByLabels",
|
||||||
"spec": {
|
"spec": {
|
||||||
"id": "labelsToFields",
|
"id": "joinByLabels",
|
||||||
"options": {}
|
"options": {
|
||||||
}
|
"join": ["agent", "dest"],
|
||||||
},
|
"value": "__name__"
|
||||||
{
|
}
|
||||||
"kind": "merge",
|
|
||||||
"spec": {
|
|
||||||
"id": "merge",
|
|
||||||
"options": {}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1407,17 +1399,13 @@
|
||||||
],
|
],
|
||||||
"transformations": [
|
"transformations": [
|
||||||
{
|
{
|
||||||
"kind": "labelsToFields",
|
"kind": "joinByLabels",
|
||||||
"spec": {
|
"spec": {
|
||||||
"id": "labelsToFields",
|
"id": "joinByLabels",
|
||||||
"options": {}
|
"options": {
|
||||||
}
|
"join": ["agent", "dest", "port"],
|
||||||
},
|
"value": "__name__"
|
||||||
{
|
}
|
||||||
"kind": "merge",
|
|
||||||
"spec": {
|
|
||||||
"id": "merge",
|
|
||||||
"options": {}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -496,15 +496,20 @@ let
|
||||||
&& lib.all (e: lib.hasInfix "\"TCP_\"*" e) (
|
&& lib.all (e: lib.hasInfix "\"TCP_\"*" e) (
|
||||||
lib.filter (e: lib.hasInfix access e) (exprs ++ [ agentVar.spec.query.spec.query ])
|
lib.filter (e: lib.hasInfix access e) (exprs ++ [ agentVar.spec.query.spec.query ])
|
||||||
)
|
)
|
||||||
# A grouped stats query is one frame per group, which a table panel shows as
|
# A grouped stats query is one frame per group and stat, which a table panel
|
||||||
# a dropdown of series; labels to columns, then a merge, makes the rows.
|
# shows as a dropdown of series; joining by the group labels, with the stat's
|
||||||
|
# name as the column, makes one row per group.
|
||||||
&& lib.all (
|
&& lib.all (
|
||||||
e:
|
e:
|
||||||
map (t: t.spec.id) e.spec.data.spec.transformations == [
|
let
|
||||||
"labelsToFields"
|
xf = e.spec.data.spec.transformations;
|
||||||
"merge"
|
in
|
||||||
|
map (t: t.spec.id) xf == [
|
||||||
|
"joinByLabels"
|
||||||
"organize"
|
"organize"
|
||||||
]
|
]
|
||||||
|
&& (lib.head xf).spec.options.value == "__name__"
|
||||||
|
&& (lib.head xf).spec.options.join != [ ]
|
||||||
) (lib.filter (e: e.spec.vizConfig.group == "table") (lib.attrValues board.spec.elements))
|
) (lib.filter (e: e.spec.vizConfig.group == "table") (lib.attrValues board.spec.elements))
|
||||||
&& lib.hasInfix "logformat would_deny would_deny user=%[un method=%rm host=%>rd port=%>rP result=" squid
|
&& lib.hasInfix "logformat would_deny would_deny user=%[un method=%rm host=%>rd port=%>rP result=" squid
|
||||||
&& lib.hasInfix "access_log syslog:daemon.info squid !manager" squid;
|
&& lib.hasInfix "access_log syslog:daemon.info squid !manager" squid;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue