0

我用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"
                    }
                }]
            }
        ]
    }]
}

这是在jconsole上看到的kafka mirrormaker数据信息

我无法从 grafana 获取数据

4

0 回答 0