Skip to content

[8.18](backport #45117) [Metricbeat] Fix CPU/disk/network visualizations in EC2 overview dashboard#45247

Merged
zmoog merged 1 commit into8.18from
mergify/bp/8.18/pr-45117
Jul 9, 2025
Merged

[8.18](backport #45117) [Metricbeat] Fix CPU/disk/network visualizations in EC2 overview dashboard#45247
zmoog merged 1 commit into8.18from
mergify/bp/8.18/pr-45117

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Jul 8, 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


This is an automatic backport of pull request #45117 done by [Mergify](https://mergify.com).

…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 mergify Bot added the backport label Jul 8, 2025
@mergify mergify Bot requested a review from a team as a code owner July 8, 2025 23:45
@mergify mergify Bot assigned zmoog Jul 8, 2025
@mergify mergify Bot added the backport label Jul 8, 2025
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 8, 2025
@github-actions github-actions Bot added Team:obs-ds-hosted-services Label for the Observability Hosted Services team bugfix labels Jul 8, 2025
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 8, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@zmoog zmoog merged commit a536e76 into 8.18 Jul 9, 2025
25 checks passed
@zmoog zmoog deleted the mergify/bp/8.18/pr-45117 branch July 9, 2025 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 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.

2 participants