YuniKorn exposes its scheduling metrics via Prometheus. Thus, we need to set up a Prometheus server to collect these metrics.
If you don't know what metric can be used, you can use REST API.
1. Download Prometheus release
tar xvfz prometheus-*.tar.gz
2. Configure prometheus.yml
Prometheus collects metrics from targets by scraping metrics HTTP endpoints.
- job_name: 'yunikorn'
- targets: ['localhost:9080']
# 9080 is internal port, need port forward or modify 9080 to service's port
3. Start port-forward
Port forwarding for the core's web service on the standard port can be turned on via:
kubectl port-forward svc/yunikorn-service 9080:9080 -n yunikorn
9080is the default port for core's web service.
4. Execute prometheus
5. Access the Prometheus UI
You should be able to browse to a status page at localhost:9090. Give it a couple of seconds to collect data about itself from its own HTTP metrics endpoint.
You can also verify that Prometheus is serving metrics by navigating to its metrics endpoint:localhost:9090/metrics