Skip to content

[kubernetes_otel] Phase 2 for Node Detail dashboard#18258

Merged
gpop63 merged 4 commits intoelastic:mainfrom
gpop63:kubernetes_otel-phase2-node-detail
Apr 8, 2026
Merged

[kubernetes_otel] Phase 2 for Node Detail dashboard#18258
gpop63 merged 4 commits intoelastic:mainfrom
gpop63:kubernetes_otel-phase2-node-detail

Conversation

@gpop63
Copy link
Copy Markdown
Contributor

@gpop63 gpop63 commented Apr 7, 2026

Proposed commit message

Improving ESQL queries.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@gpop63 gpop63 requested a review from a team as a code owner April 7, 2026 19:32
@gpop63 gpop63 self-assigned this Apr 7, 2026
@gpop63 gpop63 added the Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] label Apr 7, 2026
@andrewkroh andrewkroh added dashboard Relates to a Kibana dashboard bug, enhancement, or modification. Integration:kubernetes_otel Kubernetes OpenTelemetry Assets Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services] labels Apr 7, 2026
Copy link
Copy Markdown
Contributor

@gizas gizas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

],
"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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

under what circumstances do we get node names with empty string? what does it mean?

Copy link
Copy Markdown
Contributor Author

@gpop63 gpop63 Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. should we limit this query to the two k8s metrics data streams in the FROM, or does the dashboard level filter handle that?

  2. should we use TS here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Copy Markdown
Contributor

@tommyers-elastic tommyers-elastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank gabriel - approving, but couple of non-blocking comments

gpop63 added 2 commits April 8, 2026 14:50
…se2-node-detail

# Conflicts:
#	packages/kubernetes_otel/changelog.yml
#	packages/kubernetes_otel/manifest.yml
@gpop63 gpop63 enabled auto-merge (squash) April 8, 2026 19:04
@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

History

cc @gpop63

@gpop63 gpop63 merged commit 4716608 into elastic:main Apr 8, 2026
10 checks passed
@elastic-vault-github-plugin-prod
Copy link
Copy Markdown

Package kubernetes_otel - 2.0.0-preview4 containing this change is available at https://epr.elastic.co/package/kubernetes_otel/2.0.0-preview4/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard Relates to a Kibana dashboard bug, enhancement, or modification. Integration:kubernetes_otel Kubernetes OpenTelemetry Assets Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services] Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants