Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17 AS builder
FROM golang:1.22 AS builder
WORKDIR /app
ENV CGO_ENABLED=0
COPY go.* ./
Expand Down
3 changes: 2 additions & 1 deletion cmd/sql_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
log "github.com/golang/glog"
"github.com/nxcc/sql_exporter"
"github.com/prometheus/client_golang/prometheus"
version_collector "github.com/prometheus/client_golang/prometheus/collectors/version"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/version"
)
Expand All @@ -24,7 +25,7 @@ var (
)

func init() {
prometheus.MustRegister(version.NewCollector("sql_exporter"))
prometheus.MustRegister(version_collector.NewCollector("sql_exporter"))
}

func main() {
Expand Down
5 changes: 3 additions & 2 deletions exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import (
"fmt"
"sync"

"github.com/nxcc/sql_exporter/config"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"

"github.com/nxcc/sql_exporter/config"
)

var dsnOverride = flag.String("config.data-source-name", "", "Data source name to override the value in the configuration file with.")
Expand Down
32 changes: 17 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
module github.com/nxcc/sql_exporter

go 1.17
go 1.22

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

require (
github.com/denisenkom/go-mssqldb v0.12.0
github.com/go-sql-driver/mysql v1.6.0
github.com/golang/glog v1.0.0
github.com/golang/protobuf v1.5.2
github.com/lib/pq v1.10.4
github.com/prometheus/client_golang v1.12.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.33.0
github.com/denisenkom/go-mssqldb v0.12.3
github.com/go-sql-driver/mysql v1.8.1
github.com/golang/glog v1.2.4
github.com/lib/pq v1.10.9
github.com/prometheus/client_golang v1.20.5
github.com/prometheus/client_model v0.6.1
github.com/prometheus/common v0.62.0
google.golang.org/protobuf v1.36.1
gopkg.in/yaml.v2 v2.4.0
)

require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/sys v0.28.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
)
562 changes: 47 additions & 515 deletions go.sum

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"fmt"
"sort"

"github.com/nxcc/sql_exporter/config"
"github.com/nxcc/sql_exporter/errors"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"

"github.com/nxcc/sql_exporter/config"
"github.com/nxcc/sql_exporter/errors"
)

// MetricDesc is a descriptor for a family of metrics, sharing the same name, help, labes, type.
Expand Down
7 changes: 4 additions & 3 deletions target.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import (
"sync"
"time"

"github.com/nxcc/sql_exporter/config"
"github.com/nxcc/sql_exporter/errors"
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
"github.com/prometheus/client_golang/prometheus"
dto "github.com/prometheus/client_model/go"

"github.com/nxcc/sql_exporter/config"
"github.com/nxcc/sql_exporter/errors"
)

const (
Expand Down