èªåã¡ã¢ã
tl;dr
Datadog ããå±ããµã¼ãã¹ã®ç´¹ä»ã¡ã¼ã«ã«è¨è¼ããã¦ãã...
Datadog Agentã¨AWS APIã®ä¸¡æ¹ããæ å ±ãåéãã¾ãã
ä¸è¨ã®ãã ãã«ã¤ãã¦ããã㯠CloudWatch ã§åå¾åºæ¥ã ECS ã®æ å ±ãä½ããã®æ¹æ³ã§åå¾åºæ¥ãã®ããª...ã¨ãããã¨ã§ãDatadog ã®å ¬å¼ããã¥ã¡ã³ãã« ECS Integration ã«ã¤ãã¦è¨è¼ããã¦ããã®ã§ãããã¥ã¡ã³ãã«æ²¿ã£ã¦ Terraform ã®ãã³ãã¬ã¼ããä½ã£ã¦è©¦ãã¦ã¿ããã¨ã«ããã
ECS ã®ã³ã³ããã Datadog ã§ã¢ãã¿ãªã³ã°ããæ¹æ³ã¨ãã¦ä»¥ä¸ã®ä¸ã¤ã®æ¹æ³ãåããã
- ECS ã¤ã³ã¹ã¿ã³ã¹ã«ãã°ã¤ã³ã㦠Datadog Agent ãã¤ã³ã¹ãã¼ã«ã㦠Docker Integration ãæå¹ã«ãã
- Datadog Agent å ¥ãã³ã³ãããæå㧠docker run ãã
- ECS ã® task ã¨ãã¦ç»é²ãã¦ããã¦ãã¤ã³ã¹ã¿ã³ã¹èµ·åæã« start-task ããã
ä»åã®ããã¥ã¡ã³ãã«ç´¹ä»ããã¦ããæ¹æ³ã¯ä¸ç¹ç®ã®æ¹æ³ãtask ç»é²ãè¡ã£ãä¸ã§ rc.local ã«ä»è¾¼ã¾ãã aws ecs start-task
ã§ã³ã³ãããèµ·åããã¦ããããæ´ã« AWS Integration ãè¨å®ãããã¨ã§ ECS ã® CloudWatch ã¡ããªã¯ã¹ãåå¾åºæ¥ãããã«ãªã£ãããã ã
åãä½ã£ã Terraform ãã³ãã¬ã¼ã
以ä¸ãåãä½ã£ã Terraform ãã³ãã¬ã¼ãã
terraform apply
ããã¨ã¢ãã¿ãªã³ã°ãéå§ããã
詳細㯠README ã«ã¦ã
ãã㦠AWS Integration 㧠ECS ã¡ããªã¯ã¹ãåå¾ãã
AWS Integration ã®è¨å®
ã¨ãããã¨ã§ CloudWatch ã® API ãå©ãã¦ã¡ããªã¯ã¹ãåå¾ããçºã«ã¯ AWS Integration ãè¨å®ããã
ããã®...
ã§ã
AWS Integration 㧠ECS ç£è¦ãæå¹ã«ãããã¨ã§ ECS ã®ã¡ããªã¯ã¹ã ECS ã¯ã©ã¹ã¿åãåå¾åºæ¥ãããã«ãªããã¯ã©ã¹ã¿æ¯ã® CPU 使ç¨ççãåå¾åºæ¥ãããã«ãªãã
以ä¸ã¯ Datadog Agent ã§åå¾åºæ¥ãé ç®ã
- docker.containers.running
- docker.containers.stopped
- docker.cpu.system
- docker.cpu.user
- docker.mem.cache
- docker.mem.rss
- docker.mem.swap
ããã¦ãAWS Integration ã ã¨...
ãã¡ããªã¯ã¹ã¨ãã¦è¿½å ãããã
å°...
ãã¡ãã®ããã¥ã¡ã³ãã«å¾ã£ã¦ ECS ã¯ã©ã¹ã¿ãæ§æããå ´åã« IAM ãã¼ã«ã®æ¨©éãä¸è¶³ãã¦ããçºã« AWS Integration ã«ã¦ ECS ã®ã¡ããªã¯ã¹ãåå¾åºæ¥ãªãã®ã§æ³¨æããããã
ããã¥ã¡ã³ãéãã« IAM ãã¼ã«ã®æ¨©éãè¨å®ãããã¨ã§ AWS Integration ã«ã¦ ECS ã®ã¡ããªã¯ã¹ãåå¾ãããã¨ãå¯è½ã
$ git diff oreno_tf_ecs_iam.tf diff --git a/oreno_tf_ecs_iam.tf b/oreno_tf_ecs_iam.tf index 7c92854..3734e62 100644 --- a/oreno_tf_ecs_iam.tf +++ b/oreno_tf_ecs_iam.tf @@ -45,7 +45,8 @@ resource "aws_iam_role_policy" "ecs_iam_role" { "ecs:DiscoverPollEndpoint", "ecs:Submit*", "ecs:Poll", - "ecs:StartTask" + "ecs:StartTask", + "ecs:StartTelemetrySession" ], "Effect": "Allow", "Resource": "*"
ECS ã®ããã¥ã¡ã³ãã«ã¯...
Your Amazon ECS container instances also require ecs:StartTelemetrySession permission on the IAM role that you launch your container instances with. If you created your Amazon ECS container instance role before CloudWatch metrics were available for Amazon ECS, then you might need to add this permission. For information on checking your Amazon ECS container instance role and attaching the managed IAM policy for container instances, see To check for the ecsInstanceRole in the IAM console.
ã¨ãããecs:StartTelemetrySession
ããã¼ã«ã«ä»ããå¿
è¦ãããã
仮㫠ecs:StartTelemetrySession
ã®å®ç¾©ãç¡ãå ´åã§ã ECS Agent ã³ã³ããã¯èµ·åããã以ä¸ã®ãããªãã°ãåºåãã㦠ECS ã®ã¡ããªã¯ã¹ã¯åéãããªãã
2015-08-30T13:40:54Z [ERROR] Error connecting to TCS: {"AccessDeniedException":"Forbidden"}, websocket: bad handshake module="tcs handler" 2015-08-30T13:40:54Z [INFO] Error from tcs; backing off module="tcs handler" err="{"AccessDeniedException":"Forbidden"}, websocket: bad handshake"
以ä¸ã®è¨äºãåèã«ãªãã
https://forums.aws.amazon.com/thread.jspa?messageID=673017
以ä¸ããã¡ãããã¾ã§ããã