Define and Implement Metrics and Logs Solutions - Amazon GameLift

Define and Implement Metrics and Logs Solutions

You can use data collected from your GameLift game servers and resources to help you spot anomalies and to make sure that everything is working as expected. You can also use metrics to help you improve performance.

Key areas of observability include:

  • GameLift service metrics — GameLift provides you Amazon CloudWatch metrics on resources including game servers, fleets, queues, and FlexMatch. These metrics are available in the GameLift console as well as the Amazon CloudWatch console. You can create CloudWatch alarms for any activity. Alarms can be received via email, SMS, and other SMS enabled devices. You can also create CloudWatch dashboards to visualize important GameLift metrics.

  • Game server metrics — GameLift does not have visibility into your game server internals and cannot provide you metrics outside of the session-related ones. You can send custom metrics to CloudWatch directly from your game server by using the CloudWatch agent, enabling the StatsD agent within it, and using a StatsD client in your game to send the metrics. You can also use the fleet IAM role and AWS SDK to send metrics directly to CloudWatch. An example of how to configure this can be found in the GameLift Example for Unity with Serverless Backend reference solution. It includes a sample CloudWatch agent configuration and code for a simple C# StatsD client.

  • Game server logs — Use the GameLift server SDK configuration to configure your game server log files on the game server. These logs are available from the GameLift console after a game session has finished. CloudWatch Logs can be used for a real-time log management solution with the possibility to create metrics from your log data, and alarms from those metrics. Logs can be configured with the CloudWatch agent. You will need a unique identifier for all log streams to avoid collisions. GameLift does not manage log rotation so you will need to implement that yourself. The CloudWatch agent supports different log rotation configurations. For more information, see the GameLift Example for Unity with Serverless Backend reference solution.