Skip to content

Instantly share code, notes, and snippets.

@ingmarsk
Last active October 18, 2022 17:12
Show Gist options
  • Save ingmarsk/98f9ad14bd899d6a5980f0fa25a8143a to your computer and use it in GitHub Desktop.
Save ingmarsk/98f9ad14bd899d6a5980f0fa25a8143a to your computer and use it in GitHub Desktop.
Custom CloudWatch Agent Configuration File
{
"agent": {
"metrics_collection_interval": 3600,
"region": "eu-west-3",
"run_as_user": "root"
},
"logs": {
"logs_collected": {
"files": {
"collect_list": [
{
"file_path": "/var/www/rails-bootstrap/shared/log/production.log",
"log_group_name": "ingeonrails-production",
"log_stream_name": "/var/www/rails-bootstrap/shared/log/production.log"
}
]
}
}
},
"metrics": {
"append_dimensions": {
"AutoScalingGroupName": "${aws:AutoScalingGroupName}",
"ImageId": "${aws:ImageId}",
"InstanceId": "${aws:InstanceId}",
"InstanceType": "${aws:InstanceType}"
},
"metrics_collected": {
"collectd": {
"metrics_aggregation_interval": 60
},
"disk": {
"measurement": [
"disk_used_percent",
"disk_total",
"disk_used",
"disk_free"
],
"resources": [
"*"
]
},
"mem": {
"measurement": [
"mem_active",
"mem_available",
"mem_available_percent",
"mem_buffered",
"mem_cached",
"mem_free",
"mem_inactive",
"mem_total",
"mem_used",
"mem_used_percent"
]
},
"processes": {
"measurement": [
"processes_blocked",
"processes_dead",
"processes_idle",
"processes_paging",
"processes_running",
"processes_sleeping",
"processes_stopped",
"processes_total",
"processes_total_threads",
"processes_wait",
"processes_zombies"
]
},
"cpu": {
"measurement": [
"cpu_usage_active",
"cpu_usage_nice",
"cpu_usage_system",
"cpu_usage_user"
]
},
"statsd": {
"service_address": ":8125"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment