Skip to content

[Metricbeat] Fix CPU/disk/network visualizations in EC2 overview dashboard#45117

Merged
zmoog merged 3 commits intomainfrom
zmoog/fix/metricbeat/aws-ec2-cpu-usage-dashboard
Jul 8, 2025
Merged

[Metricbeat] Fix CPU/disk/network visualizations in EC2 overview dashboard#45117
zmoog merged 3 commits intomainfrom
zmoog/fix/metricbeat/aws-ec2-cpu-usage-dashboard

Conversation

@zmoog
Copy link
Copy Markdown
Contributor

@zmoog zmoog commented Jun 30, 2025

Proposed commit message

Updates the CPU/disk/network metric field names in the "[Metricbeat AWS] EC2 Overview" dashboard.

The "[Metricbeat AWS] EC2 Overview" dashboard that comes with the AWS modules was still using the old metric field names that are no longer in use, resulting in a dashboard with multiple empty visualizations.

Here are the current changes:

Old New Formatter
aws.ec2.cpu.total.pct host.cpu.usage percent
aws.ec2.diskio.read.bytes host.disk.read.bytes bytes
aws.ec2.diskio.write.bytes host.disk.write.bytes bytes
aws.ec2.network.in.bytes host.network.ingress.bytes bytes
aws.ec2.network.out.bytes host.network.egress.bytes bytes

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • Update the CPU usage visualization
  • Update the disk visualization
  • Update the network visualization

How to test this PR locally

Build Metricbeat

cd x-pack/metricbeat/

mage build

Enable AWS module

./metricbeat modules enable aws

And update modules.d/aws.yml to only collect EC2 metrics.

Set up cloud.id and cloud.auth to access Elastic Cloud, and deploy the dashboards

./metricbeat setup -E setup.dashboards.directory=build/kibana

Start Metricbeat to collect metric values to visualize in the dashboard.

Missing host.disk.*.bytes values?

If the disk read|write visualizations are empty, it means there are not EC2 instances with instance store volumes running, so we're not getting the fields host.disk.read.bytes and host.disk.write.bytes.

If you need to set up an EC2 instance for getting, you have to:

  1. Launch and EC2 instance with an instance store volume (I used an m5d.large, see https://docs.aws.amazon.com/ec2/latest/instancetypes/gp.html#gp_instance-store for more options.
  2. SSH into the EC2 instance
  3. Identify, format and mount the disk.
  4. Write and read data.

Here's what I did following https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/making-instance-stores-available-on-your-instances.html

$ lsblk
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
nvme1n1       259:0    0 69.8G  0 disk
nvme0n1       259:1    0    8G  0 disk
├─nvme0n1p1   259:2    0    8G  0 part /
├─nvme0n1p127 259:3    0    1M  0 part
└─nvme0n1p128 259:4    0   10M  0 part /boot/efi

sudo mkfs -t xfs /dev/nvme1n1
sudo mkdir /data
sudo mount /dev/nvme1n1 /data
# Generate many small files
for i in {1..1000}; do
    echo "Test data $i" > /data/file_$i.txt
done

# Read them back
cat /data/file_* > /dev/null

Related issues

  • N/A

Screenshots

Here are the CPU usage, disk, network visualization displaying data.

CleanShot 2025-07-08 at 22 46 36@2x

@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 30, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@zmoog zmoog added Team:obs-ds-hosted-services Label for the Observability Hosted Services team and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jun 30, 2025
@mergify mergify Bot assigned zmoog Jun 30, 2025
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jun 30, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @zmoog? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@zmoog zmoog added the bugfix label Jun 30, 2025
@zmoog zmoog changed the title Replace aws.ec2.cpu.total.pct with host.cpu.usage [aws] fix missing CPU usage metric in EC2 overview dashboard Jun 30, 2025
@zmoog zmoog changed the title [aws] fix missing CPU usage metric in EC2 overview dashboard [aws] Update CPU/disk/network metric field names in EC2 overview dashboard Jul 8, 2025
@zmoog zmoog changed the title [aws] Update CPU/disk/network metric field names in EC2 overview dashboard Fix CPU/disk/network visualizations in EC2 overview dashboard Jul 8, 2025
@zmoog zmoog changed the title Fix CPU/disk/network visualizations in EC2 overview dashboard [Metricbeat] Fix CPU/disk/network visualizations in EC2 overview dashboard Jul 8, 2025
@zmoog zmoog marked this pull request as ready for review July 8, 2025 20:44
@zmoog zmoog requested a review from a team as a code owner July 8, 2025 20:44
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

Copy link
Copy Markdown
Contributor

@Kavindu-Dodan Kavindu-Dodan left a comment

Choose a reason for hiding this comment

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

LGTM & thank you for working on this :)

Copy link
Copy Markdown
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

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

Tested the dashboards and they do work now. Thanks for fixing it!

@zmoog zmoog added the backport-active-all Automated backport with mergify to all the active branches label Jul 8, 2025
@zmoog zmoog enabled auto-merge (squash) July 8, 2025 22:58
@zmoog zmoog merged commit b8fb932 into main Jul 8, 2025
35 checks passed
@zmoog zmoog deleted the zmoog/fix/metricbeat/aws-ec2-cpu-usage-dashboard branch July 8, 2025 23:43
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 8, 2025

@Mergifyio backport 8.17 8.18 8.19 9.0 9.1

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jul 8, 2025

mergify Bot pushed a commit that referenced this pull request Jul 8, 2025
…board (#45117)

Updates the CPU/disk/network metric field names in the "[Metricbeat AWS] EC2 Overview" dashboard.

The "[Metricbeat AWS] EC2 Overview" dashboard that comes with the AWS modules was still using the old metric field names that are no longer in use, resulting in a dashboard with multiple empty visualizations.

Here are the current changes:

| Old                          | New                          | Formatter |
| ---------------------------- | ---------------------------- | --------- |
| `aws.ec2.cpu.total.pct`      | `host.cpu.usage`             | `percent` |
| `aws.ec2.diskio.read.bytes`  | `host.disk.read.bytes`       | `bytes`   |
| `aws.ec2.diskio.write.bytes` | `host.disk.write.bytes`      | `bytes`   |
| `aws.ec2.network.in.bytes`   | `host.network.ingress.bytes` | `bytes`   |
| `aws.ec2.network.out.bytes`  | `host.network.egress.bytes`  | `bytes`   |

---------

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
(cherry picked from commit b8fb932)
mergify Bot pushed a commit that referenced this pull request Jul 8, 2025
…board (#45117)

Updates the CPU/disk/network metric field names in the "[Metricbeat AWS] EC2 Overview" dashboard.

The "[Metricbeat AWS] EC2 Overview" dashboard that comes with the AWS modules was still using the old metric field names that are no longer in use, resulting in a dashboard with multiple empty visualizations.

Here are the current changes:

| Old                          | New                          | Formatter |
| ---------------------------- | ---------------------------- | --------- |
| `aws.ec2.cpu.total.pct`      | `host.cpu.usage`             | `percent` |
| `aws.ec2.diskio.read.bytes`  | `host.disk.read.bytes`       | `bytes`   |
| `aws.ec2.diskio.write.bytes` | `host.disk.write.bytes`      | `bytes`   |
| `aws.ec2.network.in.bytes`   | `host.network.ingress.bytes` | `bytes`   |
| `aws.ec2.network.out.bytes`  | `host.network.egress.bytes`  | `bytes`   |

---------

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
(cherry picked from commit b8fb932)
mergify Bot pushed a commit that referenced this pull request Jul 8, 2025
…board (#45117)

Updates the CPU/disk/network metric field names in the "[Metricbeat AWS] EC2 Overview" dashboard.

The "[Metricbeat AWS] EC2 Overview" dashboard that comes with the AWS modules was still using the old metric field names that are no longer in use, resulting in a dashboard with multiple empty visualizations.

Here are the current changes:

| Old                          | New                          | Formatter |
| ---------------------------- | ---------------------------- | --------- |
| `aws.ec2.cpu.total.pct`      | `host.cpu.usage`             | `percent` |
| `aws.ec2.diskio.read.bytes`  | `host.disk.read.bytes`       | `bytes`   |
| `aws.ec2.diskio.write.bytes` | `host.disk.write.bytes`      | `bytes`   |
| `aws.ec2.network.in.bytes`   | `host.network.ingress.bytes` | `bytes`   |
| `aws.ec2.network.out.bytes`  | `host.network.egress.bytes`  | `bytes`   |

---------

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
(cherry picked from commit b8fb932)
mergify Bot pushed a commit that referenced this pull request Jul 8, 2025
…board (#45117)

Updates the CPU/disk/network metric field names in the "[Metricbeat AWS] EC2 Overview" dashboard.

The "[Metricbeat AWS] EC2 Overview" dashboard that comes with the AWS modules was still using the old metric field names that are no longer in use, resulting in a dashboard with multiple empty visualizations.

Here are the current changes:

| Old                          | New                          | Formatter |
| ---------------------------- | ---------------------------- | --------- |
| `aws.ec2.cpu.total.pct`      | `host.cpu.usage`             | `percent` |
| `aws.ec2.diskio.read.bytes`  | `host.disk.read.bytes`       | `bytes`   |
| `aws.ec2.diskio.write.bytes` | `host.disk.write.bytes`      | `bytes`   |
| `aws.ec2.network.in.bytes`   | `host.network.ingress.bytes` | `bytes`   |
| `aws.ec2.network.out.bytes`  | `host.network.egress.bytes`  | `bytes`   |

---------

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
(cherry picked from commit b8fb932)
mergify Bot pushed a commit that referenced this pull request Jul 8, 2025
…board (#45117)

Updates the CPU/disk/network metric field names in the "[Metricbeat AWS] EC2 Overview" dashboard.

The "[Metricbeat AWS] EC2 Overview" dashboard that comes with the AWS modules was still using the old metric field names that are no longer in use, resulting in a dashboard with multiple empty visualizations.

Here are the current changes:

| Old                          | New                          | Formatter |
| ---------------------------- | ---------------------------- | --------- |
| `aws.ec2.cpu.total.pct`      | `host.cpu.usage`             | `percent` |
| `aws.ec2.diskio.read.bytes`  | `host.disk.read.bytes`       | `bytes`   |
| `aws.ec2.diskio.write.bytes` | `host.disk.write.bytes`      | `bytes`   |
| `aws.ec2.network.in.bytes`   | `host.network.ingress.bytes` | `bytes`   |
| `aws.ec2.network.out.bytes`  | `host.network.egress.bytes`  | `bytes`   |

---------

Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
(cherry picked from commit b8fb932)
zmoog added a commit that referenced this pull request Jul 9, 2025
…board (#45117) (#45246)

Updates the CPU/disk/network metric field names in the "[Metricbeat AWS] EC2 Overview" dashboard.

The "[Metricbeat AWS] EC2 Overview" dashboard that comes with the AWS modules was still using the old metric field names that are no longer in use, resulting in a dashboard with multiple empty visualizations.

Here are the current changes:

| Old                          | New                          | Formatter |
| ---------------------------- | ---------------------------- | --------- |
| `aws.ec2.cpu.total.pct`      | `host.cpu.usage`             | `percent` |
| `aws.ec2.diskio.read.bytes`  | `host.disk.read.bytes`       | `bytes`   |
| `aws.ec2.diskio.write.bytes` | `host.disk.write.bytes`      | `bytes`   |
| `aws.ec2.network.in.bytes`   | `host.network.ingress.bytes` | `bytes`   |
| `aws.ec2.network.out.bytes`  | `host.network.egress.bytes`  | `bytes`   |

---------


(cherry picked from commit b8fb932)

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
zmoog added a commit that referenced this pull request Jul 9, 2025
…board (#45117) (#45247)

Updates the CPU/disk/network metric field names in the "[Metricbeat AWS] EC2 Overview" dashboard.

The "[Metricbeat AWS] EC2 Overview" dashboard that comes with the AWS modules was still using the old metric field names that are no longer in use, resulting in a dashboard with multiple empty visualizations.

Here are the current changes:

| Old                          | New                          | Formatter |
| ---------------------------- | ---------------------------- | --------- |
| `aws.ec2.cpu.total.pct`      | `host.cpu.usage`             | `percent` |
| `aws.ec2.diskio.read.bytes`  | `host.disk.read.bytes`       | `bytes`   |
| `aws.ec2.diskio.write.bytes` | `host.disk.write.bytes`      | `bytes`   |
| `aws.ec2.network.in.bytes`   | `host.network.ingress.bytes` | `bytes`   |
| `aws.ec2.network.out.bytes`  | `host.network.egress.bytes`  | `bytes`   |

---------


(cherry picked from commit b8fb932)

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
zmoog added a commit that referenced this pull request Jul 9, 2025
…board (#45117) (#45248)

Updates the CPU/disk/network metric field names in the "[Metricbeat AWS] EC2 Overview" dashboard.

The "[Metricbeat AWS] EC2 Overview" dashboard that comes with the AWS modules was still using the old metric field names that are no longer in use, resulting in a dashboard with multiple empty visualizations.

Here are the current changes:

| Old                          | New                          | Formatter |
| ---------------------------- | ---------------------------- | --------- |
| `aws.ec2.cpu.total.pct`      | `host.cpu.usage`             | `percent` |
| `aws.ec2.diskio.read.bytes`  | `host.disk.read.bytes`       | `bytes`   |
| `aws.ec2.diskio.write.bytes` | `host.disk.write.bytes`      | `bytes`   |
| `aws.ec2.network.in.bytes`   | `host.network.ingress.bytes` | `bytes`   |
| `aws.ec2.network.out.bytes`  | `host.network.egress.bytes`  | `bytes`   |

---------


(cherry picked from commit b8fb932)

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
zmoog added a commit that referenced this pull request Jul 9, 2025
…board (#45117) (#45249)

Updates the CPU/disk/network metric field names in the "[Metricbeat AWS] EC2 Overview" dashboard.

The "[Metricbeat AWS] EC2 Overview" dashboard that comes with the AWS modules was still using the old metric field names that are no longer in use, resulting in a dashboard with multiple empty visualizations.

Here are the current changes:

| Old                          | New                          | Formatter |
| ---------------------------- | ---------------------------- | --------- |
| `aws.ec2.cpu.total.pct`      | `host.cpu.usage`             | `percent` |
| `aws.ec2.diskio.read.bytes`  | `host.disk.read.bytes`       | `bytes`   |
| `aws.ec2.diskio.write.bytes` | `host.disk.write.bytes`      | `bytes`   |
| `aws.ec2.network.in.bytes`   | `host.network.ingress.bytes` | `bytes`   |
| `aws.ec2.network.out.bytes`  | `host.network.egress.bytes`  | `bytes`   |

---------


(cherry picked from commit b8fb932)

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
zmoog added a commit that referenced this pull request Jul 9, 2025
…board (#45117) (#45250)

Updates the CPU/disk/network metric field names in the "[Metricbeat AWS] EC2 Overview" dashboard.

The "[Metricbeat AWS] EC2 Overview" dashboard that comes with the AWS modules was still using the old metric field names that are no longer in use, resulting in a dashboard with multiple empty visualizations.

Here are the current changes:

| Old                          | New                          | Formatter |
| ---------------------------- | ---------------------------- | --------- |
| `aws.ec2.cpu.total.pct`      | `host.cpu.usage`             | `percent` |
| `aws.ec2.diskio.read.bytes`  | `host.disk.read.bytes`       | `bytes`   |
| `aws.ec2.diskio.write.bytes` | `host.disk.write.bytes`      | `bytes`   |
| `aws.ec2.network.in.bytes`   | `host.network.ingress.bytes` | `bytes`   |
| `aws.ec2.network.out.bytes`  | `host.network.egress.bytes`  | `bytes`   |

---------


(cherry picked from commit b8fb932)

Co-authored-by: Maurizio Branca <maurizio.branca@elastic.co>
Co-authored-by: kaiyan-sheng <kaiyan.sheng@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches bugfix Team:obs-ds-hosted-services Label for the Observability Hosted Services team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants