tiup icon indicating copy to clipboard operation
tiup copied to clipboard

Grafana data source not found

Open YangKeao opened this issue 3 years ago • 3 comments

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

Deploy with the following yaml file:

global:
  user: "tidb"
  ssh_port: 22
  deploy_dir: "/tidb-deploy"
  data_dir: "/tidb-data"

pd_servers:
  - host: 127.0.0.1
    name: pd

tidb_servers:
  - host: 127.0.0.1

tikv_servers:
  - host: 127.0.0.1
    data_dir: "/mnt/test/tikv-data"

monitoring_servers:
  - host: 127.0.0.1

grafana_servers:
  - host: 127.0.0.1

Deploy with command: tiup cluster deploy toda-test-cluster v4.0.4 ./test-cluster.conf

Then visit http://127.0.0.1:3000/d/SVbh2xUWk/toda-test-cluster-tiflash-summary?orgId=1.

  1. What did you expect to see?

No error in grafana.

  1. What did you see instead?

I got an error: Datasource named toda-toda-test-cluster was not found. The datasource set in dashboard is toda-toda-test-cluster, but the real datasource name is toda-test-cluster

  1. What version of TiUP are you using (tiup --version)?
v1.0.8 tiup
Go Version: go1.13
Git Branch: master
GitHash: 4276089

YangKeao avatar Aug 10 '20 06:08 YangKeao

sad:( It's because that we need replace the keyword test-cluster to the real cluster name (the grafana template use test-cluster as the default one), and your cluster name contains the keyword test-cluster.

https://github.com/pingcap/tiup/blob/4f84a3f249510e7dc0f681680b25606b1f82fa21/pkg/cluster/spec/grafana.go#L200

lucklove avatar Oct 12 '20 08:10 lucklove

We can add " in replace stage

lucklove avatar Oct 12 '20 08:10 lucklove

The same issue in v.1.5 tiup. The cluster prefixed with test-cluster is a very common usage.

miaoqingli avatar Jul 13 '21 11:07 miaoqingli