diff --git a/CHANGELOG.md b/CHANGELOG.md index 490954554a1..1f09ead1fe3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * **Cache**: Adds support for using out of proc caching in the backend [#10816](https://github.com/grafana/grafana/issues/10816) * **Dataproxy**: Make it possible to add user details to requests sent to the dataproxy [#6359](https://github.com/grafana/grafana/issues/6359) and [#15931](https://github.com/grafana/grafana/issues/15931) * **Auth**: Support listing and revoking auth tokens via API [#15836](https://github.com/grafana/grafana/issues/15836) +* **Datasource**: Only log connection string in dev environment [#16001](https://github.com/grafana/grafana/issues/16001) ### Bug Fixes * **Api**: Invalid org invite code [#10506](https://github.com/grafana/grafana/issues/10506) diff --git a/pkg/tsdb/mssql/mssql.go b/pkg/tsdb/mssql/mssql.go index 12f2b6c03c9..c740d6cbe77 100644 --- a/pkg/tsdb/mssql/mssql.go +++ b/pkg/tsdb/mssql/mssql.go @@ -3,6 +3,7 @@ package mssql import ( "database/sql" "fmt" + "github.com/grafana/grafana/pkg/setting" "strconv" _ "github.com/denisenkom/go-mssqldb" @@ -24,7 +25,9 @@ func newMssqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin if err != nil { return nil, err } - logger.Debug("getEngine", "connection", cnnstr) + if setting.Env == setting.DEV { + logger.Debug("getEngine", "connection", cnnstr) + } config := tsdb.SqlQueryEndpointConfiguration{ DriverName: "mssql", diff --git a/pkg/tsdb/mysql/mysql.go b/pkg/tsdb/mysql/mysql.go index d307e12166c..0451f8f0dc1 100644 --- a/pkg/tsdb/mysql/mysql.go +++ b/pkg/tsdb/mysql/mysql.go @@ -3,6 +3,7 @@ package mysql import ( "database/sql" "fmt" + "github.com/grafana/grafana/pkg/setting" "reflect" "strconv" "strings" @@ -44,7 +45,9 @@ func newMysqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin cnnstr += "&tls=" + tlsConfigString } - logger.Debug("getEngine", "connection", cnnstr) + if setting.Env == setting.DEV { + logger.Debug("getEngine", "connection", cnnstr) + } config := tsdb.SqlQueryEndpointConfiguration{ DriverName: "mysql", diff --git a/pkg/tsdb/postgres/postgres.go b/pkg/tsdb/postgres/postgres.go index 4bcf06638f4..ae6b165e731 100644 --- a/pkg/tsdb/postgres/postgres.go +++ b/pkg/tsdb/postgres/postgres.go @@ -2,6 +2,7 @@ package postgres import ( "database/sql" + "github.com/grafana/grafana/pkg/setting" "net/url" "strconv" @@ -19,7 +20,9 @@ func newPostgresQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndp logger := log.New("tsdb.postgres") cnnstr := generateConnectionString(datasource) - logger.Debug("getEngine", "connection", cnnstr) + if setting.Env == setting.DEV { + logger.Debug("getEngine", "connection", cnnstr) + } config := tsdb.SqlQueryEndpointConfiguration{ DriverName: "postgres",