Skip to main content

Extend Service Extension Observability

Last updated on April 17, 2024
info

Extend is in Open Beta for AGS Premium Clients! This means that the Extend add-on is available for you to try in your development environment. You can submit your feedback via our Extend Open Beta feedback form.

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, traces, and metrics data you want to retrieve. You can pick the data source for logs, traces, or metrics by accessing the dropdown on the top.

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

AGS Starter

AGS Starter customers are eligible for a free trial of Grafana Cloud. The trial period runs from March 18, 2024 at 7:00 AM PDT until April 26, 2024 at 11:59 PM PDT. Please note that this offer is exclusive to the first user (within your AGS account) who logs in to Grafana Cloud during the time frame. Only this user will have access to Grafana Cloud throughout the trial period. For more information on how to start your free trial, see Grafana Cloud free trial.

Access and navigate the Grafana dashboard

Begin by launching Grafana using the provided URL. Navigate to the designated dashboard for the sample app.

For another relevant topic on opening the Grafana dashboard, please refer to the Extend observability introduction page.

Use the visual guide

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 sample app 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