Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
09b9b595
Commit
09b9b595
authored
Mar 15, 2019
by
Andrej Ocenas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add check for Env before log
parent
96af051c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
+12
-3
pkg/tsdb/mssql/mssql.go
+4
-1
pkg/tsdb/mysql/mysql.go
+4
-1
pkg/tsdb/postgres/postgres.go
+4
-1
No files found.
pkg/tsdb/mssql/mssql.go
View file @
09b9b595
...
@@ -3,6 +3,7 @@ package mssql
...
@@ -3,6 +3,7 @@ package mssql
import
(
import
(
"database/sql"
"database/sql"
"fmt"
"fmt"
"github.com/grafana/grafana/pkg/setting"
"strconv"
"strconv"
_
"github.com/denisenkom/go-mssqldb"
_
"github.com/denisenkom/go-mssqldb"
...
@@ -24,7 +25,9 @@ func newMssqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin
...
@@ -24,7 +25,9 @@ func newMssqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
logger
.
Debug
(
"getEngine"
,
"connection"
,
cnnstr
)
if
setting
.
Env
==
setting
.
DEV
{
logger
.
Debug
(
"getEngine"
,
"connection"
,
cnnstr
)
}
config
:=
tsdb
.
SqlQueryEndpointConfiguration
{
config
:=
tsdb
.
SqlQueryEndpointConfiguration
{
DriverName
:
"mssql"
,
DriverName
:
"mssql"
,
...
...
pkg/tsdb/mysql/mysql.go
View file @
09b9b595
...
@@ -3,6 +3,7 @@ package mysql
...
@@ -3,6 +3,7 @@ package mysql
import
(
import
(
"database/sql"
"database/sql"
"fmt"
"fmt"
"github.com/grafana/grafana/pkg/setting"
"reflect"
"reflect"
"strconv"
"strconv"
"strings"
"strings"
...
@@ -44,7 +45,9 @@ func newMysqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin
...
@@ -44,7 +45,9 @@ func newMysqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin
cnnstr
+=
"&tls="
+
tlsConfigString
cnnstr
+=
"&tls="
+
tlsConfigString
}
}
logger
.
Debug
(
"getEngine"
,
"connection"
,
cnnstr
)
if
setting
.
Env
==
setting
.
DEV
{
logger
.
Debug
(
"getEngine"
,
"connection"
,
cnnstr
)
}
config
:=
tsdb
.
SqlQueryEndpointConfiguration
{
config
:=
tsdb
.
SqlQueryEndpointConfiguration
{
DriverName
:
"mysql"
,
DriverName
:
"mysql"
,
...
...
pkg/tsdb/postgres/postgres.go
View file @
09b9b595
...
@@ -2,6 +2,7 @@ package postgres
...
@@ -2,6 +2,7 @@ package postgres
import
(
import
(
"database/sql"
"database/sql"
"github.com/grafana/grafana/pkg/setting"
"net/url"
"net/url"
"strconv"
"strconv"
...
@@ -19,7 +20,9 @@ func newPostgresQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndp
...
@@ -19,7 +20,9 @@ func newPostgresQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndp
logger
:=
log
.
New
(
"tsdb.postgres"
)
logger
:=
log
.
New
(
"tsdb.postgres"
)
cnnstr
:=
generateConnectionString
(
datasource
)
cnnstr
:=
generateConnectionString
(
datasource
)
logger
.
Debug
(
"getEngine"
,
"connection"
,
cnnstr
)
if
setting
.
Env
==
setting
.
DEV
{
logger
.
Debug
(
"getEngine"
,
"connection"
,
cnnstr
)
}
config
:=
tsdb
.
SqlQueryEndpointConfiguration
{
config
:=
tsdb
.
SqlQueryEndpointConfiguration
{
DriverName
:
"postgres"
,
DriverName
:
"postgres"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment