Monitoring Amazon GameSparks with CloudWatch - Amazon GameSparks

Amazon GameSparks is currently in preview. Changes might be made to this service and to this documentation. We don’t recommend using this service for production workloads.

Monitoring Amazon GameSparks with CloudWatch

To monitor and get insight into how your Amazon GameSparks games are working, use:

CloudWatch logs

You can troubleshoot and log important GameSparks cloud code events on the backend using Amazon CloudWatch Logs. You will need to insert logging statements into your cloud code where you want to validate that it is working as expected. For example: GameSparks().Logging().Debug("Made it this far"). GameSparks also logs cloud code execution errors in CloudWatch.

View the logs

To view the logs:

  1. Open CloudWatch. In the banner at the top of the console:

    • Choose Services, and then choose CloudWatch under Recently visited.

    • If CloudWatch does not appear in the Services menu, in the Search…​ box enter CloudWatch, and then choose CloudWatch.

  2. In the navigation pane, select Log groups.

  3. A list of groups appears.

    GameSparks groups are named /aws/gamesparks/<game name>_<stage name>_<ID>. (You can ignore the ID.)

  4. Choose the log group and choose the log stream to view log entries.

Specify log data retention

By default, GameSparks creates log groups set to Never expire, which keeps all data indefinitely. Some companies have policy or legal requirements that affect how long data must be retained. You may be charged for ingestion and retention of your log data. See CloudWatch Pricing to learn more. You can control how long data is kept by clicking the text in the Retention column and then choosing a different setting.

Learn more about CloudWatch Logs

Learn more about:

CloudWatch Metrics

Amazon CloudWatch metrics can load all of the metrics in your account (both AWS resource metrics and application metrics that you provide) for search, graphing, and alarms.

Game- and stage-level metrics

These metrics have the following dimensions:

Dimension

Description

Game

The game name.

Stage

The stage name.

The metrics defined are:

Metric

Description

ConcurrentConnections

The number players that are connected to the game backend.

Message-level metrics

These metrics have the following dimensions:

Dimension

Description

Game

The game name.

Stage

The stage name.

MessageCategory

Either Request or Event.

Metrics defined are:

Metric

Description

MessageReceived

The number of messages received in the sampled time period.

MessageProcessingDuration

The time spent processing messages.

MessageProcessingError

The number of errors that occurred while processing messages.

Learn more about CloudWatch metrics

Learn more: Using Amazon CloudWatch metrics