[kubernetes_otel] Phase 2 for Node Detail dashboard#18258
[kubernetes_otel] Phase 2 for Node Detail dashboard#18258gpop63 merged 4 commits intoelastic:mainfrom
Conversation
| ], | ||
| "query": { | ||
| "esql": "FROM metrics-*\n| WHERE k8s.node.name IS NOT NULL\n| STATS count = COUNT_DISTINCT(k8s.node.name), name = MAX(k8s.node.name)\n| EVAL name = CASE(count == 1, name, CONCAT(TO_STRING(count), \" nodes\"))\n| KEEP name" | ||
| "esql": "FROM metrics-k8sclusterreceiver.otel-*\n| WHERE k8s.node.name IS NOT NULL AND k8s.node.name != \"\"\n| STATS count = COUNT_DISTINCT(k8s.node.name), name = MAX(k8s.node.name)\n| EVAL name = CASE(count == 1, name, CONCAT(TO_STRING(count), \" nodes\"))\n| KEEP name" |
There was a problem hiding this comment.
under what circumstances do we get node names with empty string? what does it mean?
There was a problem hiding this comment.
Pending pods have empty k8s.node.name in k8sclusterreceiver docs and IS NOT NULL doesn't catch empty strings so != "" is needed to prevent blank rows in charts
| "internalReferences": [], | ||
| "query": { | ||
| "esql": "FROM metrics-*\n| WHERE k8s.node.name IS NOT NULL\n| STATS name = MAX(k8s.node.name)\n" | ||
| "esql": "FROM metrics-k8sclusterreceiver.otel-*\n| WHERE k8s.node.name IS NOT NULL\n AND k8s.node.name != \"\"\n| STATS name = MAX(k8s.node.name)\n" |
There was a problem hiding this comment.
hm, this dashboard is typically filtered by one node, right?
a more efficient query would be LIMIT 1 instead of a MAX agg.
| "index": "84f6ce3ff5709eed7dd3934d32b8aae90586b3a31f0765f56763d26f57372fa6", | ||
| "query": { | ||
| "esql": " FROM metrics-*\n | WHERE k8s.node.name IS NOT NULL\n | STATS cpu_usage = AVG(k8s.node.cpu.usage), alloc_cpu = AVG(k8s.node.allocatable_cpu)\n | EVAL cpu_util = ROUND(cpu_usage / alloc_cpu, 4)\n | KEEP cpu_util" | ||
| "esql": " FROM metrics-*\n | WHERE k8s.node.name IS NOT NULL\n AND (k8s.node.cpu.usage IS NOT NULL OR k8s.node.allocatable_cpu IS NOT NULL)\n | STATS cpu_usage = AVG(k8s.node.cpu.usage), alloc_cpu = AVG(k8s.node.allocatable_cpu)\n | EVAL cpu_util = ROUND(cpu_usage / alloc_cpu, 4)\n | KEEP cpu_util" |
There was a problem hiding this comment.
-
should we limit this query to the two k8s metrics data streams in the
FROM, or does the dashboard level filter handle that? -
should we use
TShere?
There was a problem hiding this comment.
TS seems the correct approach here 👍
| "needsRefresh": false, | ||
| "query": { | ||
| "esql": " FROM metrics-*\n | WHERE k8s.node.name IS NOT NULL\n | STATS cpu_usage = AVG(k8s.node.cpu.usage), alloc_cpu = AVG(k8s.node.allocatable_cpu)\n | EVAL cpu_util = ROUND(cpu_usage / alloc_cpu, 4)\n | KEEP cpu_util" | ||
| "esql": " FROM metrics-*\n | WHERE k8s.node.name IS NOT NULL\n AND (k8s.node.cpu.usage IS NOT NULL OR k8s.node.allocatable_cpu IS NOT NULL)\n | STATS cpu_usage = AVG(k8s.node.cpu.usage), alloc_cpu = AVG(k8s.node.allocatable_cpu)\n | EVAL cpu_util = ROUND(cpu_usage / alloc_cpu, 4)\n | KEEP cpu_util" |
tommyers-elastic
left a comment
There was a problem hiding this comment.
thank gabriel - approving, but couple of non-blocking comments
…se2-node-detail # Conflicts: # packages/kubernetes_otel/changelog.yml # packages/kubernetes_otel/manifest.yml
💚 Build Succeeded
History
cc @gpop63 |
|
Package kubernetes_otel - 2.0.0-preview4 containing this change is available at https://epr.elastic.co/package/kubernetes_otel/2.0.0-preview4/ |
Proposed commit message
Improving ESQL queries.
Checklist
changelog.ymlfile.Author's Checklist
How to test this PR locally
Related issues
Screenshots