Skip to content

Commit 5082b13

Browse files
author
zhongming Fan
committed
sybase: support sybase dsn
1 parent 23721ec commit 5082b13

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

exporter.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import (
55
"errors"
66
"flag"
77
"fmt"
8-
"github.com/go-sql-driver/mysql"
9-
"github.com/prometheus/common/model"
108
"strconv"
119
"strings"
1210
"sync"
1311
"time"
1412

13+
"github.com/go-sql-driver/mysql"
14+
"github.com/prometheus/common/model"
15+
1516
"github.com/burningalchemist/sql_exporter/config"
1617
"github.com/prometheus/client_golang/prometheus"
1718
dto "github.com/prometheus/client_model/go"
@@ -108,6 +109,8 @@ func NewExporter(configFile string, collectorFile string) (Exporter, error) {
108109
*dsnOverride = fmt.Sprintf("dm://%s", commonDSN)
109110
case "kingbase": // 人大金仓数据库
110111
*dsnOverride = fmt.Sprintf("kingbase://%s/%s?sslmode=disable&connect_timeout=%s", commonDSN, dbName, timeout)
112+
case "sybase": //
113+
*dsnOverride = fmt.Sprintf("tds://%s", commonDSN)
111114
default:
112115
return nil, fmt.Errorf("unsupported database type: %s", dbType)
113116
}

0 commit comments

Comments
 (0)