kafka-offset-mon

command module
v0.0.0-...-eb252b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2015 License: MIT Imports: 15 Imported by: 0

README

kafka-offset-mon

Build Status

配置

{
    "http_server": {
        "listenAddr": ":8098",
        "patternLatestOffset": "/latest_offset",
        "patternConsumerGroupOffset": "/consumer_group_offset",
        "patternConsumerGroupDistance": "/consumer_group_distance"
    },
    "influxdbSyncers": [
        {
            "zookeeper": "127.0.0.1:2181",
            "influxdbHost": "http://127.0.0.1:8086",
            "influxdbUser": "root",
            "influxdbPassword": "root",
            "influxdbDb": "kafka_monitor",
            "influxdbRetentionPolicy": "default",
            "influxdbMeasurementLatestOffset": "latest_offset",
            "influxdbMeasurementConsumerGroupOffset": "consumer_group_offset",
            "influxdbMeasurementConsumerGroupDistance": "consumer_group_distance",
			"interval":"5s"
        }
    ]
}

kafka-offset-mon支持两类数据接口:

  • http服务,用http_server配置,其中listenAddr指定了http服务监听的端口,其余pattern*配置,指定了对应类型的数据的获取uri。
  • influxdb同步,其中zookeeper指定了kafka数据来源的zk地址(支持后跟chroot path的模式)。influxdb*配置了influxdb的相关选项。

使用

概念

目前kafka-offset-mon支持三个概念:

  • latest_offset,指某个topic的各partition的最近提交的message的offset
  • consumer_group_offset,指某个topic的各个consumer_group目前的消费的offset
  • consumer_group_distance,指某个topic的各个consumer_group目前的消费的offset和latest的差(consumer_group_offset-latest_offset)
http服务

如上配置,可通过http://localhost:8098/latest_offset来访问,返回一段json数据。

zabbix脚本

为了方便给zabbix导出数据,使用了/scripts/kafka-zabbix.php

其从http服务读取数据,并组织为log文件,使用zabbix来抓取

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
+build go1.3
_workspace/src/github.com/boltdb/bolt
Package bolt implements a low-level key/value store in pure Go.
Package bolt implements a low-level key/value store in pure Go.
_workspace/src/github.com/eapache/go-resiliency/breaker
Package breaker implements the circuit-breaker resiliency pattern for Go.
Package breaker implements the circuit-breaker resiliency pattern for Go.
_workspace/src/github.com/eapache/queue
Package queue provides a fast, ring-buffer queue based on the version suggested by Dariusz Górecki.
Package queue provides a fast, ring-buffer queue based on the version suggested by Dariusz Górecki.
_workspace/src/github.com/gogo/protobuf/proto
Package proto converts data structures to and from the wire format of protocol buffers.
Package proto converts data structures to and from the wire format of protocol buffers.
_workspace/src/github.com/gogo/protobuf/proto/proto3_proto
Package proto3_proto is a generated protocol buffer package.
Package proto3_proto is a generated protocol buffer package.
_workspace/src/github.com/golang/snappy
Package snappy implements the snappy block-based compression format.
Package snappy implements the snappy block-based compression format.
_workspace/src/github.com/hashicorp/go-msgpack/codec
High Performance, Feature-Rich Idiomatic Go encoding library for msgpack and binc .
High Performance, Feature-Rich Idiomatic Go encoding library for msgpack and binc .
_workspace/src/github.com/influxdb/influxdb/influxql
Package influxql implements a parser for the InfluxDB query language.
Package influxql implements a parser for the InfluxDB query language.
_workspace/src/github.com/influxdb/influxdb/meta/internal
Package internal is a generated protocol buffer package.
Package internal is a generated protocol buffer package.
_workspace/src/github.com/influxdb/influxdb/tsdb
Package tsdb implements a durable time series database.
Package tsdb implements a durable time series database.
_workspace/src/github.com/influxdb/influxdb/tsdb/internal
Package internal is a generated protocol buffer package.
Package internal is a generated protocol buffer package.
_workspace/src/github.com/samuel/go-zookeeper/zk
Package zk is a native Go client library for the ZooKeeper orchestration service.
Package zk is a native Go client library for the ZooKeeper orchestration service.
_workspace/src/golang.org/x/crypto/bcrypt
Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing algorithm.
Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing algorithm.
_workspace/src/golang.org/x/crypto/blowfish
Package blowfish implements Bruce Schneier's Blowfish encryption algorithm.
Package blowfish implements Bruce Schneier's Blowfish encryption algorithm.
_workspace/src/gopkg.in/Shopify/sarama.v1
Package sarama provides client libraries for the Kafka 0.8 protocol.
Package sarama provides client libraries for the Kafka 0.8 protocol.
_workspace/src/gopkg.in/Shopify/sarama.v1/mocks
Package mocks provides mocks that can be used for testing applications that use Sarama.
Package mocks provides mocks that can be used for testing applications that use Sarama.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL