Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

.vscode/
.classpath
.springBeans
.cache-main
Expand Down
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.SILENT:
version = 0.0.1
name = "chickling/kmanager"
container_name = "chickling-kmanager"
cid=$(shell docker ps -aqf name=$(container_name))
help:
echo "Commands: (kmanager version: $(version))"
echo " clean - remove java target folder"
echo " package - build maven package"
echo " run-java - run service with native java"
echo " run - run service with docker"
echo " build - build docker image"
echo " push - push docker image to docker hub"
echo " version - show version"
clean:
rm -rf target
package: clean
mvn package -X
run-java: package
java -jar target/ChicklingKmanager.jar
run: remove_container
docker run -it -p 8099:8099 --name $(container_name) $(name):$(version)
build: package
cp target/ChicklingKmanager.jar docker/ && docker build -t $(name):$(version) ./docker && rm -f docker/ChicklingKmanager.jar
push: build
docker push $(name):$(version)
test:
echo "Tests not yet implemented"
remove_container:
ifneq ($(cid), )
echo "removing $(container_name)"
docker rm $(container_name)
endif
version:
echo $(version)
74 changes: 28 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
# KMonitor
# KManager

Tool for monitor kafka customer consumer based information, include near realtime offset/lag monitor.

This project is based on [KafkaOffsetMonitor](https://github.com/quantifind/KafkaOffsetMonitor), include all the feature `KafkaOffsetMonitor` have and also have below changes:

- Meta-data from sqllite to elasticsearch, make the application more stable with large cluster and can persist more longer history data based on your elasticsearch cluster status.
- Lag montior
- More data representation will add later

## Contributors

- [Luva](https://github.com/Hulva) (major contributor)

## Screenshots

### 1. Cluster view

![Cluster](./doc/cluster.PNG)
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![GitHub release](https://img.shields.io/github/release/chickling/kmanager.svg)](https://github.com/chickling/kmanager/wiki/Downloads)

Tool for monitor kafka customer consumer based information, include near realtime offset/lag monitor.

### 2. Detail of consumer group

![Group details](./doc/group-details.PNG)
This project is based on [KafkaOffsetMonitor](https://github.com/quantifind/KafkaOffsetMonitor), include all the feature `KafkaOffsetMonitor` have and other features.

### 3. Detail of topic
### Data sources

![Topic detail](./doc/topic-details.PNG)
- Kafka `JMX` data, you'd better to open JMX on your kafka to know more on your cluster.
- Kafka `Zookeeper` daata

### 4. Alert task (Kafka Lag monitor)
### Features

![New Task](./doc/newTask.PNG)
The ability you can see through Chickling Kmanager:

### 5. Trend Chart
- Kafka cluster data metrics like bytesIn/bytesOut/MessageIn
- Broker level data
- Topic consumer status
- lag monitor
- and more...

![Offset history](./doc/offset-history.PNG)
## Screenshots
![](./doc/features0.png)
![](./doc/features1.png)
![](./doc/features2.png)

## Deployment

Expand All @@ -47,11 +39,11 @@ or download the official latest version jar file through `release` tab.

Then, you can use below command to run:

`java -jar ChicklingKmonitor.jar`
`java -jar ChicklingKManager.jar`

Or, give it a different port rather than default(8099):

`java -jar ChicklingKmonitor.jar --server.port=8080`
`java -jar ChicklingKManager.jar --server.port=8080`

Extra setting will be set within setting page:

Expand All @@ -61,24 +53,14 @@ Extra setting will be set within setting page:
### Run with Docker

```
TODO:
docker run -it -p 8099:8099 --name kmanager chickling/kmanager:0.0.1
```

## Add new feature with kafka offset monitor
- 用java语言开发
- DB的优化,把监控数据默认写入Elasticsearch,提高查询监控数据的响应时间和存储时间 ,<del>同时也提供对JDBC的实现,方便User快速Run起demo例子</del>
- 在Kafka offset monitor基础上加入对Kafka cluster的监控,当集群中有broker宕机时发Email给集群的管理员
- 加入对topic consumer在每个partition上消费延迟的监控,当消费在partition上的延迟达到给定的阀值值,发Email给相关的人员
- 提供docker部署方案

## TODO

- <del>修改offset 历史展示为可选的时间段和时间间隔</del> **done**
- broker 节点变动邮件通知(zk 节点监听)
- <del>添加专门的设置页面来初始化配置而不是使用配置文件。使用ES来存储配置、alerting task信息。</del> **done** (配置项不多,现采用文件存储)
- topic/group 列表提供筛选功能
- <del>Alerting task添加入口(在offset history页面已有添加alerting task入口)。Alerting task展示页面添加新的入口。</del> **done**
- 添加更多更详细的topic 的细节信息在Topic details 页面 (JMX 获取的数据?)

Then, you can start your journey through below address (use your real host):
```
http://localhost:8099
```

## Contributors

- [Luva](https://github.com/Hulva) (major contributor)
Binary file added doc/features0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/features1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/features2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5,156 changes: 5,156 additions & 0 deletions doc/mock/har.json

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions doc/mock/mock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
let http = require('http');
let port = 8099;
let har = require('./har.json');
let offsetData = require('./offset.json');
offsetData = JSON.stringify(offsetData);
let data = har.log.entries;

function removeQuerystring(url){
if(url.indexOf('?')>0){
url = url.substring(0, url.indexOf('?'));
}
return url;
}
http.createServer((req, res) => {
console.log(req.url);

res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS');
res.setHeader('Content-Type', 'application/json');

var reg = /\/group\/(\S+)\/(\S+)/g;

if(req.url.match(reg)){
return res.end(offsetData);
}

var item = data.find(item => {
reg = /\/group\/(\S+)/g;

if (req.url.match(reg)) {
if (item.request.url.match(reg)) {
return item;
}
}
reg = /\/stats\/topic\/(\S+)/g;
if (req.url.match(reg)) {
if (item.request.url.match(reg)) {
return item;
}
}
console.log(removeQuerystring(item.request.url) , removeQuerystring(`http://mockuphost${req.url}`))
if (removeQuerystring(item.request.url) == removeQuerystring(`http://mockuphost${req.url}`)) {
return item;
}
});
if (item) {
res.end(item.response.content.text);
}
res.end('{}');

}).listen(port, (err) => {
if (err) {
console.log(err);
}
console.log(`service is running at ${port}`);
});

data.forEach(item => {
if (item.request.url.indexOf('http://mockhost/') >= 0) {
console.log(item.request.method,
item.request.url
//,item.response.content.text
)
}
})

1 change: 1 addition & 0 deletions doc/mock/offset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ec_pf_r4":[{"timestamp":1503081000000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":47750,"lag":147},{"timestamp":1503082800000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":48042,"lag":163},{"timestamp":1503084600000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":45257,"lag":148},{"timestamp":1503086400000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":45848,"lag":151},{"timestamp":1503088200000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":45534,"lag":171},{"timestamp":1503090000000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":45376,"lag":116},{"timestamp":1503091800000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":44571,"lag":158},{"timestamp":1503093600000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":44490,"lag":139},{"timestamp":1503095400000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":43881,"lag":161},{"timestamp":1503097200000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":44175,"lag":152},{"timestamp":1503099000000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":41602,"lag":144},{"timestamp":1503100800000,"group":"ec_pf_newegg_com","topic":"ec_pf_r4","offset":33033,"lag":166}]}
1 change: 1 addition & 0 deletions doc/mock/trend.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"bytesout|e3kafka09":[[1503081000000,1492144809],[1503082800000,1520629325],[1503084600000,1464949943],[1503086400000,1458665767],[1503088200000,1442605147],[1503090000000,1439346142],[1503091800000,1414893861],[1503093600000,1399441727],[1503095400000,1429396367],[1503097200000,1402890227],[1503099000000,1408102354],[1503100800000,709497105]],"bytesout|e3kafka06":[[1503081000000,2806940162],[1503082800000,2635451531],[1503084600000,2627442183],[1503086400000,2687466304],[1503088200000,2615919966],[1503090000000,3142085325],[1503091800000,2718816382],[1503093600000,2619083671],[1503095400000,2540874478],[1503097200000,2936149949],[1503099000000,2200596062],[1503100800000,1201841606]],"bytesout|e3kafka05":[[1503081000000,3996788823],[1503082800000,3695626187],[1503084600000,3865168768],[1503086400000,3719770806],[1503088200000,3536860985],[1503090000000,4352575386],[1503091800000,3848787902],[1503093600000,3601027931],[1503095400000,3446228906],[1503097200000,4044427883],[1503099000000,3240944595],[1503100800000,1806989124]],"bytesin|e3kafka10":[[1503081000000,280240767],[1503082800000,279343274],[1503084600000,259908775],[1503086400000,272860349],[1503088200000,281999893],[1503090000000,281234341],[1503091800000,273484709],[1503093600000,275480332],[1503095400000,264435939],[1503097200000,254677595],[1503099000000,242707091],[1503100800000,123181192]],"bytesout|e3kafka08":[[1503081000000,2720510473],[1503082800000,2532325334],[1503084600000,2609587883],[1503086400000,2510009928],[1503088200000,2356735627],[1503090000000,2446819185],[1503091800000,2610621160],[1503093600000,2441782321],[1503095400000,2410938229],[1503097200000,2372891454],[1503099000000,2170448263],[1503100800000,1211601491]],"bytesout|e3kafka07":[[1503081000000,2992722744],[1503082800000,2834696726],[1503084600000,2812449603],[1503086400000,2816209713],[1503088200000,2763509060],[1503090000000,3269225721],[1503091800000,2889319279],[1503093600000,2760053376],[1503095400000,2670860341],[1503097200000,3145517347],[1503099000000,2325218368],[1503100800000,1283040021]],"bytesout|e3kafka02":[[1503081000000,3145803124],[1503082800000,3004904742],[1503084600000,2957022244],[1503086400000,3000980932],[1503088200000,2989379139],[1503090000000,3481916581],[1503091800000,3118230098],[1503093600000,3013193175],[1503095400000,2847277380],[1503097200000,3198468591],[1503099000000,2467709623],[1503100800000,1359221071]],"bytesout|e3kafka01":[[1503081000000,3353385217],[1503082800000,3202264441],[1503084600000,3081539738],[1503086400000,3181464806],[1503088200000,3193247960],[1503090000000,3849389214],[1503091800000,3239062076],[1503093600000,3126571567],[1503095400000,2987334665],[1503097200000,3562215476],[1503099000000,2525615417],[1503100800000,1378631814]],"messagesin|e3kafka10":[[1503081000000,67663],[1503082800000,62354],[1503084600000,55769],[1503086400000,56066],[1503088200000,71338],[1503090000000,57068],[1503091800000,68807],[1503093600000,56950],[1503095400000,58943],[1503097200000,54281],[1503099000000,47619],[1503100800000,27891]],"bytesout|e3kafka04":[[1503081000000,4815114248],[1503082800000,4435498631],[1503084600000,4462595278],[1503086400000,4493172776],[1503088200000,4364380770],[1503090000000,4961185299],[1503091800000,4751065935],[1503093600000,4462413257],[1503095400000,4200573558],[1503097200000,4591310514],[1503099000000,3560713075],[1503100800000,1992417567]],"bytesout|e3kafka03":[[1503081000000,2989967474],[1503082800000,2838091296],[1503084600000,2823461674],[1503086400000,2815136104],[1503088200000,2734212559],[1503090000000,3268661888],[1503091800000,2898349048],[1503093600000,2746762916],[1503095400000,2674706665],[1503097200000,3140991054],[1503099000000,2361414338],[1503100800000,1282816960]],"bytesout|e3kafka10":[[1503081000000,1751063459],[1503082800000,1742539316],[1503084600000,1635563136],[1503086400000,1688314413],[1503088200000,1740290029],[1503090000000,2116988655],[1503091800000,1700094799],[1503093600000,1700839835],[1503095400000,1650447433],[1503097200000,1769486340],[1503099000000,1511023217],[1503100800000,775141392]],"messagesin|mercury.corp":[[1503081000000,467983],[1503082800000,399466],[1503084600000,405043],[1503086400000,434242],[1503088200000,366341],[1503090000000,383212],[1503091800000,424696],[1503093600000,408681],[1503095400000,362509],[1503097200000,370669],[1503099000000,299205],[1503100800000,175950]],"bytesin|mercury.corp":[[1503081000000,736903046],[1503082800000,676343604],[1503084600000,667558780],[1503086400000,685633464],[1503088200000,686842148],[1503090000000,680362607],[1503091800000,728136211],[1503093600000,678245915],[1503095400000,635670639],[1503097200000,617039163],[1503099000000,529071511],[1503100800000,292981289]],"bytesin|e3kafka01":[[1503081000000,551669457],[1503082800000,525472823],[1503084600000,495773775],[1503086400000,519462295],[1503088200000,533587314],[1503090000000,509629656],[1503091800000,527887404],[1503093600000,510034658],[1503095400000,481849700],[1503097200000,488191534],[1503099000000,399350336],[1503100800000,216010080]],"bytesin|e3kafka03":[[1503081000000,471369280],[1503082800000,445798707],[1503084600000,441192895],[1503086400000,440849946],[1503088200000,433081407],[1503090000000,433861012],[1503091800000,455103746],[1503093600000,429823916],[1503095400000,417636268],[1503097200000,415719220],[1503099000000,374097921],[1503100800000,197474956]],"messagesin|e3kafka02":[[1503081000000,271638],[1503082800000,236562],[1503084600000,235278],[1503086400000,261208],[1503088200000,253689],[1503090000000,226212],[1503091800000,267473],[1503093600000,238960],[1503095400000,213693],[1503097200000,223148],[1503099000000,202852],[1503100800000,103456]],"bytesin|e3kafka02":[[1503081000000,501739293],[1503082800000,477525899],[1503084600000,464548923],[1503086400000,477674933],[1503088200000,489553817],[1503090000000,482311445],[1503091800000,503856798],[1503093600000,486464842],[1503095400000,458276704],[1503097200000,437058624],[1503099000000,388679271],[1503100800000,212502162]],"messagesin|e3kafka01":[[1503081000000,282405],[1503082800000,255311],[1503084600000,237515],[1503086400000,247314],[1503088200000,241170],[1503090000000,233296],[1503091800000,268801],[1503093600000,251002],[1503095400000,217937],[1503097200000,225989],[1503099000000,180614],[1503100800000,103906]],"bytesin|e3kafka05":[[1503081000000,673396399],[1503082800000,615387194],[1503084600000,646074907],[1503086400000,618285918],[1503088200000,594888237],[1503090000000,571572439],[1503091800000,637020966],[1503093600000,584904588],[1503095400000,562181822],[1503097200000,575914138],[1503099000000,566870870],[1503100800000,309598833]],"messagesin|e3kafka04":[[1503081000000,467983],[1503082800000,399466],[1503084600000,405043],[1503086400000,434242],[1503088200000,366341],[1503090000000,383212],[1503091800000,424696],[1503093600000,408681],[1503095400000,362509],[1503097200000,370669],[1503099000000,299205],[1503100800000,175950]],"bytesin|e3kafka04":[[1503081000000,736903046],[1503082800000,676343604],[1503084600000,667558780],[1503086400000,685633464],[1503088200000,686842148],[1503090000000,680362607],[1503091800000,728136211],[1503093600000,678245915],[1503095400000,635670639],[1503097200000,617039163],[1503099000000,529071511],[1503100800000,292981289]],"messagesin|e3kafka03":[[1503081000000,257665],[1503082800000,224136],[1503084600000,221864],[1503086400000,224235],[1503088200000,197762],[1503090000000,210758],[1503091800000,231321],[1503093600000,221984],[1503095400000,205451],[1503097200000,210004],[1503099000000,262276],[1503100800000,104674]],"bytesin|e3kafka07":[[1503081000000,470977525],[1503082800000,445371702],[1503084600000,438461121],[1503086400000,439007115],[1503088200000,442466836],[1503090000000,434335484],[1503091800000,458141926],[1503093600000,431049655],[1503095400000,415282103],[1503097200000,418112511],[1503099000000,357328457],[1503100800000,196434673]],"messagesin|e3kafka06":[[1503081000000,248863],[1503082800000,217352],[1503084600000,233322],[1503086400000,217472],[1503088200000,218968],[1503090000000,204458],[1503091800000,226204],[1503093600000,214429],[1503095400000,193491],[1503097200000,202093],[1503099000000,164023],[1503100800000,95684]],"bytesin|e3kafka06":[[1503081000000,471155267],[1503082800000,435421521],[1503084600000,436231837],[1503086400000,443053929],[1503088200000,437542216],[1503090000000,448895485],[1503091800000,456357013],[1503093600000,439175523],[1503095400000,421183422],[1503097200000,402452649],[1503099000000,360309357],[1503100800000,196765320]],"messagesin|e3kafka05":[[1503081000000,410511],[1503082800000,344756],[1503084600000,378077],[1503086400000,373902],[1503088200000,301943],[1503090000000,330350],[1503091800000,382415],[1503093600000,350472],[1503095400000,320855],[1503097200000,316623],[1503099000000,270147],[1503100800000,160922]],"bytesin|e3kafka09":[[1503081000000,236129711],[1503082800000,242175611],[1503084600000,234333415],[1503086400000,236486634],[1503088200000,228191161],[1503090000000,227629516],[1503091800000,224391470],[1503093600000,222609607],[1503095400000,226482349],[1503097200000,221374087],[1503099000000,245340761],[1503100800000,114507552]],"messagesin|e3kafka08":[[1503081000000,220917],[1503082800000,186411],[1503084600000,211401],[1503086400000,182433],[1503088200000,172614],[1503090000000,177456],[1503091800000,199398],[1503093600000,183989],[1503095400000,170543],[1503097200000,167520],[1503099000000,146542],[1503100800000,87961]],"bytesin|e3kafka08":[[1503081000000,405352426],[1503082800000,370623821],[1503084600000,380495624],[1503086400000,365520313],[1503088200000,349183900],[1503090000000,360294869],[1503091800000,383891839],[1503093600000,354587294],[1503095400000,350890741],[1503097200000,348702625],[1503099000000,318794263],[1503100800000,174227627]],"messagesin|e3kafka07":[[1503081000000,253086],[1503082800000,225340],[1503084600000,216680],[1503086400000,218555],[1503088200000,240224],[1503090000000,209420],[1503091800000,262731],[1503093600000,218303],[1503095400000,196553],[1503097200000,204024],[1503099000000,179878],[1503100800000,95662]],"messagesin|e3kafka09":[[1503081000000,57310],[1503082800000,51558],[1503084600000,60014],[1503086400000,72586],[1503088200000,44229],[1503090000000,49423],[1503091800000,46373],[1503093600000,55356],[1503095400000,54823],[1503097200000,46026],[1503099000000,253016],[1503100800000,22605]],"bytesout|mercury.corp":[[1503081000000,4815114248],[1503082800000,4435498631],[1503084600000,4462595278],[1503086400000,4493172776],[1503088200000,4364380770],[1503090000000,4961185299],[1503091800000,4751065935],[1503093600000,4462413257],[1503095400000,4200573558],[1503097200000,4591310514],[1503099000000,3560713075],[1503100800000,1992417567]]}
Empty file added doc/mock/xhr
Empty file.
Binary file modified doc/setting.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading