File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ type Config struct {
55
55
User string
56
56
Password string
57
57
ConnectString string
58
- DbRole string
58
+ DbRole dsn. AdminRole
59
59
ConfigDir string
60
60
ExternalAuth bool
61
61
MaxIdleConns int
@@ -402,7 +402,7 @@ func (e *Exporter) connect() error {
402
402
// if TNS_ADMIN env var is set, set ConfigDir to that location
403
403
P .ConfigDir = e .configDir
404
404
405
- switch strings . ToUpper ( e .config .DbRole ) {
405
+ switch e .config .DbRole {
406
406
case "SYSDBA" :
407
407
P .AdminRole = dsn .SysDBA
408
408
case "SYSOPER" :
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import (
13
13
"time"
14
14
15
15
"github.com/go-kit/log/level"
16
+ "github.com/godror/godror/dsn"
16
17
"github.com/prometheus/client_golang/prometheus"
17
18
cversion "github.com/prometheus/client_golang/prometheus/collectors/version"
18
19
"github.com/prometheus/client_golang/prometheus/promhttp"
@@ -87,9 +88,9 @@ func main() {
87
88
User : user ,
88
89
Password : password ,
89
90
ConnectString : connectString ,
90
- DbRole : dbrole ,
91
+ DbRole : dsn . AdminRole ( dbrole ) ,
91
92
ConfigDir : tnsadmin ,
92
- ExternalAuth : externalAuth ,
93
+ ExternalAuth : externalAuth ,
93
94
MaxOpenConns : * maxOpenConns ,
94
95
MaxIdleConns : * maxIdleConns ,
95
96
CustomMetrics : * customMetrics ,
You can’t perform that action at this time.
0 commit comments