Updated on 2024-10-28 GMT+08:00

Viewing Metric Data in AOM Using Grafana

Prerequisites

Procedure

  1. Install and start Grafana. For details, see the Grafana official documentation.
  2. Add an access code.

    1. Log in to the AOM console. In the navigation pane, choose Configuration Management > Access Management.
    2. Click Add AccessCode.
      Figure 1 Adding an access code
      • You can create up to two access codes for each project.
      • An access code is an identity credential for calling APIs. Keep your access code secure.
    3. In the dialog box that is displayed, click OK to add the access code.
    4. After the access code is added, click to view it. To delete the access code, click Delete in the Operation column. Deleted access codes cannot be recovered. Exercise caution when performing this operation.
      Figure 2 Viewing the access code

  3. Configure Grafana.

    1. Log in to Grafana.
    2. In the navigation pane, choose Configuration > Data Sources. Then, click Add data source.
      Figure 3 Configuring Grafana
    3. Click Prometheus to access the configuration page.
      Figure 4 Entering the Prometheus configuration page
    4. Set parameters according to the following figure.
      • Password: access code generated in 2
      • User: aom_access_code
      • URL: {URI-scheme}://{Endpoint}/v1/{project_id}
        • URI-scheme: protocol used to transmit requests. Currently, all APIs use HTTPS.
        • Endpoint: domain name or IP address of the server bearing the REST service. The endpoint varies according to services in different regions. It can be obtained from Regions and Endpoints.
        • project_id: project ID, which can be viewed in the project list on the My Credentials page.
      • The Basic auth and Skip TLS Verify options under Auth must be enabled.
      • Access codes correspond to project IDs. Confirm their mapping when entering information.
      Figure 5 Configuring parameters
    5. Click Save&Test to check whether the configuration is successful.

      If the configuration is successful, you can use Grafana to configure dashboards and view metric data.

      Figure 6 Checking whether the configuration is successful