Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit f155a07

Browse files
committed
feat: upgrade everything
Signed-off-by: Yoan Blanc <[email protected]>
1 parent 677a6a4 commit f155a07

File tree

7 files changed

+78
-540
lines changed

7 files changed

+78
-540
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.17 AS builder
1+
FROM golang:1.22 AS builder
22
WORKDIR /app
33
ENV CGO_ENABLED=0
44
COPY go.* ./

cmd/sql_exporter/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
log "github.com/golang/glog"
1313
"github.com/nxcc/sql_exporter"
1414
"github.com/prometheus/client_golang/prometheus"
15+
version_collector "github.com/prometheus/client_golang/prometheus/collectors/version"
1516
"github.com/prometheus/client_golang/prometheus/promhttp"
1617
"github.com/prometheus/common/version"
1718
)
@@ -24,7 +25,7 @@ var (
2425
)
2526

2627
func init() {
27-
prometheus.MustRegister(version.NewCollector("sql_exporter"))
28+
prometheus.MustRegister(version_collector.NewCollector("sql_exporter"))
2829
}
2930

3031
func main() {

exporter.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ import (
66
"fmt"
77
"sync"
88

9-
"github.com/nxcc/sql_exporter/config"
10-
"github.com/golang/protobuf/proto"
9+
"google.golang.org/protobuf/proto"
1110
"github.com/prometheus/client_golang/prometheus"
1211
dto "github.com/prometheus/client_model/go"
12+
13+
"github.com/nxcc/sql_exporter/config"
1314
)
1415

1516
var dsnOverride = flag.String("config.data-source-name", "", "Data source name to override the value in the configuration file with.")

go.mod

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
module github.com/nxcc/sql_exporter
22

3-
go 1.17
3+
go 1.22
44

5-
replace github.com/nxcc/sql_exporter => github.com/edgelaboratories/sql_exporter v0.0.0-20220315080726-d3e3bf9dd024
5+
replace github.com/nxcc/sql_exporter => github.com/edgelaboratories/sql_exporter v0.0.0-20241217073950-677a6a47a375
66

77
require (
8-
github.com/denisenkom/go-mssqldb v0.12.0
9-
github.com/go-sql-driver/mysql v1.6.0
10-
github.com/golang/glog v1.0.0
11-
github.com/golang/protobuf v1.5.2
12-
github.com/lib/pq v1.10.4
13-
github.com/prometheus/client_golang v1.12.1
14-
github.com/prometheus/client_model v0.2.0
15-
github.com/prometheus/common v0.33.0
8+
github.com/denisenkom/go-mssqldb v0.12.3
9+
github.com/go-sql-driver/mysql v1.8.1
10+
github.com/golang/glog v1.2.4
11+
github.com/lib/pq v1.10.9
12+
github.com/prometheus/client_golang v1.20.5
13+
github.com/prometheus/client_model v0.6.1
14+
github.com/prometheus/common v0.62.0
15+
google.golang.org/protobuf v1.36.1
1616
gopkg.in/yaml.v2 v2.4.0
1717
)
1818

1919
require (
20+
filippo.io/edwards25519 v1.1.0 // indirect
2021
github.com/beorn7/perks v1.0.1 // indirect
21-
github.com/cespare/xxhash/v2 v2.1.2 // indirect
22+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2223
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
23-
github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 // indirect
24-
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
25-
github.com/prometheus/procfs v0.7.3 // indirect
24+
github.com/golang-sql/sqlexp v0.1.0 // indirect
25+
github.com/klauspost/compress v1.17.9 // indirect
26+
github.com/kr/text v0.2.0 // indirect
27+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
28+
github.com/prometheus/procfs v0.15.1 // indirect
2629
golang.org/x/crypto v0.31.0 // indirect
2730
golang.org/x/sys v0.28.0 // indirect
28-
google.golang.org/protobuf v1.33.0 // indirect
2931
)

go.sum

Lines changed: 47 additions & 515 deletions
Large diffs are not rendered by default.

metric.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"fmt"
55
"sort"
66

7-
"github.com/nxcc/sql_exporter/config"
8-
"github.com/nxcc/sql_exporter/errors"
9-
"github.com/golang/protobuf/proto"
7+
"google.golang.org/protobuf/proto"
108
"github.com/prometheus/client_golang/prometheus"
119
dto "github.com/prometheus/client_model/go"
10+
11+
"github.com/nxcc/sql_exporter/config"
12+
"github.com/nxcc/sql_exporter/errors"
1213
)
1314

1415
// MetricDesc is a descriptor for a family of metrics, sharing the same name, help, labes, type.

target.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ import (
99
"sync"
1010
"time"
1111

12-
"github.com/nxcc/sql_exporter/config"
13-
"github.com/nxcc/sql_exporter/errors"
14-
"github.com/golang/protobuf/proto"
12+
"google.golang.org/protobuf/proto"
1513
"github.com/prometheus/client_golang/prometheus"
1614
dto "github.com/prometheus/client_model/go"
15+
16+
"github.com/nxcc/sql_exporter/config"
17+
"github.com/nxcc/sql_exporter/errors"
1718
)
1819

1920
const (

0 commit comments

Comments
 (0)