简体   繁体   English

EC2 是否默认将日志发送到 CloudWatch?

[英]Does EC2 send logs to CloudWatch by default?

The metrics which are visible under EC2 monitoring, like.network, disk, CPU and status checks, are those sent to CloudWatch?在 EC2 监控下可见的指标,如网络、磁盘、CPU 和状态检查,是否发送到 CloudWatch? If yes, where are they stored?如果是,它们存放在哪里?

All the metrics of EC2 instances are stored and monitored by AWS Cloudwatch Metrics service. EC2 实例的所有指标都由 AWS Cloudwatch Metrics 服务存储和监控。 The default time interval of capturing these metrics is 5 minutes.捕获这些指标的默认时间间隔是 5 分钟。 However, you can enable a close watch upto an interval of 1 minute.但是,您最多可以启用 1 分钟间隔的密切监视。 This means Cloudwatch metrics can capture the metrics every 1 minute from the EC2 instance and display in the form of graph.这意味着 Cloudwatch 指标可以每 1 分钟从 EC2 实例中捕获指标并以图形的形式显示。

The graphs that you see in the EC2 instance monitoring dashboard are rendered using the Cloudwatch metrics data itself.您在 EC2 实例监控仪表板中看到的图表是使用 Cloudwatch 指标数据本身呈现的。 You can easily view these graphs and several other metrics in the Cloudwatch metrics service.您可以在 Cloudwatch 指标服务中轻松查看这些图表和其他几个指标。

However, Logs from EC2 instances and some other metrics like GPU performance and others are not really sent out to Cloudwatch unless you configure it to.但是,来自 EC2 实例的日志和一些其他指标(如 GPU 性能等)不会真正发送到 Cloudwatch,除非您将其配置为。 You need to configure a Cloudwatch logs agent for the same.您需要为此配置一个 Cloudwatch 日志代理。 More details are available at this link链接提供更多详细信息

According to the documentation根据文档

By default, basic monitoring is enabled when you create a launch template or when you use the AWS Management Console to create a launch configuration.默认情况下,当您创建启动模板或使用 AWS 管理控制台创建启动配置时,会启用基本监控。 Detailed monitoring is enabled by default when you create a launch configuration using the AWS CLI or an SDK.当您使用 AWS CLI 或 SDK 创建启动配置时,默认情况下会启用详细监控。

The basic basic monitoring sends in 5 minute periods, while the detailed monitoring sends in 1 minute periods. basic基本监控每5分钟发送一次,详细监控每1分钟发送一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM