Kafka度量与dcos上的statsd

kqqjbcuj  于 2021-06-07  发布在  Kafka
关注(0)|答案(2)|浏览(432)

我使用该框架在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代理。
如何查看Kafka经纪人报告的指标?

w8biq8rn

w8biq8rn1#

使用dcos kafka配置文件或环境变量(dcos使用kafka mesos框架)当前无法打开jmx端口并监视集群生成的kafka度量,如下所述:在kafka代理上启用jmx(dcos的更改请求(v1.12)
然而,dc/os提供了一个restapi来接收集群、主机、容器和应用程序特定的度量:例如v1.9(我目前正在使用的)https://docs.mesosphere.com/1.9/metrics/metrics-api/#/
例子
如果您知道代理id(运行代理的dcos节点),例如,您的代理id为“ed14928-04d1-4f7e-b544-0a3e9d58645b-s9”,则:
https:///system/v1/agent/2ed14928-04d1-4f7e-b544-0a3e9d58645b-s9/metrics/v0/containers->查看在该代理上运行的容器,并找到负责kafka代理的容器。e、 g.“a8b0d630-c55a-4e1c-a456-69e9a3ad1c16”
https:///system/v1/agent/2ed14928-04d1-4f7e-b544-0a3e9d58645b-s9/metrics/v0/containers/a8b0d630-c55a-4e1c-a456-69e9a3ad16/app->查看Kafka指标
{“name”:“kafka.server.brokertopicmetrics.bytesouptersec.1minute”,“value”:0,“unit”:“,”timestamp”:“2018-01-29t15:33:10z”,“tags”:{“topic”:“x”},{“name”:“kafka.log.log.numlogsegments”,“value”:2,“unit”:“,”timestamp”:“2018-01-29t15:32:39z,“tags”:{“partition”:“1”,“topic”:“xx”},{“name”:“kafka.network.requestmetrics.throttleTimes.p98”,“值”:0,“单位:”,“时间戳”:“。。。。
如果您不知道代理id,则必须检查所有从属(代理)https:///mesos/master/slaves例如{slaves….“id”:“2ed14928-04d1-4f7e-b544-0a3e9d58645b-s13”…}并匹配正确的代理。或者,如果您有代理节点的ip地址,则可以使用dcos cli(必须先登录!)

$ dcos node

去查探员的身份证。

kgqe7b3p

kgqe7b3p2#

dcos提供了cli来获取节点和应用程序(任务)的度量。此cli使用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.

相关问题