Skip to content

Commit

Permalink
Merge pull request #684 from WeBankPartners/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
pobu168 authored Nov 27, 2020
2 parents c0ba299 + edccf2e commit aa55e88
Show file tree
Hide file tree
Showing 74 changed files with 1,749 additions and 502 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# IDEA
.idea
.editorconfig
.vscode

# node
monitor-ui/node_modules
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ ENV PING_EXPORTER=$BASE_HOME/ping_exporter
ENV ARCHIVE_TOOL=$BASE_HOME/archive_mysql_tool
ENV DB_DATA_EXPORTER=$BASE_HOME/db_data_exporter

RUN mkdir -p $BASE_HOME $PROMETHEUS_HOME $PROMETHEUS_HOME/rules $ALERTMANAGER_HOME $MONITOR_HOME $MONITOR_HOME/conf $AGENT_MANAGER_HOME $PING_EXPORTER $AGENT_MANAGER_DEPLOY $TRANS_GATEWAY $ARCHIVE_TOOL $DB_DATA_EXPORTER
RUN mkdir -p $BASE_HOME $PROMETHEUS_HOME $PROMETHEUS_HOME/rules $PROMETHEUS_HOME/token $ALERTMANAGER_HOME $MONITOR_HOME $MONITOR_HOME/conf $AGENT_MANAGER_HOME $PING_EXPORTER $AGENT_MANAGER_DEPLOY $TRANS_GATEWAY $ARCHIVE_TOOL $DB_DATA_EXPORTER

COPY build/start.sh $BASE_HOME/
COPY build/stop.sh $BASE_HOME/
COPY build/conf/prometheus.yml $PROMETHEUS_HOME/
COPY build/conf/kubernetes_prometheus.tpl $PROMETHEUS_HOME/
COPY build/conf/prometheus.yml $PROMETHEUS_HOME/prometheus_tpl.yml
COPY build/conf/sd_file $PROMETHEUS_HOME/sd_file
COPY build/conf/alertmanager.yml $ALERTMANAGER_HOME/
COPY build/conf/base.yml $PROMETHEUS_HOME/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
中文 / [English](README_EN.md)

## 在线体验环境
[点此试用Open-Monitor](http://124.156.108.126:8080/wecube-monitor)
[点此试用Open-Monitor](http://124.156.108.126:8080/monitor)
<img src="./wiki/images/wecube-monitor01.gif" />
> 注意:
>
Expand Down
2 changes: 1 addition & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ English / [中文](README.md)

## Live Demo

[Live Demo](http://124.156.108.126:8080/wecube-monitor)
[Live Demo](http://124.156.108.126:8080/monitor)
<img src="./wiki/images/wecube-monitor01.gif" />
> Note:
> 1. Live Demo will reset on 2:00 - 4:00am every day. The environment is not available during the period, and all changes will be discarded.
Expand Down
2 changes: 1 addition & 1 deletion build/conf/alertmanager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ route:
receivers:
- name: 'web.hook'
webhook_configs:
- url: 'http://127.0.0.1:8080/wecube-monitor/webhook'
- url: 'http://127.0.0.1:8080/monitor/webhook'
send_resolved: true
inhibit_rules:
- source_match:
Expand Down
56 changes: 56 additions & 0 deletions build/conf/kubernetes_prometheus.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
- job_name: 'k8s-kubelet-{{cluster_name}}'
honor_timestamps: true
metrics_path: /metrics
scheme: https
kubernetes_sd_configs:
- api_server: https://{{api_server_ip}}:{{api_server_port}}
role: node
bearer_token_file: /app/monitor/prometheus/token/{{cluster_name}}
tls_config:
insecure_skip_verify: true
bearer_token_file: /app/monitor/prometheus/token/{{cluster_name}}
tls_config:
insecure_skip_verify: true
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- separator: ;
regex: (.*)
target_label: __address__
replacement: {{api_server_ip}}:{{api_server_port}}
action: replace
- source_labels: [__meta_kubernetes_node_name]
separator: ;
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/${1}/proxy/metrics
action: replace


- job_name: 'k8s-cadvisor-{{cluster_name}}'
honor_timestamps: true
metrics_path: /metrics
scheme: https
kubernetes_sd_configs:
- api_server: https://{{api_server_ip}}:{{api_server_port}}
role: node
bearer_token_file: /app/monitor/prometheus/token/{{cluster_name}}
tls_config:
insecure_skip_verify: true
bearer_token_file: /app/monitor/prometheus/token/{{cluster_name}}
tls_config:
insecure_skip_verify: true
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- separator: ;
regex: (.*)
target_label: __address__
replacement: {{api_server_ip}}:{{api_server_port}}
action: replace
- source_labels: [__meta_kubernetes_node_name]
separator: ;
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor
action: replace
3 changes: 2 additions & 1 deletion build/conf/monitor.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,6 @@
"timeout": 60,
"local_storage_max_day": 30,
"five_min_start_day": 90
}
},
"process_check_list": ["ping_exporter", "agent_manager"]
}
2 changes: 1 addition & 1 deletion build/conf/ping_exporter.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"enabled" : true,
"header": ["X-Auth-Token=default-token-used-in-server-side"],
"group_tag" : "group=g1",
"url": "http://127.0.0.1:8080/wecube-monitor/api/v1/agent/export/ping/source",
"url": "http://127.0.0.1:8080/monitor/api/v1/agent/export/ping/source",
"interval": 60,
"weight": 3
},
Expand Down
7 changes: 6 additions & 1 deletion build/conf/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ scrape_configs:
- job_name: 'ping_exporter'
static_configs:
- targets: ['127.0.0.1:9191']
metric_relabel_configs:
- source_labels: [guid]
target_label: e_guid

- job_name: 'db_monitor_exporter'
static_configs:
Expand Down Expand Up @@ -73,4 +76,6 @@ scrape_configs:
file_sd_configs:
- refresh_interval: 1m
files:
- '/app/monitor/prometheus/sd_file/sd_file_60.json'
- '/app/monitor/prometheus/sd_file/sd_file_60.json'

#Kubernetes scrape configuration
2 changes: 1 addition & 1 deletion build/develop/alertmanager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ route:
receivers:
- name: 'web.hook'
webhook_configs:
- url: 'http://{{EXTERNAL_IP}}:8088/wecube-monitor/api/v1/alarm/webhook'
- url: 'http://{{EXTERNAL_IP}}:8088/monitor/api/v1/alarm/webhook'
send_resolved: true
inhibit_rules:
- source_match:
Expand Down
Loading

0 comments on commit aa55e88

Please sign in to comment.