メインコンテンツまでスキップ

エクステンドサービス拡張の可観測性

Last updated on October 23, 2024

Introduction

You can use Grafana Cloud with AccelByte Gaming Services (AGS) to provide you with a query editor that allows you to specify the exact logs and metrics data you want to retrieve. You can pick the data source for logs and metrics by accessing the dropdown on the top.

This guide introduces Grafana Cloud tools for logs and metrics, utilizing the previously deployed app template as a practical example. The objective is to offer familiarity with Grafana's logging and metrics capabilities to enable effective debugging of a service extension.

Dashboard overview

You can access the Grafana Cloud dashboard for your Extend app from the AGS Admin Portal. For more information, see the Access Grafana Cloud dashboards guide.

The Grafana Cloud dashboards for Extend Service Extension apps have the following components:

Service extension basic query grafana logs

  • Data Source: Refer to marker #1. Use the dropdown to select "logs".
  • Query Method: At marker #2, opt for either the Query Builder or Code input.
  • Set Log Query: See marker #3. For code input, adjust and paste the sample query; if you're using the builder, follow the screenshot's example.
  • Define Time Range: Use marker #4 to set your desired time frame.
  • Execute & Review: Hit the Run Query button at marker #5 to view the logs.

Filter and identify startup logs

The initial moments after deploying an application are critical. It's during these moments that the application initializes and sets the stage for its operation. By examining the logs generated during this startup phase, developers can ensure the app has successfully transitioned from deployment to a running state.

Using the visual guide above, complete the steps below to apply filters and identify logs.

  1. Initiate the search: Refer to marker #3, the search bar, as your starting point for this verification process.

  2. Apply the filter: If you're using Code input as the Query Method (refer to marker #2), you can put the following query:

    {game_namespace="(your-namespace)", app_name="(your-appname)", environment_name="(your-enrionment)"} | logfmt | json | attributes_container = `service` | line_format `{{.body}}`
    Tip

    To make the logs more readable, you can add line_format to your query, e.g., "<your query>" | logfmt | json | line_format "{{.body}}".

  3. Execute the search: Click on the "Run Query" button, highlighted by marker #5, to surface the relevant logs.

  4. Review the outcome: If the app is running properly, you will see something like the following screenshot:

    Service extension grafana startup logs

Identify logs for successful endpoint calls

When an endpoint is successfully called or invoked, it means the application is not just running, but is actively processing requests and serving its intended functions. By observing the logs related to endpoint calls, developers can validate the application's responsiveness and functional health post-deployment.

Using the visual guide above, complete the steps below to identify logs for successful endpoint calls.

  1. Initiate the search: Refer to marker #3, the search bar, as your starting point for this verification process.

  2. Filter for endpoint calls: If you're using the Code input as the Query Method (refer to marker #2), you can put the following query:

    {game_namespace="(your-namespace)", app_name="(your-appname)", environment_name="(your-enrionment)"} | logfmt | json | attributes_container = `service` | method = `GET` |  line_format `{{.body}}`
    Tips

    In this sample, we're using method = `GET`, but you can use method =~ `.*` to filter all kinds of HTTP requests.

  3. Run the query: Click on the Run Query button, highlighted by marker #5, to surface the relevant logs.

  4. Examine the results: If the app is running properly, you will see something like the following screenshot:

    Service extension grafana endpoint call logs

Observe gRPC message reception metrics

Observing the reception of gRPC messages allows you to gauge the server's activity. We will use grpc_server_msg_received_total, which is a built-in metric provided by the Extend app template that counts the total number of gRPC stream messages received by the server. It gives insights into the server's message processing load, allowing you to identify traffic patterns and potential spikes in activity.

Monitor grpc_server_msg_received_total in Grafana

Using the visual guide above, complete the steps below to monitor grpc_server_msg_received_total in Grafana.

  1. Switch the data source: Navigate back to marker #1 and select "metric" as the data source.

  2. Metric query input: On marker #3, you can put this into the metric query bar if you're using Code Input as the Query Method:

    grpc_server_msg_received_total{game_namespace="(your-namespace)", app_name="(your-appname)"}
  3. Execute and analyze the metric: Click the Run Query button, identified by marker #5 and you'll see something like this:

service extension grafana metric