Skip to content

Commit

Permalink
Merge pull request #178 from citahub/release/v0.6.0
Browse files Browse the repository at this point in the history
Release v0.6.0
  • Loading branch information
rainchen authored Feb 19, 2021
2 parents 9229d26 + 0f76f46 commit 8dfbb03
Show file tree
Hide file tree
Showing 18 changed files with 159 additions and 35 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ server/grafana_data/
server/prometheus_data/
.vscode/
.build-version
test/dummy/*
test/dummy/*
.env
grafana.db

12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "agent/rabbitmq_exporter/rabbitmq_exporter.git"]
path = agent/rabbitmq_exporter/rabbitmq_exporter.git
url = https://github.com/kbudde/rabbitmq_exporter.git
branch = v1.0.0-RC4
[submodule "agent/cita_exporter/cita-cli.git"]
path = agent/cita_exporter/cita-cli.git
url = https://github.com/citahub/cita-cli.git
branch = master
[submodule "agent/process_exporter/process-exporter.git"]
path = agent/process_exporter/process-exporter.git
url = https://github.com/ncabatoff/process-exporter.git
branch = master
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [v0.5.0](https://github.com/citahub/cita-monitor/releases/tag/v0.5.0) ([compare](https://github.com/citahub/cita-monitor/compare/v0.4.1...v0.5.0))
## [v0.6.0](https://github.com/citahub/cita-monitor/releases/tag/v0.6.0) ([compare](https://github.com/citahub/cita-monitor/compare/v0.5.0...v0.6.0))

### Changed
- Replace wget with curl to support socks5 protocol ([f1bd6d7](https://github.com/citahub/cita-monitor/commit/f1bd6d719e4af3511ea3d909725cd3c4f040c2d7) by wangpengfei).
- Update agent images to support arm64/amd64 ([5f5e812](https://github.com/citahub/cita-monitor/commit/5f5e8121cab1e97924af819ac0c12c0987383fb6) by wangpengfei).
- Upgrade images to support arm/arm64 ([8f33dcc](https://github.com/citahub/cita-monitor/commit/8f33dcc6633ee03b41d0413a2bfc59c060a779cf) by wangpengfei).
- Upgrade server images to support arm/arm64 ([0f10502](https://github.com/citahub/cita-monitor/commit/0f105025a5099467e827d1e140a5328f68fd80a6) by wangpengfei).

### Documented
- Update alert policies document ([50ca7ba](https://github.com/citahub/cita-monitor/commit/50ca7ba13124b1d6aaaae790daa5ce7afedf07c1) by RainChen).

### Fixed
- Fix make recipe: `make commit-release-notes` ([57568f7](https://github.com/citahub/cita-monitor/commit/57568f763b64258ebc35e090070a88625de60f51) by RainChen).


## [v0.5.0](https://github.com/citahub/cita-monitor/releases/tag/v0.5.0) ([compare](https://github.com/citahub/cita-monitor/compare/v0.4.1...v0.5.0)) - 2020-06-11

### Added
- Add dashboard language choices ([fec0975](https://github.com/citahub/cita-monitor/commit/fec0975f02b21693681d948f650d78f76abfdaff) by miaojun).
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ lint-python-code: ## Run linter for python codes

lint-python-code-quality: ## Run linter for python codes quality
@$(call puts,INFO,"Sniffs code smells in Python code")
pylint **/*.py
pylint $$(git ls-files '*.py')

lint-python-code-security: ## Run linter for python codes security
@$(call puts,INFO,"Find common security issues in Python code")
Expand All @@ -108,11 +108,11 @@ lint-python-code-security: ## Run linter for python codes security
format-python-code: ## Run formatter for python codes.
$(info Run formatter for python codes)
cat .style.yapf
yapf --diff --recursive **/*.py
yapf --diff --recursive $$(git ls-files '*.py')

lint-shell-code: ## Run linter for shell codes.
$(info Run linter for shell codes)
find . -name "*.sh" | xargs -I @ shellcheck @
shellcheck $$(git ls-files '*.sh')

format-shell-code: ## Run formatter for shell codes.
$(info Run formatter for shell codes)
Expand Down Expand Up @@ -156,7 +156,7 @@ changelog-auto: ## Auto generate CHANGELOG.md
git merge master --no-edit
@$(MAKE) changelog

make commit-release-notes: ## Commit VERSION and CHANGELOG.md
commit-release-notes: ## Commit VERSION and CHANGELOG.md
@current_version=`cat VERSION` ;\
git add VERSION CHANGELOG.md ;\
git commit -m "bump version to v$${current_version}" ;\
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.6.0
1 change: 1 addition & 0 deletions agent/cita_exporter/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
34 changes: 23 additions & 11 deletions agent/cita_exporter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
FROM ubuntu:18.04
# compile cita-cli with musl
FROM rust:1.48 AS builder
WORKDIR /build
RUN curl -o musl-1.1.19.tar.gz https://www.musl-libc.org/releases/musl-1.1.19.tar.gz \
&& tar -xzvf musl-1.1.19.tar.gz \
&& cd musl-1.1.19/ \
&& ./configure && make && make install \
&& ln -sf /usr/local/musl/bin/musl-gcc /usr/local/bin/musl-gcc
COPY ./cita-cli.git /build/cita-cli.git
WORKDIR /build/cita-cli.git/cita-cli
RUN rustup target add x86_64-unknown-linux-musl \
&& RUSTFLAGS='-A deprecated' cargo install --target x86_64-unknown-linux-musl --path .

# build the citamon/agent-cita-exporter docker image
FROM ubuntu:18.04 AS final
COPY --from=builder /usr/local/cargo/bin/cita-cli /bin/cita-cli
RUN chmod +x /bin/cita-cli
WORKDIR /config
ADD . /config
COPY ./cita_monitor_agent.py ./requirements.txt /config/
RUN apt-get update \
&& apt-get install -y \
python3 \
python3-pip \
libcurl4-openssl-dev \
&& apt-get clean \
&& apt-get autoclean \
&& rm -rf /var/lib/apt/lists/*

&& apt-get install -y python3 python3-pip libcurl4-openssl-dev \
&& apt-get clean \
&& apt-get autoclean \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install -r requirements.txt
RUN mv cita-cli /bin/cita-cli && chmod +x /bin/cita-cli
ENV PORT=1923
CMD "python3" "cita_monitor_agent.py" "$NODE_IP_PORT" "$PORT" "$NODE_DIR"

Binary file removed agent/cita_exporter/cita-cli
Binary file not shown.
1 change: 1 addition & 0 deletions agent/cita_exporter/cita-cli.git
Submodule cita-cli.git added at 199129
File renamed without changes.
79 changes: 79 additions & 0 deletions agent/docker-compose-with-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
version: "3"
services:

citamon_agent_host_exporter:
image: prom/node-exporter:v0.18.0
hostname: host_exporter
container_name: citamon_agent_host_exporter
volumes:
- /proc:/host/proc
- /sys:/host/sys
- /:/host/rootfs
- /etc/localtime:/etc/localtime
command: "--path.procfs='/host/proc' --path.sysfs='/host/sys' --path.rootfs='/host/rootfs'"
networks:
- citamon-agent-net

citamon_agent_process_exporter:
build:
context: ./process_exporter/process-exporter.git
dockerfile: Dockerfile
image: citamon/agent-process-exporter:0.4.0
hostname: process_exporter
container_name: citamon_agent_process_exporter
volumes:
- /proc:/host/proc
- ./process_exporter/config:/config
- /etc/localtime:/etc/localtime
command: "--procfs /host/proc --config.path /config/process_list.yml"
networks:
- citamon-agent-net

citamon_agent_rabbitmq_exporter:
build:
context: ./rabbitmq_exporter/rabbitmq_exporter.git
dockerfile: Dockerfile
image: citamon/agent-rabbitmq-exporter:1.0.0-RC
hostname: rabbitmq_exporter
container_name: citamon_agent_rabbitmq_exporter
network_mode: "host"
volumes:
- /etc/localtime:/etc/localtime
environment:
- "RABBIT_CAPABILITIES=bert,no_sort"

citamon_agent_cita_exporter:
build:
context: ./cita_exporter
dockerfile: Dockerfile
image: citamon/agent-cita-exporter:20.2.2
hostname: ${HOSTNAME}
container_name: citamon_agent_cita_exporter_${NODE_IP}_${NODE_PORT}
pid: "host"
volumes:
- ${NODE_DIR}:${NODE_DIR}:ro
- ${SOFT_PATH}:${SOFT_PATH}:ro
- /etc/localtime:/etc/localtime
environment:
- NODE_IP_PORT=${NODE_IP}:${NODE_PORT}
- NODE_DIR
networks:
- citamon-agent-net

citamon_agent_proxy_exporter:
image: nginx:1.16.0
hostname: proxy_exporter
container_name: citamon_agent_proxy_exporter
ports:
- "1920:80"
volumes:
- ./nginx.template:/etc/nginx/conf.d/nginx.template
environment:
- NGINX_HOST=${NODE_IP}
- NGINX_PORT=80
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/nginx.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
networks:
- citamon-agent-net

networks:
citamon-agent-net:
12 changes: 5 additions & 7 deletions agent/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"
services:

citamon_agent_host_exporter:
image: prom/node-exporter:v0.17.0
image: prom/node-exporter:v0.18.0
hostname: host_exporter
container_name: citamon_agent_host_exporter
volumes:
Expand All @@ -15,19 +15,19 @@ services:
- citamon-agent-net

citamon_agent_process_exporter:
image: ncabatoff/process-exporter:0.4.0
image: citamon/agent-process-exporter:0.4.0
hostname: process_exporter
container_name: citamon_agent_process_exporter
volumes:
- /proc:/host/proc
- ./process_exporter_config:/config
- ./process_exporter/config:/config
- /etc/localtime:/etc/localtime
command: "--procfs /host/proc --config.path /config/process_list.yml"
networks:
- citamon-agent-net

citamon_agent_rabbitmq_exporter:
image: kbudde/rabbitmq-exporter:1.0.0-RC
image: citamon/agent-rabbitmq-exporter:1.0.0-RC
hostname: rabbitmq_exporter
container_name: citamon_agent_rabbitmq_exporter
network_mode: "host"
Expand All @@ -37,15 +37,13 @@ services:
- "RABBIT_CAPABILITIES=bert,no_sort"

citamon_agent_cita_exporter:
build: ./cita_exporter
image: citamon/agent-cita-exporter
image: citamon/agent-cita-exporter:20.2.2
hostname: ${HOSTNAME}
container_name: citamon_agent_cita_exporter_${NODE_IP}_${NODE_PORT}
pid: "host"
volumes:
- ${NODE_DIR}:${NODE_DIR}:ro
- ${SOFT_PATH}:${SOFT_PATH}:ro
- ./cita_monitor_agent.py:/config/cita_monitor_agent.py:ro
- /etc/localtime:/etc/localtime
environment:
- NODE_IP_PORT=${NODE_IP}:${NODE_PORT}
Expand Down
1 change: 1 addition & 0 deletions agent/process_exporter/process-exporter.git
Submodule process-exporter.git added at 84b1fe
1 change: 1 addition & 0 deletions agent/rabbitmq_exporter/rabbitmq_exporter.git
Submodule rabbitmq_exporter.git added at 5c6995
12 changes: 6 additions & 6 deletions docs/alert_policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@

* 区块链数据状态告警,如出块高度、出块间隔时间

* 停止出块:出块高度在设置告警阀值内没有变化
* 停止出块:出块高度在设置告警阈值内没有变化

* 出块间隔过久:出块间隔大于设置告警阀值
* 出块间隔过久:出块间隔大于设置告警阈值

* EVM CPU 过载警告:Quota Used / Block Limit 占比持续时间大于设置阀值
* EVM CPU 过载警告:Quota Used / Block Limit 占比持续时间大于设置阈值

* [ ] 共识节点是否出块:共识节点是否有参与共识,超过告警设置时间则发送错误告警

* 运行环境状态告警,如磁盘空间不足

* [ ] 磁盘空间不足:剩余磁盘空间小于告警阀值
* 磁盘空间不足:剩余磁盘空间小于告警阈值(默认为10%)

* 目录增长过快:数据目录增长速度大于设置告警阀值
* 目录增长过快:数据目录增长速度大于设置告警阈值

* 主机 CPU 过载警告:CPU 使用率持续时间大于设置阀值
* 主机 CPU 过载警告:CPU 使用率持续时间大于设置阈值


7 changes: 4 additions & 3 deletions server/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
version: '3'
services:

citamon_server_prometheus:
user: root
image: prom/prometheus:v2.6.0
image: prom/prometheus:v2.10.0
container_name: citamon_server_prometheus
hostname: prometheus_server
privileged: true
Expand All @@ -20,7 +21,7 @@ services:
- '${PROMETHEUS_HOSTPORT}:${PROMETHEUS_CONTAINERPORT}'

citamon_server_alertmanager:
image: prom/alertmanager:v0.15.3
image: prom/alertmanager:v0.17.0
container_name: citamon_server_alertmanager
hostname: prometheus_alertmanager_server
volumes:
Expand All @@ -40,7 +41,7 @@ services:
args:
VERSION: ${VERSION}
LANGUAGE: ${LANGUAGE}
image: citamon_server/grafana:5.4.2
image: citamon_server/grafana:5.4.3
container_name: citamon_server_grafana
hostname: grafana_server
environment:
Expand Down
2 changes: 1 addition & 1 deletion server/grafana/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM grafana/grafana:5.4.2
FROM grafana/grafana:5.4.3

USER root

Expand Down

0 comments on commit 8dfbb03

Please sign in to comment.