This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.第 7 章 管理指标
您可以收集指标,以监控集群组件和您自己的工作负载的表现情况。
7.1. 了解指标 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
在 OpenShift Container Platform 4.11 中,集群组件的监控方式是提取通过服务端点公开的指标。您还可以为用户定义的项目配置指标集合。
您可以通过在应用程序级别使用 Prometheus 客户端库来定义您要为您自己的工作负载提供的指标。
在 OpenShift Container Platform 中,指标通过 /metrics
规范名称下的 HTTP 服务端点公开。您可以通过针对 http://<endpoint>/metrics
运行 curl
查询来列出服务的所有可用指标。例如,您可以向 prometheus-example-app
示例服务公开路由,然后运行以下命令来查看其所有可用指标:
curl http://<example_app_endpoint>/metrics
$ curl http://<example_app_endpoint>/metrics
输出示例