diff --git a/pkg/cluster/embed/autogen_pkger.go b/pkg/cluster/embed/autogen_pkger.go index e40d6aad7d..d66f9d545e 100644 --- a/pkg/cluster/embed/autogen_pkger.go +++ b/pkg/cluster/embed/autogen_pkger.go @@ -20,7 +20,6 @@ func init() { autogenFiles["/templates/config/blackbox.yml"] = "bW9kdWxlczoKICBodHRwXzJ4eDoKICAgIHByb2JlcjogaHR0cAogICAgaHR0cDoKICAgICAgbWV0aG9kOiBHRVQKICBodHRwX3Bvc3RfMnh4OgogICAgcHJvYmVyOiBodHRwCiAgICBodHRwOgogICAgICBtZXRob2Q6IFBPU1QKICB0Y3BfY29ubmVjdDoKICAgIHByb2JlcjogdGNwCiAgcG9wM3NfYmFubmVyOgogICAgcHJvYmVyOiB0Y3AKICAgIHRjcDoKICAgICAgcXVlcnlfcmVzcG9uc2U6CiAgICAgICAgLSBleHBlY3Q6ICJeK09LIgogICAgICB0bHM6IHRydWUKICAgICAgdGxzX2NvbmZpZzoKICAgICAgICBpbnNlY3VyZV9za2lwX3ZlcmlmeTogZmFsc2UKICBzc2hfYmFubmVyOgogICAgcHJvYmVyOiB0Y3AKICAgIHRjcDoKICAgICAgcXVlcnlfcmVzcG9uc2U6CiAgICAgICAgLSBleHBlY3Q6ICJeU1NILTIuMC0iCiAgaXJjX2Jhbm5lcjoKICAgIHByb2JlcjogdGNwCiAgICB0Y3A6CiAgICAgIHF1ZXJ5X3Jlc3BvbnNlOgogICAgICAgIC0gc2VuZDogIk5JQ0sgcHJvYmVyIgogICAgICAgIC0gc2VuZDogIlVTRVIgcHJvYmVyIHByb2JlciBwcm9iZXIgOnByb2JlciIKICAgICAgICAtIGV4cGVjdDogIlBJTkcgOihbXiBdKykiCiAgICAgICAgICBzZW5kOiAiUE9ORyAkezF9IgogICAgICAgIC0gZXhwZWN0OiAiXjpbXiBdKyAwMDEiCiAgaWNtcDoKICAgIHByb2JlcjogaWNtcAogICAgdGltZW91dDogNXMKICAgIGljbXA6CiAgICAgIHByZWZlcnJlZF9pcF9wcm90b2NvbDogImlwNCIK" autogenFiles["/templates/config/dashboard.yml.tpl"] = "YXBpVmVyc2lvbjogMQpwcm92aWRlcnM6CiAgLSBuYW1lOiB7ey5DbHVzdGVyTmFtZX19CiAgICBmb2xkZXI6IHt7LkNsdXN0ZXJOYW1lfX0KICAgIHR5cGU6IGZpbGUKICAgIGRpc2FibGVEZWxldGlvbjogZmFsc2UKICAgIGVkaXRhYmxlOiB0cnVlCiAgICB1cGRhdGVJbnRlcnZhbFNlY29uZHM6IDMwCiAgICBvcHRpb25zOgogICAgICBwYXRoOiB7ey5EZXBsb3lEaXJ9fS9kYXNoYm9hcmRz" autogenFiles["/templates/config/datasource.yml.tpl"] = "YXBpVmVyc2lvbjogMQpkZWxldGVEYXRhc291cmNlczoKICAtIG5hbWU6IHt7LkNsdXN0ZXJOYW1lfX0KZGF0YXNvdXJjZXM6CiAgLSBuYW1lOiB7ey5DbHVzdGVyTmFtZX19CiAgICB0eXBlOiBwcm9tZXRoZXVzCiAgICBhY2Nlc3M6IHByb3h5CiAgICB1cmw6IGh0dHA6Ly97ey5JUH19Ont7LlBvcnR9fQogICAgd2l0aENyZWRlbnRpYWxzOiBmYWxzZQogICAgaXNEZWZhdWx0OiBmYWxzZQogICAgdGxzQXV0aDogZmFsc2UKICAgIHRsc0F1dGhXaXRoQ0FDZXJ0OiBmYWxzZQogICAgdmVyc2lvbjogMQogICAgZWRpdGFibGU6IHRydWU=" - autogenFiles["/templates/config/dm/prometheus.yml.tpl"] = "LS0tCmdsb2JhbDoKICBzY3JhcGVfaW50ZXJ2YWw6ICAgICAxNXMgIyBCeSBkZWZhdWx0LCBzY3JhcGUgdGFyZ2V0cyBldmVyeSAxNSBzZWNvbmRzLgogIGV2YWx1YXRpb25faW50ZXJ2YWw6IDE1cyAjIEJ5IGRlZmF1bHQsIHNjcmFwZSB0YXJnZXRzIGV2ZXJ5IDE1IHNlY29uZHMuCiAgIyBzY3JhcGVfdGltZW91dCBpcyBzZXQgdG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X0Ke3stIGVuZH19Cgp7eyByYW5nZSAkaywgJHYgOj0gLkN1c3RvbUZpZWxkc319Cnt7ICRrIH19ICAge3sgJHYgfX0Ke3stIGVuZCB9fQpzcGFyay5zcWwuZXh0ZW5zaW9ucyAgIG9yZy5hcGFjaGUuc3Bhcmsuc3FsLlRpRXh0ZW5zaW9ucwoKe3stIGlmIC5UaVNwYXJrTWFzdGVyc319CnNwYXJrLm1hc3RlciAgIHNwYXJrOi8ve3suVGlTcGFya01hc3RlcnN9fQp7ey0gZW5kfX0KCnNwYXJrLnRpc3BhcmsucGQuYWRkcmVzc2VzIHt7dGVtcGxhdGUgIlBETGlzdCIgLkVuZHBvaW50c319Cg==" diff --git a/pkg/cluster/spec/grafana.go b/pkg/cluster/spec/grafana.go index 3a9cd866e4..89a29f91a9 100644 --- a/pkg/cluster/spec/grafana.go +++ b/pkg/cluster/spec/grafana.go @@ -208,16 +208,11 @@ func (i *GrafanaInstance) InitConfig( func (i *GrafanaInstance) initDashboards(ctx context.Context, e ctxt.Executor, spec GrafanaSpec, paths meta.DirPaths, clusterName string) error { dashboardsDir := filepath.Join(paths.Deploy, "dashboards") - if spec.DashboardDir != "" { - return i.TransferLocalConfigDir(ctx, e, spec.DashboardDir, dashboardsDir, func(name string) bool { - return strings.HasSuffix(name, ".json") - }) - } cmds := []string{ "mkdir -p %[1]s", `find %[1]s -maxdepth 1 -type f -name "*.json" -delete`, - "cp %[2]s/bin/*.json %[1]s", + `find %[2]s/bin -maxdepth 1 -type f -name "*.json" -exec cp {} %[1]s \;`, } _, stderr, err := e.Execute(ctx, fmt.Sprintf(strings.Join(cmds, " && "), dashboardsDir, paths.Deploy), false) if err != nil { @@ -238,6 +233,16 @@ func (i *GrafanaInstance) initDashboards(ctx context.Context, e ctxt.Executor, s } } + // The original Prometheus-v4.0.x.tar.gz contained some useful dashboards maintained by PingCAP + // These dashboards are sufficient for normal use case, + // if you want to specify other dashboards, use the `DashboardDir`. + // WARNING: RuleDir will overwrite a file with same name. + if spec.DashboardDir != "" { + return i.TransferLocalConfigDir(ctx, e, spec.DashboardDir, dashboardsDir, func(name string) bool { + return strings.HasSuffix(name, ".json") + }) + } + return nil } @@ -275,7 +280,7 @@ func (i *GrafanaInstance) installDashboards(ctx context.Context, e ctxt.Executor cmds := []string{ "mkdir -p %[1]s", `find %[1]s -maxdepth 1 -type f -name "*.json" -delete`, - "cp %[2]s/dm-master/scripts/*.json %[1]s", + `find %[2]s/dm-master/scripts -type f -name "*.json" -exec cp {} %[1]s \;`, "rm -rf %[2]s", } _, stderr, err = e.Execute(ctx, fmt.Sprintf(strings.Join(cmds, " && "), targetDir, tmp), false) diff --git a/pkg/cluster/spec/grafana_test.go b/pkg/cluster/spec/grafana_test.go index c862884bef..86325f9b31 100644 --- a/pkg/cluster/spec/grafana_test.go +++ b/pkg/cluster/spec/grafana_test.go @@ -35,9 +35,16 @@ func TestLocalDashboards(t *testing.T) { deployDir, err := ioutil.TempDir("", "tiup-*") assert.Nil(t, err) defer os.RemoveAll(deployDir) + // the dashboard json files are under the bin dir, + // which is needed to copy into the dashboard dir + err = os.MkdirAll(path.Join(deployDir, "bin"), 0755) + assert.Nil(t, err) localDir, err := filepath.Abs("./testdata/dashboards") assert.Nil(t, err) + err = ioutil.WriteFile(path.Join(deployDir, "bin", "dummy.json"), []byte(`{"dummy": "dummy"}`), 0644) + assert.Nil(t, err) + topo := new(Specification) topo.Grafanas = append(topo.Grafanas, GrafanaSpec{ Host: "127.0.0.1", @@ -60,7 +67,7 @@ func TestLocalDashboards(t *testing.T) { err = grafanaInstance.initDashboards(ctx, e, topo.Grafanas[0], meta.DirPaths{Deploy: deployDir}, clusterName) assert.Nil(t, err) - assert.FileExists(t, path.Join(deployDir, "dashboards", "tidb.json")) + assert.FileExists(t, path.Join(deployDir, "dashboards", "dummy.json")) fs, err := ioutil.ReadDir(localDir) assert.Nil(t, err) for _, f := range fs { diff --git a/pkg/cluster/spec/prometheus.go b/pkg/cluster/spec/prometheus.go index a4b93b912c..9526e7dd18 100644 --- a/pkg/cluster/spec/prometheus.go +++ b/pkg/cluster/spec/prometheus.go @@ -314,7 +314,7 @@ func (i *MonitorInstance) installRules(ctx context.Context, e ctxt.Executor, dep cmds := []string{ "mkdir -p %[1]s", `find %[1]s -type f -name "*.rules.yml" -delete`, - "cp %[2]s/dm-master/conf/*.rules.yml %[1]s", + `find %[2]s/dm-master/conf -type f -name "*.rules.yml" -exec cp %[1]s \;`, "rm -rf %[2]s", } _, stderr, err = e.Execute(ctx, fmt.Sprintf(strings.Join(cmds, " && "), targetDir, tmp), false) @@ -326,23 +326,28 @@ func (i *MonitorInstance) installRules(ctx context.Context, e ctxt.Executor, dep } func (i *MonitorInstance) initRules(ctx context.Context, e ctxt.Executor, spec PrometheusSpec, paths meta.DirPaths) error { - if spec.RuleDir != "" { - return i.TransferLocalConfigDir(ctx, e, spec.RuleDir, path.Join(paths.Deploy, "conf"), func(name string) bool { - return strings.HasSuffix(name, ".rules.yml") - }) - } - // To make this step idempotent, we need cleanup old rules first cmds := []string{ "mkdir -p %[1]s/conf", `find %[1]s/conf -type f -name "*.rules.yml" -delete`, - `cp %[1]s/bin/prometheus/*.rules.yml %[1]s/conf/`, + `find %[1]s/bin/prometheus -maxdepth 1 -type f -name "*.rules.yml" -exec cp {} %[1]s/conf/ \;`, } _, stderr, err := e.Execute(ctx, fmt.Sprintf(strings.Join(cmds, " && "), paths.Deploy), false) if err != nil { return errors.Annotatef(err, "stderr: %s", string(stderr)) } + // The original Prometheus-v4.0.x.tar.gz contained a rule file for each component maintained by PingCAP + // such as tidb.rules.yml, tiflash.rules.yml ... + // These rules files are sufficient for normal use case, + // if you want to specify other rules, use the `RuleDir`. + // WARNING: RuleDir will overwrite a file with same name. + if spec.RuleDir != "" { + return i.TransferLocalConfigDir(ctx, e, spec.RuleDir, path.Join(paths.Deploy, "conf"), func(name string) bool { + return strings.HasSuffix(name, ".rules.yml") + }) + } + return nil } diff --git a/pkg/cluster/spec/prometheus_test.go b/pkg/cluster/spec/prometheus_test.go new file mode 100644 index 0000000000..f6186eca90 --- /dev/null +++ b/pkg/cluster/spec/prometheus_test.go @@ -0,0 +1,73 @@ +// Copyright 2020 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// See the License for the specific language governing permissions and +// limitations under the License. + +package spec + +import ( + "context" + "io/ioutil" + "os" + "os/user" + "path" + "path/filepath" + "testing" + + "github.com/pingcap/tiup/pkg/checkpoint" + "github.com/pingcap/tiup/pkg/cluster/executor" + "github.com/pingcap/tiup/pkg/meta" + "github.com/stretchr/testify/assert" +) + +func TestLocalRuleDirs(t *testing.T) { + deployDir, err := ioutil.TempDir("", "tiup-*") + assert.Nil(t, err) + defer os.RemoveAll(deployDir) + // the dashboard json files are under the bin dir, + // which is needed to copy into the dashboard dir + err = os.MkdirAll(path.Join(deployDir, "bin/prometheus"), 0755) + assert.Nil(t, err) + localDir, err := filepath.Abs("./testdata/rules") + assert.Nil(t, err) + + err = ioutil.WriteFile(path.Join(deployDir, "bin/prometheus", "dummy.rules.yml"), []byte("dummy"), 0644) + assert.Nil(t, err) + + topo := new(Specification) + topo.Monitors = append(topo.Monitors, PrometheusSpec{ + Host: "127.0.0.1", + Port: 9090, + RuleDir: localDir, + }) + + comp := MonitorComponent{topo} + ints := comp.Instances() + + assert.Equal(t, len(ints), 1) + promInstance := ints[0].(*MonitorInstance) + + user, err := user.Current() + assert.Nil(t, err) + e, err := executor.New(executor.SSHTypeNone, false, executor.SSHConfig{Host: "127.0.0.1", User: user.Username}) + assert.Nil(t, err) + + ctx := checkpoint.NewContext(context.Background()) + err = promInstance.initRules(ctx, e, promInstance.InstanceSpec.(PrometheusSpec), meta.DirPaths{Deploy: deployDir}) + assert.Nil(t, err) + + assert.FileExists(t, path.Join(deployDir, "conf", "dummy.rules.yml")) + fs, err := ioutil.ReadDir(localDir) + assert.Nil(t, err) + for _, f := range fs { + assert.FileExists(t, path.Join(deployDir, "conf", f.Name())) + } +} diff --git a/pkg/cluster/spec/testdata/rules/tidb.rules.yml b/pkg/cluster/spec/testdata/rules/tidb.rules.yml new file mode 100644 index 0000000000..7019aed45f --- /dev/null +++ b/pkg/cluster/spec/testdata/rules/tidb.rules.yml @@ -0,0 +1,15 @@ +# magic-string-for-test +groups: + - name: alert.rules + rules: + - alert: TiDB_schema_error + expr: increase(tidb_session_schema_lease_error_total{type="outdated"}[15m]) > 0 + for: 1m + labels: + env: ENV_LABELS_ENV + level: emergency + expr: increase(tidb_session_schema_lease_error_total{type="outdated"}[15m]) > 0 + annotations: + description: "cluster: ENV_LABELS_ENV, instance: {{ $labels.instance }}, values:{{ $value }}" + value: "{{ $value }}" + summary: TiDB schema error diff --git a/templates/config/dm/prometheus.yml.tpl b/templates/config/dm/prometheus.yml.tpl deleted file mode 100644 index fcb2c9ca2f..0000000000 --- a/templates/config/dm/prometheus.yml.tpl +++ /dev/null @@ -1,44 +0,0 @@ ---- -global: - scrape_interval: 15s # By default, scrape targets every 15 seconds. - evaluation_interval: 15s # By default, scrape targets every 15 seconds. - # scrape_timeout is set to the global default (10s). - external_labels: - cluster: '{{.ClusterName}}' - monitor: "prometheus" - -# Load and evaluate rules in this file every 'evaluation_interval' seconds. -rule_files: - - 'dm_worker.rules.yml' - - 'dm_master.rules.yml' - -{{- if .AlertmanagerAddrs}} -alerting: - alertmanagers: - - static_configs: - - targets: -{{- range .AlertmanagerAddrs}} - - '{{.}}' -{{- end}} -{{- end}} - -scrape_configs: -{{- if .MasterAddrs}} - - job_name: "dm_master" - honor_labels: true # don't overwrite job & instance labels - static_configs: - - targets: - {{- range .MasterAddrs}} - - '{{.}}' - {{- end}} -{{- end}} - -{{- if .WorkerAddrs}} - - job_name: "dm_worker" - honor_labels: true # don't overwrite job & instance labels - static_configs: - - targets: - {{- range .WorkerAddrs}} - - '{{.}}' - {{- end}} -{{- end}} diff --git a/tests/tiup-cluster/script/scale_tools.sh b/tests/tiup-cluster/script/scale_tools.sh index f5b477a567..37c9c8e332 100755 --- a/tests/tiup-cluster/script/scale_tools.sh +++ b/tests/tiup-cluster/script/scale_tools.sh @@ -22,6 +22,8 @@ function scale_tools() { tiup-cluster $client --yes deploy $name $version $topo -i ~/.ssh/id_rsa # check the local config + tiup-cluster $client exec $name -N n1 --command "ls /home/tidb/deploy/prometheus-9090/conf/{node,tidb,tikv}.rules.yml" + tiup-cluster $client exec $name -N n1 --command "ls /home/tidb/deploy/grafana-3000/dashboards/{tidb,tidb_summary,tikv_summary}.json" 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"