Kafka mirrormaker jmxtrans配置文件格式

时间:2018-09-03 10:58:48

标签: apache-kafka jmx grafana jmxtrans

我使用jmxtrans监视kafka mirrormaker,但是我的json格式似乎有问题,无法显示数据

如何编写此json文件,谢谢

{
    "servers": [{
        "port": "5448",
        "host": "10.10.21.10",
        "queries": [{
                "obj": "kafka.consumer:type=ConsumerTopicMetrics,name=BytesInPerSec,topic=mirror_group-*",
                "attr": ["Count", "MeanRate", "OneMinuteRate"],
                "resultAlias": "mirror_group-*",
                "outputWriters": [{
                    "@class": "com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory",
                    "url": "http://10.10.21.10:8086",
                    "username": "root",
                    "password": "123",
                    "database": "jmxDB",
                    "tags": {
                        "application": "BytesInPerSec"
                    }
                }]
            },
            {
                "obj": "kafka.consumer:type=ConsumerTopicMetrics,name=MessagesInPerSec,topic=mirror_group-*",
                "attr": ["Count", "MeanRate", "OneMinuteRate"],
                "resultAlias": "mirror_group-*",
                "outputWriters": [{
                    "@class": "com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory",
                    "url": "http://10.10.21.10:8086",
                    "username": "root",
                    "password": "123",
                    "database": "jmxDB",
                    "tags": {
                        "application": "MessagesInPerSec"
                    }
                }]
            },
            {
                "obj": "kafka.producer:type=ProducerRequestMetrics,name=ProducerRequestRateAndTimeMs,topic=mirror_group-*",
                "attr": ["Count", "Max", "Min", "50thPercentile", "75thPercentile", "95thPercentile"],
                "resultAlias": "mirror_group-*",
                "outputWriters": [{
                    "@class": "com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory",
                    "url": "http://10.10.21.10:8086",
                    "username": "root",
                    "password": "123",
                    "database": "jmxDB",
                    "tags": {
                        "application": "ProducerRequestRateAndTimeMs"
                    }
                }]
            },
            {
                "obj": "kafka.producer:type=ProducerRequestMetrics,name=ProducerRequestSize,topic=mirror_group-*",
                "attr": ["Count", "Max", "Min", "50thPercentile", "75thPercentile", "95thPercentile"],
                "resultAlias": "mirror_group-*",
                "outputWriters": [{
                    "@class": "com.googlecode.jmxtrans.model.output.InfluxDbWriterFactory",
                    "url": "http://10.10.21.10:8086",
                    "username": "root",
                    "password": "123",
                    "database": "jmxDB",
                    "tags": {
                        "application": "ProducerRequestSize"
                    }
                }]
            }
        ]
    }]
}

This is the kafka mirrormaker data information seen on jconsole

我无法从grafana获取数据

0 个答案:

没有答案