【问题标题】:Kafka metrics with Statsd on DCOSDCOS 上使用 Statsd 的 Kafka 指标
【发布时间】:2018-01-27 11:08:45
【问题描述】:

我使用该框架在 DC/OS 集群中安装了 Kafka。

我想获取一些指标来监控它,我看到有这样的配置:

"TASKCFG_ALL_KAFKA_METRICS_REPORTERS": "com.airbnb.kafka.kafka08.StatsdMetricsReporter",

我查看了代码,发现 server.properties.mustache 中有一些配置参数:

external.kafka.statsd.port={{STATSD_UDP_PORT}}
external.kafka.statsd.host={{STATSD_UDP_HOST}}
external.kafka.statsd.reporter.enabled=true

然后我查看了其中一个代理正在运行的节点,并且配置具有以下值:

external.kafka.statsd.port=57925
external.kafka.statsd.host=198.51.100.1
external.kafka.statsd.reporter.enabled=true
external.kafka.statsd.tag.enabled=true

在这个节点中,在那个端口,有一个进程在监听它的名字中的mesos-agent。

如何查看 Kafka 代理报告的指标?

【问题讨论】:

    标签: apache-kafka dcos statsd


    【解决方案1】:

    目前无法使用 dcos kafka 配置文件或环境变量(DCOS 使用 Kafka-Mesos 框架)打开 JMX 端口并监控集群产生的 kafka 指标 如此处所述:Enable JMX on Kafka Brokers。 (dcos v1.12 的变更请求)

    但是 DC/OS 提供 REST-API 用于接收集群、主机、容器和应用程序特定指标: 例如v 1.9(我目前使用的那个) https://docs.mesosphere.com/1.9/metrics/metrics-api/#/

    示例

    如果您知道 agent_id(您的代理正在运行的 dcos 节点) 例如您的 agent_id 是“ed14928-04d1-4f7e-b544-0a3e9d58645b-S9” 那么:

    1. https:///system/v1/agent/2ed14928-04d1-4f7e-b544-0a3e9d58645b-S9/metrics/v0/containers -> 查看哪些容器在该代理上运行并找到负责您的 kafka 的容器-经纪人。例如"a8b0d630-c55a-4e1c-a456-69e9a3ad1c16"
    2. https:///system/v1/agent/2ed14928-04d1-4f7e-b544-0a3e9d58645b-S9/metrics/v0/containers/a8b0d630-c55a-4e1c-a456-69e9a3ad1c16/app -> 查看kafka-metrics

      {"name":"kafka.server.BrokerTopicMetrics.BytesOutPerSec.1MinuteRate","value":0,"unit":"","timestamp":"2018-01-29T15:33:10Z","标签":{"topic":"XXXX"}},{"name":"kafka.log.Log.NumLogSegments","value":2,"unit":"","timestamp":"2018-01 -29T15:32:39Z","tags":{"partition":"1","topic":"XXXXX"}},{"name":"kafka.network.RequestMetrics.ThrottleTimeMs.p98","value ":0,"单位":"","时间戳":" ... ....

    如果你不知道agent_id,你必须检查所有从属(代理) https:///mesos/master/slaves 例如{slaves...."id":"2ed14928-04d1-4f7e-b544-0a3e9d58645b-S13" ...} 并安装正确的。 或者,如果您有代理节点的 IP 地址,则可以使用 dcos cli(您必须先登录!)

    $ dcos node
    

    找出代理ID。

    【讨论】:

      【解决方案2】:

      Dcos 提供了 cli 来获取节点和应用程序(任务)的指标。 此 cli 使用 Valentin 上面指定的 dcos 指标 API。

      $ dcos task metrics details <task-id> [--json]
      metrics details
          Print a table of all metrics for the task specified by <task-id>
      
      $ dcos task metrics summary <task-id> [--json]   
      metrics summary
          Print a table of key metrics for the task specified by <task-id>
      
      <task-id>
          A full task ID, a partial task ID, or a regular expression.
      --json
          Print JSON-formatted list of tasks.
      
      $ dcos node metrics details <mesos-id> [--json]
      metrics details
          Print a table of all metrics for the agent node specified by <mesos-id>.
      
      $ dcos node metrics summary <mesos-id> [--json]
      metrics summary
          Print CPU, memory and disk metrics for the agent node specified by
          <mesos-id>.
      
      --mesos-id=<mesos-id>
          The agent ID of a node.
      --json
          Print JSON-formatted list of nodes.
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2017-11-09
        • 2016-07-11
        • 1970-01-01
        • 1970-01-01
        • 2019-08-11
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多