【问题标题】:How to monitor a container running db2 image using Prometheus and also react app using Prometheus?如何使用 Prometheus 监控运行 db2 映像的容器并使用 Prometheus 对应用程序做出反应?
【发布时间】:2021-01-21 07:47:10
【问题描述】:

我必须使用 Prometheus 和 Graphana 为使用 React(front end)+ Node js + Db2(containerised) 构建的服务构建监控解决方案。我不知道从哪里开始,有人可以建议我学习的资源吗?谢谢。

【问题讨论】:

  • 您是否尝试过阅读 Prometheus 和 Grafana 的安装手册?
  • 是的,据我了解,我们需要在容器上安装客户端,这将为 prometheus 服务器提供指标,但我不想更改应用程序代码中的任何内容(因为这是由其他人编写的)

标签: kubernetes containers monitoring prometheus react-fullstack


【解决方案1】:

首先,您需要按照给出的说明在 Kubernetes 集群中安装 Prometheus 和 Grafana:

普罗米修斯:https://prometheus.io/docs/prometheus/latest/installation/

格拉法纳:https://grafana.com/docs/grafana/latest/installation/

接下来,您需要了解 Prometheus 是一个基于拉取的指标收集系统。它以给定的时间间隔从配置的目标(端点)检索指标并显示结果。

您可以通过执行以下步骤来设置工作监控系统:

  1. 为 Prometheus 配置您的应用程序代码,以便能够从 - 为此,您需要通过支持的Prometheus client libraries 之一向代码添加检测。
  2. 配置 Prometheus 以抓取服务公开的指标 - Prometheus 支持由 Prometheus Operator 引入的名为 ServiceMonitor 的 K8s 自定义资源,可用于配置 Prometheus 以抓取步骤 1 中定义的指标。
  3. 观察抓取的指标 - 接下来,您可以通过configuring Grafana support for Prometheus 在 Prometheus UI 或 Grafana UI 中观察定义的指标。

【讨论】:

    猜你喜欢
    • 2021-08-25
    • 2020-05-21
    • 1970-01-01
    • 1970-01-01
    • 2020-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-17
    相关资源
    最近更新 更多