首页 > 其他 > 详细

[AWS DA] AWS Monitoring & Audit: CloudWatch, X-Ray and CloudTrail

时间:2021-06-02 17:47:31      阅读:36      评论:0      收藏:0      [点我收藏+]

技术分享图片

 

CloudWatch

CloudWath Metrics

  • Default every 5 mins

EC2 Detailed monitoring

  • Get data every 1 mins
  • Free Tier allow to have 10 details monitoring metrics

技术分享图片

[Note]: EC2 Memory usage is by default not pushed (if must be pushed, from inside the instance as a csutom metric)

Custom Metrics

  • Possibility to define and send your own custom metrics to CloudWatch
  • Metric resolution:
    • Standard: 1 min
    • High Resolution: up to 1 second
    • StorageResolution API paramter
  • Use API call PutMetricData
  • Use Exponential back off in case of throttle errors

技术分享图片 

CloudWatch Alarms

  • Alarms are used to trigger notifications for any metric
  • Alarms can go to Auto Scaling, EC2 Actions, SNS notifications
  • Alarms States: OK, INSUFFICIENT_DATA, ALARM
  • Period: High Resolution custom metrics: can only choose 10 sec or 30 sec

 技术分享图片

技术分享图片

CloudWatch Logs

  • Can define log expiration policies (by default never expire, 30 days ...)
  • Make sure IAM permissions are correct
  • Security, encrypted by KMS at the group level
  • You are able to do search for logs
  • Other actions can do

技术分享图片

技术分享图片

 

EventBridge

技术分享图片

技术分享图片

 

X-Ray

Compatibility

  • Lambda
  • Elastic Beanstalk
  • ECS
  • ELB
  • API Gateway
  • EC2 Instances or any applciation server
  • ...

Enable X-Ray

技术分享图片

 

技术分享图片

 

Enabled X-Ray in ElasticBeanstalk

技术分享图片

技术分享图片

 

Concepts

  • Segments: each application / service will send the them
  • Subsegments: if you need more details in your segment
  • Trace: segments collected together to form an end-to-end trace
  • Sampling: decrease the amount of requests send to X-Ray, reduce costs
  • Annotations: Key Value pairs, used to index / search traces and use with filter
  • Metadata: Key Value paris, not indexed, not used for searching

技术分享图片

技术分享图片

技术分享图片

 

技术分享图片

  • PutTraceSegements: most important one, enable x-ray send data to server
  • PutTelemetryRecords
  • GetSamplingRules: also write to x-ray
  • GetSamplingStaticSummaries
  • GetSamplingTargets

技术分享图片

技术分享图片

 

There are two ways to run X-Ray on ECS instances.

1. Well-known one is deploy X-Ray daemon on an own docker container pre EC2 instance

2. "Side Car", deploy X-Ray daemon container along side Application container, each app with one x-ray daemon.

3. For Fargate, use side car approach

技术分享图片

On ECS, main thing to remember for Exam is that

  • You need to map x-ray port: 2000
  • and protocal: udp

技术分享图片

 

技术分享图片

[AWS DA] AWS Monitoring & Audit: CloudWatch, X-Ray and CloudTrail

原文:https://www.cnblogs.com/Answer1215/p/14839578.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!