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

Grafana での AIS カスタムダッシュボード

Last updated on October 23, 2024
備考

Don't have a dedicated analyst? AccelByte provides professional services for creating and managing dashboards for you. Contact your AccelByte technical producer for more information.

Introduction

AccelByte provides you out-of-box analytics dashboard in the AccelByte Gaming Services (AGS) Admin Portal. However, we recognize that you may want to create your own custom dashboards to fully leverage the capabilities of the AccelByte Intelligence Service (AIS).

AccelByte supports custom AIS dashboards in Grafana. Grafana is a web GUI for creating visualizations of your data, it allows you to write SQL to source data from your AIS Data Warehouse to craft visualizations.

This article walks you through how to add AIS as a data source and create custom AIS dashboards in Grafana. This article only covers the basics of connecting and managing AIS dashboard in Grafana. We recommend that you explore and experiment AIS features to determine what will work with your environment and operation needs. For assistance or advice, contact your AccelByte technical producer.

Common use cases

You can create and use a custom AIS dashboard in Grafana for the following use cases:

  • Access your player metrics and build your own analytics such as cohorts, bar chart, player journey, and many more.
  • Query your game data based on service and custom telemetry, apply dimension filters (coming soon), and group by which splits the series into each group in that dimension (coming soon).
  • Save your custom event queries and everything you build in your custom dashboard once you are done.

Prerequisites

To connect Grafana with AIS, you must have the following:

  • An existing account in Grafana.
  • Your access information to the AIS Data Warehouse provided by your AccelByte technical producer or the AIS team.
注記

If you're already using the Grafana Dashboard provided by the AIS team, you will have custom AIS dashboards available in the General folder. Those dashboards are ready for you to use and modify.

Log in to AIS Grafana Dashboard

To access Grafana OSS, you can can log in using the credentials provided by the AGS Team or using your AGS Admin Portal credentials through the AccelByte SSO option.

Log in with AGS-provided credentials

After purchasing the AIS add-on, the AGS Team will send your credential information and a link to your Grafana dashboard via email. Ensure that you secure your credentials as soon as possible.

Log in with AGS Admin Portal account

To log in to Grafana using your AGS Admin Portal account, follow these steps:

  1. Open the provided link to your Grafana account.
  2. On the Grafana login page, select the Sign in with AccelByte option. The AGS Admin Portal login page appears. AccelByte SSO option
  3. Log in using your AGS credentials. You will get redirected to the Grafana homepage.

Connect Grafana to AIS

To connect your Grafana account to the AIS service, follow these steps:

  1. In Grafana, go to the Configuration menu and add a new data source.
  2. Choose PostgreSQL, and then fill in the connection information form with your access details to the AIS Data Warehouse.
  3. Click Save. The AIS Data Warehouse will be added as a data source in your Grafana account.

For more information about adding new data source to Grafana, refer to their official documentation.

Create an AIS dashboard

Creating an AIS dashboard involves the following tasks, in this order:

  1. Create a folder for the AIS dashboard.
  2. Create an AIS dashboard.
  3. Create a visualization panel.
注記

The proceeding sections aim to give you general guidance on how to complete the above tasks in Grafana. We recommend that you refer to Grafana's documentation for more in-depth information and up-to-date steps.

Create a folder

  1. On the homepage of your Grafana account, open the Dashboards menu. The Browse Dashboard page appears.
  2. Click the New button and select New Folder. A form appears.
  3. Type in a name for the new folder, then click the Create button. The new folder is created.

Create an AIS dashboard

  1. On the homepage of your Grafana account, open the Dashboards menu.
  2. On the Browse Dashboard page, click the New button and select New Dashboard. You will have a blank dashboard where you can add new panels.
  3. To save the dashboard, click the Save button on the top right screen.
  4. Provide a name for the AIS dashboard and select your target folder.
  5. Click the Save button to finish creating your dashboard.

Create a visualization panel

In this example, we will be creating a new visualization panel to show insights on the Monthly Match Session for the games in your studio. The panel will be created on the AIS dashboard.

To create a visualization panel, follow these steps:

  1. Go to your AIS dashboard.

  2. Add a new panel. For this example, use "Monthly Match Sessions of Your Studio" as the title of the panel.

  3. In the Query field, select AIS as your data source.

  4. Click Code to switch to text editor mode.

  5. Copy this SQL code into the Grafana Text Editor.

    SELECT
    EXTRACT(MONTH FROM bsdt.day_ts) AS month_number,
    SUM(bsdt.match_session_count) AS match_session_count
    FROM
    bd_session_daily_t AS bsdt
    INNER JOIN
    namespace_t AS nt ON nt.id = bsdt.namespace_id
    INNER JOIN
    -- (Optional) define it inside WHERE if you want to specify a studio.
    studio_t AS st ON st.id = nt.studio_id
    WHERE
    -- Change to FALSE if you don't have production data.
    nt.is_production = TRUE
    GROUP BY
    EXTRACT(MONTH FROM bsdt.day_ts)
    ORDER BY
    month_number;
  6. Run the query.

  7. Choose your preferred visualization type. In this example, we will be using Bar Chart. Go to the Bar Chart panel. In the X Axissetting, select month_number. The data will be visualized and show on the panel.

    The following image is a sample result of the panel. The graph depicts the total matches of all time, aggregated by month.

    Image shows a sample custom dashboard

  8. Click the Apply button to add the panel to your dashboard.

  9. Save the changes in your dashboard.

Manage users and roles in Grafana

Grafana has the following default dashboard roles:

  • Viewer: can only view dashboards.
  • Editor: can create and edit dashboards.
  • Admin: has full access to all dashboards, users, and configurations.

This section walks you through how to invite new users in Grafana.

Create new user

  1. In Grafana, click on Configuration (gear icon) on the sidebar and select Users.
  2. On the Users Configuration page, click on the Invite button.
  3. On the new user form, fill in the name and email address of the new user. Then, select the role you want to assign to the new user.
  4. (Optional) Turn on the Send Invite Email option to immediately send an invite email to the new user. You can opt to do this later.
  5. Click Submit.

To get the invite link for a pending invite, follow these steps:

  1. On the Users Configuration page, lick on the Pending Invites button.
  2. From the list of pending invites, find the invite with the link you want to copy and click on its Copy Invite button.