跳到主要内容
版本: 最新版本-3.5

使用 Datadog 监控

本主题介绍如何将您的 StarRocks 集群与 Datadog(一个监控和安全平台)集成。

前提条件

在开始之前,您必须在您的实例上安装以下软件

注意

首次安装 Datadog Agent 时,Python 也会作为依赖项安装。我们建议您在以下步骤中使用此 Python。

准备 StarRocks 源代码

由于 Datadog 尚未提供 StarRocks 的集成工具包,因此您需要使用源代码集成它们。

  1. 启动终端,导航到您具有读写权限的本地目录,然后运行以下命令来创建一个专门用于 StarRocks 源代码的目录。

    mkdir -p starrocks
  2. 使用以下命令或在 GitHub 上下载 StarRocks 源代码包到您创建的目录。

    cd starrocks
    # Replace <starrocks_ver> with the actual version of StarRocks, for example, "2.5.2".
    wget https://github.com/StarRocks/starrocks/archive/refs/tags/<starrocks_ver>.tar.gz
  3. 解压包中的文件。

    # Replace <starrocks_ver> with the actual version of StarRocks, for example, "2.5.2".
    tar -xzvf <starrocks_ver>.tar.gz --strip-components 1

安装和配置 FE 集成工具包

  1. 使用源代码安装 FE 的 Datadog 集成工具包。

    /opt/datadog-agent/embedded/bin/pip install contrib/datadog-connector/starrocks_fe
  2. 创建 FE 集成配置文件 /etc/datadog-agent/conf.d/starrocks_fe.d/conf.yaml

    sudo mkdir -p /etc/datadog-agent/conf.d/starrocks_fe.d
    sudo cp contrib/datadog-connector/starrocks_fe/datadog_checks/starrocks_fe/data/conf.yaml.example /etc/datadog-agent/conf.d/starrocks_fe.d/conf.yaml
  3. 修改 FE 集成配置文件 /etc/datadog-agent/conf.d/starrocks_fe.d/conf.yaml

    一些重要配置项的示例

    配置示例描述
    fe_metric_urlhttps://:8030/metrics用于访问 StarRocks FE 指标的 URL。
    metrics- starrocks_fe_*要在 FE 上监控的指标。您可以使用通配符 * 来匹配配置项。

安装和配置 BE 集成工具包

  1. 使用源代码安装 BE 的 Datadog 集成工具包。

    /opt/datadog-agent/embedded/bin/pip install contrib/datadog-connector/starrocks_be
  2. 创建 BE 集成配置文件 /etc/datadog-agent/conf.d/starrocks_be.d/conf.yaml

    sudo mkdir -p /etc/datadog-agent/conf.d/starrocks_be.d
    sudo cp contrib/datadog-connector/starrocks_be/datadog_checks/starrocks_be/data/conf.yaml.example /etc/datadog-agent/conf.d/starrocks_be.d/conf.yaml
  3. 修改 BE 集成配置文件 /etc/datadog-agent/conf.d/starrocks_be.d/conf.yaml

    一些重要配置项的示例

    配置示例描述
    be_metric_urlhttps://:8040/metrics用于访问 StarRocks BE 指标的 URL。
    metrics- starrocks_be_*要在 BE 上监控的指标。您可以使用通配符 * 来匹配配置项。

重启 Datadog Agent

重启 Datadog Agent 以使配置生效。

sudo systemctl stop datadog-agent
sudo systemctl start datadog-agent

验证集成

有关验证集成的说明,请参阅 Datadog Application

卸载集成工具包

当您不再需要集成工具包时,您可以卸载它们。

  • 要卸载 FE 集成工具包,请运行以下命令

    /opt/datadog-agent/embedded/bin/pip uninstall datadog-starrocks-fe
  • 要卸载 BE 集成工具包,请运行以下命令

    /opt/datadog-agent/embedded/bin/pip uninstall datadog-starrocks-be