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 指标扩展 自动收集并公开 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 控制台中,在 Cursor 的 Insert Metric at Cursor 下输入
application_camel_context_uptime_seconds
,然后单击 Run Queries。 - 点 Add Query 查看其他指标。