【问题标题】:How to send JVM metrics of Spark to Prometheus in Kubernetes如何将 Spark 的 JVM 指标发送到 Kubernetes 中的 Prometheus
【发布时间】:2020-06-16 21:37:31
【问题描述】:

我正在使用 Spark 运算符在 Kubernetes 上运行 Spark。 (https://github.com/GoogleCloudPlatform/spark-on-k8s-operator)

我正在尝试在 Spark 驱动程序和执行程序 pod 中运行 Java 代理,并通过 Kubernetes 服务将指标发送给 Prometheus 操作员。

我正在使用这个例子 https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/master/examples/spark-pi-prometheus.yaml

Java 代理会在短时间内公开端口 8090 上的指标(我可以使用端口转发 kubctl port-forward 8090:8090 来验证),该服务也公开了几分钟的指标(可以通过端口转发 kubctl port-forward svc/ 8090:8090 验证)。

Promethues 能够在 prometheus 中注册这些 pod 的 URL,但是当它试图抓取指标时(每 30 秒运行一次),pod 的 URL 已关闭。

如何使 Java 代理 JMX 导出器长时间运行,直到驱动程序和执行程序完成工作。你能在这里指导或帮助我吗,以前谁遇到过这种情况?

【问题讨论】:

    标签: apache-spark kubernetes prometheus spark-operator


    【解决方案1】:

    Prometheus 需要每 5 秒抓取一次指标(可能指标可能不准确),或者您需要使用 pushgateway,如本博客中提到的 (https://banzaicloud.com/blog/spark-monitoring/) 将指标推送到 Prometheus

    推送指标 Prometheus,是批处理作业的最佳实践。 Prometheus提取指标是长时间运行的服务(例如:REST 服务)的最佳方法

    【讨论】:

      猜你喜欢
      • 2022-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多