The platform's monitoring system is based on the metrics collected by Prometheus / VictoriaMetrics. This document will guide you on how to manage these metrics.
The monitoring method for the cluster components within the platform is to extract metrics exposed via ServiceMonitor
. Metrics in the platform are publicly available through the /metrics
endpoint. You can view the exposed metrics of a specific component in the platform using the following example command:
Sample Output:
You can view the list of available metrics in the cluster to help you write the PromQL you need based on these metrics.
You have obtained your user Token
You have obtained the platform address
Run the following command to get the list of metrics using the curl
command:
Sample Output:
To simplify user usage, the platform has built in a large number of commonly used metrics. You can directly use these metrics when configuring alerts or monitoring dashboards without needing to define them yourself. The following will introduce you to how to view these metrics.
You have obtained your user Token
You have obtained the platform address
Run the following command to get the list of metrics using the curl
command:
Sample Output:
In addition to the built-in metrics of the platform, you can also integrate metrics exposed by your applications or third-party applications via ServiceMonitor
or PodMonitor
. This section uses the Elasticsearch Exporter installed in pod form in the same cluster as an example for explanation.
You have installed your application and exposed metrics through specified interfaces. In this document, we assume your application is installed in the cpaas-system
namespace and has exposed the http://<elasticsearch-exporter-ip>:9200/_prometheus/metrics
endpoint.
ServiceMonitor
object to describe the metrics exposed by your application:Access the UI of the monitoring component to check if the job cpaas-elasticsearch-exporter
exists.
https://<Your platform access address>/clusters/<Cluster name>/prometheus-0/targets
https://<Your platform access address>/clusters/<Cluster name>/vmselect/vmui/?#/metrics