docs/reference/metricbeat/metricbeat-metricset-aws-ec2.md
% This file is generated! See metricbeat/scripts/mage/docs_collector.go
The ec2 metricset of aws module allows you to monitor your AWS EC2 instances, including cpu, network, disk and status. ec2 metricset fetches a set of values from Cloudwatch AWS EC2 Metrics.
We fetch the following data:
Some specific AWS permissions are required for IAM user to collect AWS EC2 metrics.
ec2:DescribeInstances
ec2:DescribeRegions
cloudwatch:GetMetricData
cloudwatch:ListMetrics
sts:GetCallerIdentity
iam:ListAccountAliases
The aws ec2 metricset comes with a predefined dashboard. For example:
- module: aws
period: 300s
metricsets:
- ec2
access_key_id: '<access_key_id>'
secret_access_key: '<secret_access_key>'
session_token: '<session_token>'
tags_filter:
- key: "Organization"
value: ["Engineering", "Product"]
tags_filter can be specified to only collect metrics with certain tag keys/values. For example, with the configuration example above, ec2 metricset will only collect metrics from EC2 instances that have tag key equals "Organization" and tag value equals to "Engineering" or "Product".
This is a default metricset. If the host module is unconfigured, this metricset is enabled by default.
For a description of each field in the metricset, see the exported fields section.
Here is an example document generated by this metricset:
{
"@timestamp": "2017-10-12T08:05:34.853Z",
"aws": {
"cloudwatch": {
"namespace": "AWS/EC2"
},
"dimensions": {
"InstanceId": "i-05b6228ff8d8c5d49"
},
"ec2": {
"cpu": {
"credit_balance": 144,
"credit_usage": 0.007318,
"surplus_credit_balance": 0,
"surplus_credits_charged": 0
},
"diskio": {
"read": {
"bytes_per_sec": 0,
"count_per_sec": 0
},
"write": {
"bytes_per_sec": 0,
"count_per_sec": 0
}
},
"instance": {
"core": {
"count": 1
},
"image": {
"id": "ami-058b1b7fe545997ae"
},
"monitoring": {
"state": "disabled"
},
"private": {
"dns_name": "ip-172-31-31-247.eu-west-1.compute.internal",
"ip": "172.31.31.247"
},
"public": {
"dns_name": "ec2-54-194-39-129.eu-west-1.compute.amazonaws.com",
"ip": "54.194.39.129"
},
"state": {
"code": 16,
"name": "running"
},
"threads_per_core": 1
},
"network": {
"in": {
"bytes_per_sec": 18.343333333333334,
"packets_per_sec": 0.15666666666666668
},
"out": {
"bytes_per_sec": 15.326666666666666,
"packets_per_sec": 0.16
}
},
"status": {
"check_failed": 0,
"check_failed_instance": 0,
"check_failed_system": 0
}
}
},
"cloud": {
"account": {
"id": "428152502467",
"name": "elastic-beats"
},
"availability_zone": "eu-west-1a",
"instance": {
"id": "i-05b6228ff8d8c5d49"
},
"machine": {
"type": "t2.micro"
},
"provider": "aws",
"region": "eu-west-1"
},
"event": {
"dataset": "aws.ec2",
"duration": 115000,
"module": "aws"
},
"host": {
"cpu": {
"usage": 0.1005649717511616
},
"disk": {
"read": {
"bytes": 0
},
"write": {
"bytes": 0
}
},
"id": "i-05b6228ff8d8c5d49",
"name": "i-05b6228ff8d8c5d49",
"network": {
"egress": {
"bytes": 4598,
"packets": 48
},
"ingress": {
"bytes": 5503,
"packets": 47
}
}
},
"metricset": {
"name": "ec2",
"period": 10000
},
"service": {
"type": "aws"
}
}