Logging and Monitoring with GameLift

Hi!

I’ve read Monitoring Amazon GameLift - Amazon GameLift and have a couple of questions. Maybe I’ve missed something in the documentation (I am a quite newbie in AWS GameLift), so if there is an existing link for the solution - please share it with me :slight_smile: I am mostly interested in GameLift-managed instances. I hope such things is possible to do with it instead of using custom EC2 + FleetIQ.

  1. According to the documentation, game session logs are available only after finishing the session. Is there any existing solution or workaround for getting game session logs in real-time? Via additional configuration of something like that.
  2. GameLift provides a set of existing metrics, which are available in CloudWatch. Can I provide anyhow my own custom metrics from my binaries? E.g. via Prometheus-compatible endpoint, which will be regularly pulled by something (or push like Prometheus Push Gateway). I didn’t find much information in the documentation. Also configuring alerts based on the metrics is quite important.

I need to mention that I am quite new to CloudWatch and CloudTrail, so I can miss some basic patterns.

Thanks in advance!

P.S. @JamesM_Aws sorry for mentioning you, if you are against it. I just see that you are answering my questions :slight_smile: If it’s not desired - just let me know :slight_smile:

  1. Realtime logs (e.g. from GameLift instances directly to CloudWatch) is not officially supported by Amazon GameLift yet, though it is a highly requested feature and is tracked in our worklog. However, you can implement your own realtime logging solution, and the recommended approach is to use CloudWatch agent. GameLift Solutions Architect has already provided an example on how to set it up: aws-gamelift-and-serverless-backend-sample/install.sh at master · aws-samples/aws-gamelift-and-serverless-backend-sample · GitHub. Essentially, on each instance startup, you can run a daemon that watches targeted log files and periodically pushes logs to your account’s CloudWatch by providing the IAM role.
  2. You should be able achieve that with CloudWatch agent as well (Amazon CloudWatch Agent adds Custom Metrics Support), or you could potentially include the AWS SDK in your game server and call CloudWatch::putMetricData directly. NOTE: you’ll need to pass your IAM role during fleet creation so the EC2 instances can assume your IAM role to put metrics into the CloudWatch on your account. See Communicate with other AWS resources from your fleets - Amazon GameLift

No problem! Glad to help

1 Like