Logging and Monitoring with GameLift

0

Hi!

I've read https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-overview.html 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 :) 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. @REDACTEDUSER

asked 3 years ago534 views
1 Answer
0
  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: https://github.com/aws-samples/aws-gamelift-and-serverless-backend-sample/blob/master/LinuxServerBuild/install.sh#L4. 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 (https://aws.amazon.com/about-aws/whats-new/2018/09/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 https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-resources.html

No problem! Glad to help

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions