Skip to content

Commit 5eaa284

Browse files
authored
Merge pull request #27 from chatwork/bump_go_and_library
Bump go and library
2 parents 54112a1 + 73d2b0f commit 5eaa284

File tree

7 files changed

+331
-245
lines changed

7 files changed

+331
-245
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ linters-settings:
66

77
run:
88
deadline: 1m
9-
go: '1.15'
9+
go: '1.18'
1010

1111
issues:
1212
exclude:

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.15.4-alpine3.12 as build
1+
FROM golang:1.18.2 as build
22

33
COPY ./ /go/src/github.com/chatwork/sendgrid-stats-exporter
44
WORKDIR /go/src/github.com/chatwork/sendgrid-stats-exporter
@@ -7,12 +7,12 @@ RUN go mod download \
77
# && go test ./... \
88
&& CGO_ENABLED=0 GOOS=linux go build -o /bin/exporter
99

10-
FROM alpine:3.12
10+
FROM alpine:3.15
1111

1212
RUN apk --no-cache add ca-certificates \
1313
&& addgroup exporter \
1414
&& adduser -S -G exporter exporter
1515
USER exporter
1616
COPY --from=build /bin/exporter /bin/exporter
1717

18-
ENTRYPOINT [ "/bin/exporter" ]
18+
ENTRYPOINT [ "/bin/exporter" ]

collect.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package main
33
import (
44
"time"
55

6-
"github.com/go-kit/kit/log"
7-
"github.com/go-kit/kit/log/level"
8-
"github.com/prometheus/client_golang/prometheus"
6+
"github.com/go-kit/log"
7+
"github.com/go-kit/log/level"
98
"github.com/jinzhu/now"
9+
"github.com/prometheus/client_golang/prometheus"
1010
)
1111

1212
type Collector struct {

go.mod

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
module github.com/chatwork/sendgrid-stats-exporter
22

3-
go 1.15
3+
go 1.18
44

55
require (
6-
github.com/go-kit/kit v0.10.0
7-
github.com/prometheus/client_golang v1.8.0
8-
github.com/prometheus/common v0.14.0
6+
github.com/go-kit/kit v0.12.0
7+
github.com/jinzhu/now v1.1.5
8+
github.com/prometheus/client_golang v1.12.2
9+
github.com/prometheus/common v0.34.0
910
gopkg.in/alecthomas/kingpin.v2 v2.2.6
10-
mvdan.cc/gofumpt v0.0.0-20201107090320-a024667a00f1 // indirect
11+
)
12+
13+
require (
14+
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
15+
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
16+
github.com/beorn7/perks v1.0.1 // indirect
17+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
18+
github.com/go-kit/log v0.2.0 // indirect
19+
github.com/go-logfmt/logfmt v0.5.1 // indirect
20+
github.com/golang/protobuf v1.5.2 // indirect
21+
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
22+
github.com/prometheus/client_model v0.2.0 // indirect
23+
github.com/prometheus/procfs v0.7.3 // indirect
24+
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
25+
google.golang.org/protobuf v1.27.1 // indirect
1126
)

go.sum

Lines changed: 298 additions & 227 deletions
Large diffs are not rendered by default.

main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package main
22

33
import (
44
"context"
5+
"github.com/prometheus/client_golang/prometheus/collectors"
56
"net/http"
67
"os"
78
"os/signal"
89
"syscall"
910
"time"
1011

11-
"github.com/go-kit/kit/log/level"
12+
"github.com/go-kit/log/level"
1213
"github.com/prometheus/client_golang/prometheus"
1314
"github.com/prometheus/client_golang/prometheus/promhttp"
1415
"github.com/prometheus/common/promlog"
@@ -56,7 +57,6 @@ var (
5657
"sendgrid.accumulated-metrics",
5758
"[Optional] Accumulated SendGrid Metrics by month, to calculate monthly email limit.",
5859
).Default("False").Envar("SENDGRID_ACCUMULATED_METRICS").Bool()
59-
6060
)
6161

6262
func main() {
@@ -75,13 +75,13 @@ func main() {
7575

7676
collector := collector(logger)
7777
prometheus.MustRegister(collector)
78-
prometheus.Unregister(prometheus.NewGoCollector())
78+
prometheus.Unregister(collectors.NewGoCollector())
7979
registry := prometheus.NewRegistry()
8080

8181
if !*disableExporterMetrics {
8282
registry.MustRegister(
83-
prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}),
84-
prometheus.NewGoCollector(),
83+
collectors.NewProcessCollector(collectors.ProcessCollectorOpts{}),
84+
collectors.NewGoCollector(),
8585
)
8686
}
8787

scripts/errcheck_excludes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
(net/http.ResponseWriter).Write
33

44
// Never check for logger errors.
5-
(github.com/go-kit/kit/log.Logger).Log
5+
(github.com/go-kit/log.Logger).Log

0 commit comments

Comments
 (0)