Add tests for EBS CSI NVMe on EKS - #507
Conversation
| } | ||
|
|
||
| func (t *DiskIOTestRunner) GetAgentRunDuration() time.Duration { | ||
| return 5 * time.Minute |
There was a problem hiding this comment.
Is 5 minutes necessary for NVME metrics? Can it be shorter or 5 is the most consistent we found
There was a problem hiding this comment.
I found this to be the most consistent. I would've liked it to be shorter :(
| @@ -0,0 +1,62 @@ | |||
| { | |||
| "$schema": "http://json-schema.org/draft-04/schema#", | |||
There was a problem hiding this comment.
can you provide a sample emf log to cross reference?
There was a problem hiding this comment.
{
"AutoScalingGroupName": "eks-dscia-ng-c8ca3ae1-cabd-aab3-a6d0-50ecc2aa8c30",
"CloudWatchMetrics": [{
"Namespace": "ContainerInsights",
"Dimensions": [
["ClusterName"],
["ClusterName", "InstanceId", "NodeName"],
["ClusterName", "InstanceId", "NodeName", "VolumeId"]
],
"Metrics": [{
"Name": "node_diskio_ebs_volume_performance_exceeded_tp",
"Unit": "Second",
"StorageResolution": 60
}, {
"Name": "node_diskio_ebs_total_read_bytes",
"Unit": "Bytes",
"StorageResolution": 60
}, {
"Name": "node_diskio_ebs_ec2_instance_performance_exceeded_tp",
"Unit": "Second",
"StorageResolution": 60
}, {
"Name": "node_diskio_ebs_volume_performance_exceeded_iops",
"Unit": "Second",
"StorageResolution": 60
}, {
"Name": "node_diskio_ebs_total_read_ops",
"Unit": "Count",
"StorageResolution": 60
}, {
"Name": "node_diskio_ebs_total_write_bytes",
"Unit": "Bytes",
"StorageResolution": 60
}, {
"Name": "node_diskio_ebs_total_write_ops",
"Unit": "Count",
"StorageResolution": 60
}, {
"Name": "node_diskio_ebs_total_write_time",
"Unit": "Second",
"StorageResolution": 60
}, {
"Name": "node_diskio_ebs_ec2_instance_performance_exceeded_iops",
"Unit": "Second",
"StorageResolution": 60
}, {
"Name": "node_diskio_ebs_total_read_time",
"Unit": "Second",
"StorageResolution": 60
}]
}],
"ClusterName": "dscia-testing",
"InstanceId": "i-0434a029434c980f7",
"InstanceType": "m5.large",
"NodeName": "ip-192-168-8-144.ec2.internal",
"Timestamp": "1745510582682",
"Type": "NodeNVME",
"Version": "0",
"VolumeId": "vol-0eb35c5cbb1ebfc97",
"http.scheme": "http",
"instance_id": "i-0434a029434c980f7",
"k8s.namespace.name": "kube-system",
"kubernetes": {
"host": "ip-192-168-8-144.ec2.internal"
},
"net.host.name": "ebs-csi-node.kube-system.svc",
"net.host.port": "3302",
"server.address": "ebs-csi-node.kube-system.svc",
"server.port": "3302",
"service.instance.id": "ebs-csi-node.kube-system.svc:3302",
"service.name": "containerInsightsNVMeExporterScraper",
"url.scheme": "http",
"volume_id": "vol-0eb35c5cbb1ebfc97",
"node_diskio_ebs_ec2_instance_performance_exceeded_iops": 0,
"node_diskio_ebs_ec2_instance_performance_exceeded_tp": 0,
"node_diskio_ebs_total_read_bytes": 1056768,
"node_diskio_ebs_total_read_ops": 39,
"node_diskio_ebs_total_read_time": 0.02430000000003929,
"node_diskio_ebs_total_write_bytes": 135168,
"node_diskio_ebs_total_write_ops": 23,
"node_diskio_ebs_total_write_time": 0.020897999999988315,
"node_diskio_ebs_volume_performance_exceeded_iops": 0,
"node_diskio_ebs_volume_performance_exceeded_tp": 0
}- Remove unnecessary operator image update - Add missing metric from schema
- Remove empty logfile which should make it easier to debug later down the line - Remove run_as_user since root is already default - Remove debug line
| } | ||
| } | ||
|
|
||
| resource "helm_release" "aws_observability" { |
There was a problem hiding this comment.
why is this called "helm_release"?
There was a problem hiding this comment.
https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release
It’s just how it’s named for the Helm charts
| container { | ||
| name = "app" | ||
| image = "public.ecr.aws/amazonlinux/amazonlinux" | ||
| command = ["/bin/bash", "-c", "while true; do echo $(date -u) >> /data/out.txt; sleep 5; done"] |
There was a problem hiding this comment.
why is this necessary? To force a write on disk to produce a metric?
|
|
||
| variable "ami_type" { | ||
| type = string | ||
| default = "AL2_x86_64" |
There was a problem hiding this comment.
not related to your PR but at some point we should start testing with AL2023 since EKS recommends AL2023
https://docs.aws.amazon.com/eks/latest/userguide/al2023.html
Description of the issue
Testing that the metrics and EMF logs are correct when CWA is emitting EBS NVMe metrics from the EBS CSI driver.
Description of changes
New suite of tests that check that all metrics are emitted correctly with the correct dimension sets
New test environment using Terraform
I. Installs the agent using the Helm charts
ii. Installs the EBS CSI add-on and enables the metrics
iii. An Amazon Linux container is deployed with an ephemeral EBS volume attached to test the metrics
These tests do assert on the
Typelabel (as do the other tests) which needs to be updated in Add translation logic for NVME metrics amazon-cloudwatch-agent#1625 (comment) to work.Update 1:
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
https://github.com/aws/amazon-cloudwatch-agent/actions/runs/14500675779/job/40745198026
I . The test ran with a dev build that has the EBS CSI Prometheus scraping logic
Latest test with a real build: https://github.com/aws/amazon-cloudwatch-agent/actions/runs/15978524238/job/45067569331