Skip to content

Commit

Permalink
tests/tiup-cluster: check prometheus monitored components (#1041)
Browse files Browse the repository at this point in the history
* fix(cluster/spec): missing {alertmanager,grafana}s

* typo(tests/tiup-cluster): wrong use grep expr

* fix(tests/tiup-cluster): tiflash only available if no_tls
  • Loading branch information
jsvisa authored Jan 6, 2021
1 parent 56d7377 commit 8feef43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/cluster/spec/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,14 @@ func (i *MonitorInstance) InitConfig(
cfig.AddCDC(cdc.Host, uint64(cdc.Port))
}
}
if servers, found := topoHasField("Grafana"); found {
if servers, found := topoHasField("Grafanas"); found {
for i := 0; i < servers.Len(); i++ {
grafana := servers.Index(i).Interface().(GrafanaSpec)
uniqueHosts.Insert(grafana.Host)
cfig.AddGrafana(grafana.Host, uint64(grafana.Port))
}
}
if servers, found := topoHasField("Alertmanager"); found {
if servers, found := topoHasField("Alertmanagers"); found {
for i := 0; i < servers.Len(); i++ {
alertmanager := servers.Index(i).Interface().(AlertmanagerSpec)
uniqueHosts.Insert(alertmanager.Host)
Expand Down
7 changes: 7 additions & 0 deletions tests/tiup-cluster/script/scale_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ function scale_tools() {
tiup-cluster $client exec $name -N n1 --command "grep magic-string-for-test /home/tidb/deploy/prometheus-9090/conf/tidb.rules.yml"
tiup-cluster $client exec $name -N n1 --command "grep magic-string-for-test /home/tidb/deploy/grafana-3000/dashboards/tidb.json"
tiup-cluster $client exec $name -N n1 --command "grep magic-string-for-test /home/tidb/deploy/alertmanager-9093/conf/alertmanager.yml"
tiup-cluster $client exec $name -N n1 --command "grep alertmanagers /home/tidb/deploy/prometheus-9090/conf/prometheus.yml"
for item in pump drainer tidb tikv pd grafana node_exporter blackbox_exporter; do
tiup-cluster $client exec $name -N n1 --command "grep $item /home/tidb/deploy/prometheus-9090/conf/prometheus.yml"
done
if [ $test_tls = false ]; then
tiup-cluster $client exec $name -N n1 --command "grep tiflash /home/tidb/deploy/prometheus-9090/conf/prometheus.yml"
fi

tiup-cluster $client list | grep "$name"

Expand Down

0 comments on commit 8feef43

Please sign in to comment.