第 2 章 监控 Camel K 集成
Red Hat Integration - Camel K 监控基于 OpenShift 监控系统。本章解释了如何使用可用选项来监控 Red Hat Integration - Camel K 集成。您可以使用已部署为 OpenShift Monitoring 一部分的 Prometheus Operator 来监控您自己的应用程序。
2.1. 在 OpenShift 中启用用户工作负载监控
OpenShift 4.3 或更高版本包括已作为 OpenShift Monitoring 的一部分部署的嵌入式 Prometheus Operator。本节介绍如何在 OpenShift Monitoring 中启用对您自己的应用程序服务的监控。这个选项避免了安装和管理独立 Prometheus 实例的额外开销。
先决条件
- 您必须具有安装 Camel K Operator 的 OpenShift 集群的集群管理员访问权限。请参阅安装 Camel K。
流程
输入以下命令检查
openshift-monitoring 项目
中是否存在cluster-monitoring-config
ConfigMap 对象:$ oc -n openshift-monitoring get configmap cluster-monitoring-config
如果不存在,请创建
cluster-monitoring-config
ConfigMap:$ oc -n openshift-monitoring create configmap cluster-monitoring-config
编辑
cluster-monitoring-config
ConfigMap:$ oc -n openshift-monitoring edit configmap cluster-monitoring-config
在
data:config.yaml:
下,将enableUserWorkload
设置为true
:apiVersion: v1 kind: ConfigMap metadata: name: cluster-monitoring-config namespace: openshift-monitoring data: config.yaml: | enableUserWorkload: true
其他资源