第 2 章 配置可观察性指标
连接链接提供的仪表板和警报使用连接链接和网关 API 组件导出的指标,以深入了解应用程序、API 和网关。虽然并不重要,但最好配置这些指标并在 OpenShift 集群上设置这些仪表板和警报。
用于观察连接功能的示例仪表板和警报使用 OpenShift 中用户监控堆栈中提供的低级别 CPU 指标和网络指标,以及来自 Gateway API 和连接链接资源的资源状态指标。
本节提供了 OpenShift 文档的链接,有关如何配置监控和指标存储,并演示了如何配置资源以提取相关指标。
您必须在您要使用连接链接的每个 OpenShift 集群上执行这些步骤。
先决条件
- 您已安装了连接链接,如在 OpenShift 上安装连接链接 中所述。
- 您已为用户定义的项目设置了监控,如 OpenShift 监控文档 中所述。
流程
在 OpenShift 中启用了对用户项目的监控,这允许从网关和连接链接组件中提取指标。要在 OpenShift 中提取额外指标,您可以安装
kube-state-metrics实例,其中包含自定义资源配置,如下所示:kubectl apply -f https://raw.githubusercontent.com/Kuadrant/kuadrant-operator/v1.0.1/config/observability/openshift/kube-state-metrics.yaml kubectl apply -k https://github.com/Kuadrant/gateway-api-state-metrics/config/kuadrant?ref=0.6.0
kubectl apply -f https://raw.githubusercontent.com/Kuadrant/kuadrant-operator/v1.0.1/config/observability/openshift/kube-state-metrics.yaml kubectl apply -k https://github.com/Kuadrant/gateway-api-state-metrics/config/kuadrant?ref=0.6.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow 一些示例仪表板根据请求路径聚合数据。默认情况下,OpenShift Service Mesh 指标不包括请求路径的标签,但您可以启用这些标签,如下所示:
kubectl apply -f https://raw.githubusercontent.com/Kuadrant/kuadrant-operator/v1.0.1/config/observability/openshift/telemetry.yaml
kubectl apply -f https://raw.githubusercontent.com/Kuadrant/kuadrant-operator/v1.0.1/config/observability/openshift/telemetry.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow 注意这可能会导致生成多个时间序列的高卡性标签,这可能会影响性能和资源使用量。如需了解更多详细信息,请参阅 卡in ality 上的可靠 Insights 博客文章。
您可以从各种连接链接 Operator 配置指标提取,如下所示:
kubectl apply -f https://raw.githubusercontent.com/Kuadrant/kuadrant-operator/v1.0.1/config/observability/prometheus/monitors/operators.yaml
kubectl apply -f https://raw.githubusercontent.com/Kuadrant/kuadrant-operator/v1.0.1/config/observability/prometheus/monitors/operators.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow 注意您必须应用额外的配置,以便提取所有相关指标。但是,此配置取决于您以后如何部署网关。有关所需步骤的详情,请参阅使用连接链接 配置和部署网关策略。
其他资源
- 有关如何在 OpenShift Service Mesh 中启用指标的详情,请参阅 OpenShift Service Mesh 指标文档。
- 有关连接链接组件指标的详情,请查看 Kuadrant 指标文档。