Skip to main content
Version: v1.3


title: Prometheus


This document demonstrates how to scrape metrics from edge node through Raven within an OpenYurt cluster, you can refer to the installation tutorial if Raven components are not deployed. Cloud and edge are usually in different network area, so the Raven project is needed to communicate across network area. Prometheus pull metrics of the resources and objects of the edge gateway node through the VPN built by raven agent, and the pull request of collecting non-gateway node metrics is forwarded by gateway node in the network area.


  • OpenYurt v1.2+

  • Raven v0.3.0+

  • Prometheus

If you don't have an OpenYurt on hand, you can refer installation tutorial to create one or convert from an exist Kubernetes cluster.

Prometheus config

Prometheus uses IP by default to access the metric addresses of the nodes, and the Raven project has implemented communication across network area, so using Prometheus on the OpenYurt project is consistent with native k8s.

collect kubelet metrics

The function to collect node metrics from kubelet can be added by modifying the configmap of prometheus. For instance, prometheus collects metrics for the node through the read-only port 10255 that kubelet listens on by the relabel configuration:

- job_name: 'kubelet'
      - role: node
    scheme: https
      ca_file: /var/run/secrets/
      insecure_skip_verify: true
      credentials_file: /var/run/secrets/
      - action: labelmap
        regex: __meta_kubernetes_node_label_(.+)
      - source_labels: [__address__]
        action: replace
        target_label: __address__
        regex: ([^:;]+):(\d+)
        replacement: ${1}:10255
      - source_labels: [__scheme__]
        action: replace
        target_label: __scheme__
        regex: https
        replacement: http

Note: If you also use read-only port 10255, please note that you configure kubelet to enable listening on port 10255, otherwise an error like the one shown in the figure will occur system-architecture