Updated on 2024-08-05 GMT+08:00

Viewing Metric Data in AOM Using Grafana

After connecting a cloud service or CCE cluster to a Prometheus instance, you can use Grafana to view the metrics of the cloud service or cluster.

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 2.0 console.
    2. In the navigation pane, choose Management > Global Configuration.
    3. In the navigation pane on the left, choose Authentication. Click Add Access Code.
    4. In the dialog box that is displayed, click OK. The system then automatically generates 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. Obtain the Grafana data source configuration code.

    1. Log in to the AOM 2.0 console.
    2. In the navigation pane on the left, choose Metric Analysis > Prometheus Monitoring. In the instance list, click the target Prometheus instance.
    3. On the displayed page, choose Settings in the navigation pane and obtain the Grafana data source information from the Grafana Data Source Info area.

  4. Configure Grafana.

    1. Log in to Grafana.
    2. In the navigation pane, choose Configuration > Data Sources. Then click Add data source.
      Figure 1 Configuring Grafana
    3. Click Prometheus to access the configuration page.
      Figure 2 Prometheus configuration page
    4. Set Grafana data source parameters.
      • URL: HTTP URL obtained in 3.
      • User: username obtained in 3.
      • Password: password obtained in 3.

      The Basic auth and Skip TLS Verify options under Auth must be enabled.

      Figure 3 Setting 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 4 Checking whether the configuration is successful