Help Center/ Application Operations Management/ User Guide (2.0)/ Prometheus Monitoring/ Viewing Prometheus Instance Data Through Grafana
Updated on 2024-05-27 GMT+08:00

Viewing Prometheus Instance Data Through 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 Settings. The Global Configuration page is displayed.
    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 Prometheus Monitoring > Instances. 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.
      Figure 1 Grafana data source information

  4. Configure Grafana.

    1. Log in to Grafana.
    2. In the navigation pane, choose Configuration > Data Sources. Then click Add data source.
      Figure 2 Configuring Grafana
    3. Click Prometheus to access the configuration page.
      Figure 3 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 4 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 5 Checking whether the configuration is successful