-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# the dashboard is here : https://github.com/pingcap/tidb-ansible/tree/release-2.1/scripts | ||
{{- if .Values.monitor.grafana.create }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "cluster.name" . }}-monitor-dashboard-v2 | ||
labels: | ||
app.kubernetes.io/name: {{ template "chart.name" . }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/component: monitor | ||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
data: | ||
pdV2.json: | | ||
{{ include "pd_dashboard_v2" . | indent 4 }} | ||
overviewV2.json: | | ||
{{ include "overview_dashboard_v2" . | indent 4 }} | ||
tidbV2.json: | | ||
{{ include "tidb_dashboard_v2" . | indent 4 }} | ||
tikvV2.json: | | ||
{{ include "tikv_dashboard_v2" . | indent 4 }} | ||
binlogV2.json: | | ||
{{ include "binlog_v2" . | indent 4 }} | ||
{{- end }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# the dashboard is here : https://github.com/pingcap/tidb-ansible/tree/release-3.0/scripts | ||
{{- if .Values.monitor.grafana.create }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "cluster.name" . }}-monitor-dashboard-v3 | ||
labels: | ||
app.kubernetes.io/name: {{ template "chart.name" . }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/component: monitor | ||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
data: | ||
pdV3.json: | | ||
{{ include "pd_dashboard_v3" . | indent 4 }} | ||
overviewV3.json: | | ||
{{ include "overview_dashboard_v3" . | indent 4 }} | ||
tidbV3.json: | | ||
{{ include "tidb_dashboard_v3" . | indent 4 }} | ||
tikvV3.json: | | ||
{{ include "tikv_dashboard_v3" . | indent 4 }} | ||
binlogV3.json: | | ||
{{ include "binlog_v3" . | indent 4 }} | ||
{{- end }} | ||
--- | ||
{{- if .Values.monitor.grafana.create }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "cluster.name" . }}-monitor-dashboard-extra-v3 | ||
labels: | ||
app.kubernetes.io/name: {{ template "chart.name" . }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/component: monitor | ||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} | ||
data: | ||
tikvSummaryV3.json: | | ||
{{ include "tikv_summary_dashboard_v3" . | indent 4 }} | ||
tikvTSV3.json: | | ||
{{ include "tikv_ts_dashboard_v3" . | indent 4 }} | ||
{{- end }} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,72 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
#decompress dashboard files | ||
gzip -dc /tmp/dashboard-gz/tidb.json.gz > /grafana-dashboard-definitions/tidb/tidb.json | ||
gzip -dc /tmp/dashboard-gz/pd.json.gz > /grafana-dashboard-definitions/tidb/pd.json | ||
gzip -dc /tmp/dashboard-gz/tikv.json.gz > /grafana-dashboard-definitions/tidb/tikv.json | ||
gzip -dc /tmp/dashboard-gz/overview.json.gz > /grafana-dashboard-definitions/tidb/overview.json | ||
#check tidb cluster version | ||
TiDBVersion={{ .Values.tidb.image }} | ||
TiKVVersion={{ .Values.tikv.image }} | ||
PDVersion={{ .Values.pd.image }} | ||
PumpVersion={{ .Values.binlog.pump.image }} | ||
V3=v3 | ||
|
||
#check binlog switch | ||
enablePump={{ .Values.binlog.pump.create | default false }} | ||
|
||
#replace dashboard name using cluster name | ||
clusterName={{ template "cluster.name" . }} | ||
clusterName=${clusterName:-"TiDB-Cluster"} | ||
|
||
sed -i 's/TIDB-Cluster-TiDB/'$clusterName'-TiDB/g' /grafana-dashboard-definitions/tidb/tidb.json | ||
sed -i 's/TIDB-Cluster-PD/'$clusterName'-PD/g' /grafana-dashboard-definitions/tidb/pd.json | ||
sed -i 's/TIDB-Cluster-TiKV/'$clusterName'-TiKV/g' /grafana-dashboard-definitions/tidb/tikv.json | ||
sed -i 's/TIDB-Cluster-Overview/'$clusterName'-Overview/g' /grafana-dashboard-definitions/tidb/overview.json | ||
#TiDB dashboard | ||
if [[ $TiDBVersion =~ $V3 ]] | ||
then | ||
cp /tmp/dashboard-v3/tidbV3.json /grafana-dashboard-definitions/tidb/ | ||
else | ||
cp /tmp/dashboard-v2/tidbV2.json /grafana-dashboard-definitions/tidb/ | ||
fi | ||
sed -i 's/TIDB-Cluster-TiDB/'$clusterName'-TiDB/g' /grafana-dashboard-definitions/tidb/tidbV*.json | ||
|
||
#Overview dashboard | ||
if [[ $TiDBVersion =~ $V3 ]] | ||
then | ||
cp /tmp/dashboard-v3/overviewV3.json /grafana-dashboard-definitions/tidb/ | ||
else | ||
cp /tmp/dashboard-v2/overviewV2.json /grafana-dashboard-definitions/tidb/ | ||
fi | ||
sed -i 's/TIDB-Cluster-Overview/'$clusterName'-Overview/g' /grafana-dashboard-definitions/tidb/overviewV*.json | ||
|
||
#PD dashboard | ||
if [[ $PDVersion =~ $V3 ]] | ||
then | ||
cp /tmp/dashboard-v3/pdV3.json /grafana-dashboard-definitions/tidb/ | ||
else | ||
cp /tmp/dashboard-v2/pdV2.json /grafana-dashboard-definitions/tidb/ | ||
fi | ||
sed -i 's/TIDB-Cluster-PD/'$clusterName'-PD/g' /grafana-dashboard-definitions/tidb/pdV*.json | ||
|
||
#TIKV dashboard | ||
if [[ $TiKVVersion =~ $V3 ]] | ||
then | ||
cp /tmp/dashboard-v3/tikvV3.json /grafana-dashboard-definitions/tidb/ | ||
cp /tmp/dashboard-v3/extra/tikvSummaryV3.json /grafana-dashboard-definitions/tidb/ | ||
cp /tmp/dashboard-v3/extra/tikvTSV3.json /grafana-dashboard-definitions/tidb/ | ||
sed -i 's/TIDB-Cluster-TiKV-Summary/'$clusterName'-TiKV-Summary/g' /grafana-dashboard-definitions/tidb/tikvSummaryV3.json | ||
sed -i 's/TIDB-Cluster-TiKV-Trouble-Shooting/'$clusterName'-TiKV-Trouble-Shooting/g' /grafana-dashboard-definitions/tidb/tikvTSV3.json | ||
else | ||
cp /tmp/dashboard-v2/tikvV2.json /grafana-dashboard-definitions/tidb/ | ||
fi | ||
sed -i 's/TIDB-Cluster-TiKV/'$clusterName'-TiKV/g' /grafana-dashboard-definitions/tidb/tikvV*.json | ||
|
||
|
||
#Binlog dashboard | ||
if [[ $PumpVersion =~ $V3 ]] | ||
then | ||
if $enablePump | ||
then | ||
cp /tmp/dashboard-v3/binlogV3.json /grafana-dashboard-definitions/tidb/ | ||
sed -i 's/TIDB-Cluster-Binlog/'$clusterName'-Binlog/g' /grafana-dashboard-definitions/tidb/binlogV3.json | ||
fi | ||
else | ||
if $enablePump | ||
then | ||
cp /tmp/dashboard-v2/binlogV2.json /grafana-dashboard-definitions/tidb/ | ||
sed -i 's/TIDB-Cluster-Binlog/'$clusterName'-Binlog/g' /grafana-dashboard-definitions/tidb/binlogV2.json | ||
fi | ||
fi |