Monitoring NGINX Ingress Controller with VTS metrics
Monitoring NGINX Ingress Controller with VTS metrics
在 GitLab 9.5 中引入 .
注意: 及更高版本具有内置的 Prometheus 度量标准,该度量标准与基于 VTS 的度量标准不同.
GitLab 支持自动检测和监视 Kubernetes NGINX Ingress 控制器. 这是通过利用至0.15.x 中随附的 VTS Prometheus 度量标准导出程序来 .
Prometheus 集成必须处于活动状态.
对于其他部署,需要根据您的安装进行 :
- NGINX Ingress 应该标注为 Prometheus 监视.
- Prometheus 应该配置为监视带注释的容器.
NGINX Ingress is deployed into the gitlab-managed-apps
namespace, using the official Helm chart. NGINX Ingress will be .
通过设置以下内容,将 NGINX 配置为进行 Prometheus 监视:
- ,以导出 Prometheus 指标.
prometheus.io/scrape: "true"
,以启用自动发现.prometheus.io/port: "10254"
,以指定度量标准端口.
与 GitLab 部署的 Prometheus 服务结合使用时,将自动收集响应指标.
Manually setting up NGINX Ingress for Prometheus monitoring
接下来,需要对 Ingress 进行注释,以进行 Prometheus 监视. 需要添加两个新的注释:
管理这些设置取决于如何部署 NGINX Ingress. 如果您通过进行了部署,则可以使用controller.stats.enabled
以及所需的注释来启用指标. 或者,也可以直接在Kubernetes 仪表板中编辑 NGINX Ingress YAML.
为了隔离并仅显示给定环境的相关指标,GitLab 需要一种方法来检测关联了哪些标签. 为此,GitLab 将搜索带有适当标签的指标. 在这种情况下, upstream
标签的格式必须为 .
如果您使用来部署您的应用程序,则将自动使用此格式,并且无需您执行任何操作即可检测到指标.