Skip to content

Instantly share code, notes, and snippets.

@kmcquade
Last active February 27, 2024 17:03
Show Gist options
  • Save kmcquade/f45d5cd47a67fd4809b04e16a034cb6b to your computer and use it in GitHub Desktop.
Save kmcquade/f45d5cd47a67fd4809b04e16a034cb6b to your computer and use it in GitHub Desktop.

Revisions

  1. kmcquade revised this gist Feb 27, 2024. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions config.json
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    {
    "agent": {
    "metrics_collection_interval": 60,
    "run_as_user": "cwagent"
    "metrics_collection_interval": 60
    },
    "logs": {
    "logs_collected": {
  2. kmcquade created this gist Feb 27, 2024.
    124 changes: 124 additions & 0 deletions config.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,124 @@
    {
    "agent": {
    "metrics_collection_interval": 60,
    "run_as_user": "cwagent"
    },
    "logs": {
    "logs_collected": {
    "files": {
    "collect_list": [
    {
    "file_path": "/home/ec2-user/shared-volume/zap.log",
    "log_group_class": "STANDARD",
    "log_group_name": "/aws/ec2/home/ec2-user/shared-volume/zap.log",
    "log_stream_name": "{instance_id}_{hostname}",
    "retention_in_days": -1,
    "timezone": "UTC"
    },
    {
    "file_path": "/home/ec2-user/file.log",
    "log_group_class": "STANDARD",
    "log_group_name": "/aws/ec2/nv-zap/cli.log",
    "log_stream_name": "{instance_id}_{hostname}",
    "retention_in_days": -1,
    "timezone": "UTC"
    },
    {
    "file_path": "/var/log/cloud-init-output.log",
    "log_group_class": "STANDARD",
    "log_group_name": "/aws/ec2/var/log/cloud-init-output.log",
    "log_stream_name": "{instance_id}_{hostname}",
    "retention_in_days": -1,
    "timezone": "UTC"
    },
    {
    "file_path": "/var/log/cloud-init.log",
    "log_group_class": "STANDARD",
    "log_group_name": "/aws/ec2/var/log/cloud-init.log",
    "log_stream_name": "{instance_id}_{hostname}",
    "retention_in_days": -1,
    "timezone": "UTC"
    },
    {
    "file_path": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log",
    "log_group_class": "STANDARD",
    "log_group_name": "/aws/ec2/ec2/CloudWatchAgentLog/",
    "log_stream_name": "{instance_id}_{hostname}",
    "timezone": "UTC"
    },
    {
    "file_path": "/var/log/messages",
    "log_group_class": "STANDARD",
    "log_group_name": "/aws/ec2/var/log/messages",
    "log_stream_name": "{instance_id}_{hostname}",
    "timezone": "UTC"
    },
    {
    "file_path": "/var/log/secure",
    "log_group_class": "STANDARD",
    "log_group_name": "/aws/ec2/var/log/secure",
    "log_stream_name": "{instance_id}_{hostname}",
    "timezone": "UTC"
    }
    ]
    }
    }
    },
    "metrics": {
    "aggregation_dimensions": [
    [
    "ImageId"
    ],
    [
    "InstanceId"
    ],
    [
    "InstanceType"
    ]
    ],
    "append_dimensions": {
    "ImageId": "${aws:ImageId}",
    "InstanceId": "${aws:InstanceId}",
    "InstanceType": "${aws:InstanceType}"
    },
    "metrics_collected": {
    "collectd": {
    "metrics_aggregation_interval": 60
    },
    "disk": {
    "measurement": [
    "used_percent"
    ],
    "metrics_collection_interval": 60,
    "resources": [
    "*"
    ]
    },
    "mem": {
    "measurement": [
    "mem_used_percent"
    ],
    "metrics_collection_interval": 60
    },
    "statsd": {
    "metrics_aggregation_interval": 60,
    "metrics_collection_interval": 10,
    "service_address": ":8125"
    }
    }
    },
    "traces": {
    "buffer_size_mb": 3,
    "concurrency": 8,
    "insecure": false,
    "region_override": "us-east-1",
    "traces_collected": {
    "xray": {
    "bind_address": "127.0.0.1:2000",
    "tcp_proxy": {
    "bind_address": "127.0.0.1:2000"
    }
    }
    }
    }
    }