diff --git a/README.md b/README.md index cc2b285..0893959 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Travis](https://img.shields.io/travis/sbueringer/grafana-consul-datasource.svg)](https://travis-ci.org/sbueringer/grafana-consul-datasource)[![Codecov](https://img.shields.io/codecov/c/github/sbueringer/grafana-consul-datasource.svg)](https://codecov.io/gh/sbueringer/grafana-consul-datasource)[![CodeFactor](https://www.codefactor.io/repository/github/sbueringer/grafana-consul-datasource/badge)](https://www.codefactor.io/repository/github/sbueringer/grafana-consul-datasource)[![GoReportCard](https://goreportcard.com/badge/github.com/sbueringer/grafana-consul-datasource?style=plastic)](https://goreportcard.com/report/github.com/sbueringer/grafana-consul-datasource)[![GitHub release](https://img.shields.io/github/release/sbueringer/grafana-consul-datasource.svg)](https://github.com/sbueringer/grafana-consul-datasource/releases) -[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/sbueringer/consul-datasource/issues) +[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/sbueringer/grafana-consul-datasource/issues) This datasource lets you integrate key value data from Consul in Grafana dashboards. diff --git a/datasource.go b/datasource.go index 244f883..ee3fbcb 100644 --- a/datasource.go +++ b/datasource.go @@ -356,7 +356,8 @@ type query struct { func newConsulFromReq(req *datasource.DatasourceRequest) (*api.Client, string, error) { consulToken := req.Datasource.DecryptedSecureJsonData["consulToken"] if consulToken == "" { - return nil, "", fmt.Errorf("unable to get consulToken") + // see https://www.consul.io/docs/acl/acl-system.html#acl-tokens + consulToken = "anonymous" } var jsonData map[string]interface{} diff --git a/dist/README.md b/dist/README.md index cc2b285..0893959 100644 --- a/dist/README.md +++ b/dist/README.md @@ -3,7 +3,7 @@ [![Travis](https://img.shields.io/travis/sbueringer/grafana-consul-datasource.svg)](https://travis-ci.org/sbueringer/grafana-consul-datasource)[![Codecov](https://img.shields.io/codecov/c/github/sbueringer/grafana-consul-datasource.svg)](https://codecov.io/gh/sbueringer/grafana-consul-datasource)[![CodeFactor](https://www.codefactor.io/repository/github/sbueringer/grafana-consul-datasource/badge)](https://www.codefactor.io/repository/github/sbueringer/grafana-consul-datasource)[![GoReportCard](https://goreportcard.com/badge/github.com/sbueringer/grafana-consul-datasource?style=plastic)](https://goreportcard.com/report/github.com/sbueringer/grafana-consul-datasource)[![GitHub release](https://img.shields.io/github/release/sbueringer/grafana-consul-datasource.svg)](https://github.com/sbueringer/grafana-consul-datasource/releases) -[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/sbueringer/consul-datasource/issues) +[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/sbueringer/grafana-consul-datasource/issues) This datasource lets you integrate key value data from Consul in Grafana dashboards. diff --git a/dist/grafana-consul-plugin_linux_amd64 b/dist/grafana-consul-plugin_linux_amd64 index b71201a..64a447e 100755 Binary files a/dist/grafana-consul-plugin_linux_amd64 and b/dist/grafana-consul-plugin_linux_amd64 differ diff --git a/dist/partials/config.html b/dist/partials/config.html index 5d12582..adfb58f 100644 --- a/dist/partials/config.html +++ b/dist/partials/config.html @@ -9,7 +9,7 @@

Consul

Token + placeholder="CONSUL_TOKEN">
@@ -27,7 +27,8 @@
Consul Address

Consul Token

- Consul Token has to be a valid Consul Token which is able to read the values you want to access. + If Consul Token is set, it has to be a valid Consul Token which is able to read the data you want to access. + If Consul Token is not set, "anonymous' is used (see Consul documentation). If ACLs are disabled in Consul, "anonymous" should be able to read the necessary data. More details can be found in the Consul documentation.

diff --git a/example/README.md b/example/README.md index 94f0e08..e2e1076 100644 --- a/example/README.md +++ b/example/README.md @@ -5,7 +5,7 @@ ```` git clone https://github.com/sbueringer/grafana-consul-datasource.git -cd consul-datasource/example +cd grafana-consul-datasource/example go run main.go ```` diff --git a/example/main.go b/example/main.go index 8079c7e..4f8caf9 100644 --- a/example/main.go +++ b/example/main.go @@ -45,7 +45,7 @@ func startServer() *testutil.TestServer { c.ACLDefaultPolicy = "allow" c.ACLDatacenter = "default" c.ACLMasterToken = "master" - c.LogLevel = "warn" + c.LogLevel = "debug" }) if err != nil { panic(err) diff --git a/src/partials/config.html b/src/partials/config.html index 5d12582..adfb58f 100644 --- a/src/partials/config.html +++ b/src/partials/config.html @@ -9,7 +9,7 @@

Consul

Token + placeholder="CONSUL_TOKEN">
@@ -27,7 +27,8 @@
Consul Address

Consul Token

- Consul Token has to be a valid Consul Token which is able to read the values you want to access. + If Consul Token is set, it has to be a valid Consul Token which is able to read the data you want to access. + If Consul Token is not set, "anonymous' is used (see Consul documentation). If ACLs are disabled in Consul, "anonymous" should be able to read the necessary data. More details can be found in the Consul documentation.