Red Hat Camel K is deprecated
Red Hat Camel K is deprecated and the End of Life date for this product is June 30, 2025. For help migrating to the current go-to solution, Red Hat build of Apache Camel, see the Migration Guide.2.2. 配置 Camel K 集成指标
您可以在运行时使用 Camel K Prometheus trait 自动配置 Camel K 集成的监控。这会自动配置依赖项和集成 Pod,以公开指标端点,然后由 Prometheus 发现并显示。Camel Quarkus MicroProfile Metrics 扩展 以 OpenMetrics 格式自动收集并公开默认的 Camel K 指标。
先决条件
- 您必须在 OpenShift 中启用对您自己的服务的监控。请参阅在 OpenShift 中启用用户工作负载监控。
流程
输入以下命令运行启用了 Prometheus 特征的 Camel K 集成:
kamel run myIntegration.java -t prometheus.enabled=true
另外,您可以通过更新集成平台来全局启用 Prometheus 特征,如下所示:
$ oc patch ip camel-k --type=merge -p '{"spec":{"traits":{"prometheus":{"configuration":{"enabled":true}}}}}'
- 查看 Prometheus 中 Camel K 集成指标的监控。例如,对于嵌入式 Prometheus,在 OpenShift 管理员或开发人员 Web 控制台中选择 Monitoring > Metrics。
-
输入您要查看的 Camel K 指标。例如,在 Administrator 控制台中,在 Insert Metric at Cursor 下,输入
application_camel_context_uptime_seconds
,然后单击 Run Queries。 - 点 Add Query 查看其他指标。