Help Center/ Cloud Eye/ User Guide/ Access Center/ Connecting to Prometheus or Grafana/ Exporting Monitoring Data to Self-built Prometheus/Grafana
Updated on 2026-07-24 GMT+08:00

Exporting Monitoring Data to Self-built Prometheus/Grafana

Prometheus is an open-source visualization tool used to display large-scale monitoring data. It has a wide user base in areas such as industrial monitoring, meteorological monitoring, home automation, and process management. After connecting Cloud Eye to Prometheus, you can use Prometheus to better monitor and analyze data from Cloud Eye.

Grafana is an open-source visualization and analysis platform. It supports multiple data sources and provides multiple panels and plug-ins to quickly turn complex data into insightful graphs and visualizations. After connecting Cloud Eye to Prometheus, you can use Grafana to better analyze and display data from Cloud Eye.

Prerequisites

You have installed and configured the cloudeye-exporter. For details, see Installing and Configuring cloudeye-exporter in AK/SK Mode or Installing and Configuring cloudeye-exporter in OIDC Mode.

Constraints

The data obtained by cloudeye-exporter comes from cloud service metric reporting. If the reporting is delayed, the exporter cannot obtain the latest metric data. This may cause the metrics on the Grafana dashboard to be temporarily different from those on the Cloud Eye console.

Downloading and Configuring Prometheus

  1. Obtain the Prometheus installation package applicable to your system. For details about the download address, visit https://prometheus.io/download/.
  2. Log in to the server where cloudeye-exporter has been deployed as user root.
  3. Download Prometheus. The following uses prometheus-3.8.1.linux-amd64.tar.gz as an example:
    wget https://github.com/prometheus/prometheus/releases/download/v3.8.1/prometheus-3.8.1.linux-amd64.tar.gz
  4. Decompress Prometheus.
    tar xvfz prometheus-3.8.1.linux-amd64.tar.gz
  5. Go to the Prometheus directory and configure the prometheus.yml file to connect to cloudeye-exporter.
    cd prometheus-3.8.1.linux-amd64
    vi prometheus.yml
    The following uses VPC and RDS as an example. Add a node whose job_name is huaweicloud under scrape_configs. targets specifies the IP address and port number for accessing the cloudeye-exporter service, and services specifies the namespace of the service to be monitored. For details about the namespace of each cloud service, see Cloud Product Metrics.
    global:
      scrape_interval: 1m
      scrape_timeout: 1m
    scrape_configs:
      - job_name: 'huaweicloud-VPC'
        static_configs:
          - targets: ['192.168.0.xx:8087']
        params:
          services: ['SYS.VPC']
      - job_name: 'huaweicloud-RDS'
        static_configs:
          - targets: ['192.168.0.xx:8087']
        params:
          services: ['SYS.RDS']
      - job_name: "prometheus-eps"
        metrics_path: '/eps-info' #
        static_configs:
          - targets: ["192.168.0.xx:8087"] 
        params:
          services: []
    • If the queried resources use enterprise project tags or the Grafana dashboard template provided by Cloud Eye is used, you need to add enterprise project-related request configurations to scrape_configs.
        - job_name: "prometheus-eps"
          metrics_path: '/eps-info'
          static_configs:
            - targets: ["192.168.0.xx:8087"] 
          params:
            services: []
    • If multiple cloud services need to be monitored, you are advised to configure a separate job for each service to improve data query efficiency.
    Table 1 global parameters

    Parameter

    Description

    Example Value

    scrape_interval

    Interval for Prometheus to query data from cloudeye-exporter. The default value is 15s in the Prometheus configuration file. The recommended value is 1m.

    1m

    scrape_timeout

    Timeout interval for querying data from cloudeye-exporter. The default value is 15s in the Prometheus configuration file. The recommended value is 1m.

    1m

    Table 2 scrape_configs parameters

    Parameter

    Description

    Example Value

    job_name

    Job name.

    huaweicloud-VPC

    metrics_path

    To obtain enterprise project information, you need to configure the metric path. The value is /eps-info.

    /eps-info

    static_configs

    Static configuration target. The value is in the format of cloudeye-exporter node address:Listening port.

    - targets: ['192.168.0.xx:8087']

    params

    Service parameter, which specifies the service namespace to be queried in the job.

    services: ['SYS.VPC']

  6. Start the Prometheus.
    ./prometheus

Connecting Grafana to Prometheus

This section uses Grafana v12.4.1 as an example to describe how to connect Grafana to Prometheus.

  1. Download and install Grafana that is compatible with your system. For details, visit https://grafana.com/grafana/download.
  2. Open a browser and log in to Grafana. The default login address is http://127.0.0.1:3000.

    If the system you log in to is different from the system where Grafana is installed, the login address is http://{Public IP address of the server where Grafana is installed}:3000.

    Figure 1 Logging in to Grafana
  3. Configure the Prometheus data source.
    1. In the navigation pane on the left of the Grafana page, choose Connections > Data sources.
    2. On the Data sources page, click Add data source.
    3. Set the data source type to Prometheus.
    4. On the Settings tab page, enter the Prometheus address in the Prometheus server URL text box.

      The default address for logging in to Prometheus is http://127.0.0.1:9090. If Prometheus is deployed on a different system from Grafana, the login address is http://{Public IP address of the host where Prometheus is deployed}:9090.

      Figure 2 Configuring the Prometheus data source
    5. At the bottom of the page, click Sava & test.

      If the message "Successfully queried the Prometheus API." is displayed, the configuration is successful.

  4. Configure monitoring graphs for cloud services.

    You are advised to use the templates provided by Cloud Eye. To obtain the template file of each cloud service, visit https://github.com/huaweicloud/cloudeye-exporter/tree/br_release_sdk_v3/grafana_dashboard/templates.

    In cloudeye-exporter 2.0.32 and later versions, the evsId field is added to the disk metrics collected by the Agent. (This field applies only to EVS disks.) Windows does not support this field.

    1. In the navigation pane on the left of the Grafana page, choose Dashboards.
    2. On the Dashboards page, click New > Import in the upper right corner.
    3. On the Import dashboard page, click Upload dashboard JSON file.
    4. In the DS_PROMETHEUS area, select the data source configured in 3.
      Figure 3 Importing a JSON template
    5. Click Import.