Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update prometheus fork to 2.30 #460

Merged
merged 5 commits into from
Sep 21, 2021
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16

- name: install
run: GO111MODULE=off go get golang.org/x/tools/cmd/goimports honnef.co/go/tools/cmd/staticcheck
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ imports:

.PHONY: test
test:
GO111MODULE=on $(GO) test -mod=vendor -tags netgo,builtinassets -v ./...
GO111MODULE=on $(GO) test -mod=vendor -tags netgo,builtinassets ./...

.PHONY: release
release:
Expand Down
21 changes: 10 additions & 11 deletions cmd/promxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
"github.com/prometheus/common/model"
"github.com/prometheus/common/promlog"
"github.com/prometheus/common/version"
Expand Down Expand Up @@ -319,7 +318,7 @@ func main() {
}
files = append(files, fs...)
}
if err := ruleManager.Update(time.Duration(cfg.GlobalConfig.EvaluationInterval), files, cfg.GlobalConfig.ExternalLabels); err != nil {
if err := ruleManager.Update(time.Duration(cfg.GlobalConfig.EvaluationInterval), files, cfg.GlobalConfig.ExternalLabels, externalUrl.String()); err != nil {
return err
}

Expand All @@ -341,7 +340,7 @@ func main() {
}}))

// We need an empty scrape manager, simply to make the API not panic and error out
scrapeManager := scrape.NewManager(kitlog.With(logger, "component", "scrape manager"), nil)
scrapeManager := scrape.NewManager(nil, kitlog.With(logger, "component", "scrape manager"), nil)

webOptions := &web.Options{
Registerer: prometheus.DefaultRegisterer,
Expand Down Expand Up @@ -442,33 +441,33 @@ func main() {
for {
select {
case rc := <-webHandler.Reload():
log.Infof("Reloading config")
logrus.Infof("Reloading config")
if err := reloadConfig(noStepSubqueryInterval, reloadables...); err != nil {
log.Errorf("Error reloading config: %s", err)
logrus.Errorf("Error reloading config: %s", err)
rc <- err
} else {
rc <- nil
}
case sig := <-sigs:
switch sig {
case syscall.SIGHUP:
log.Infof("Reloading config")
logrus.Infof("Reloading config")
if err := reloadConfig(noStepSubqueryInterval, reloadables...); err != nil {
log.Errorf("Error reloading config: %s", err)
logrus.Errorf("Error reloading config: %s", err)
}
case syscall.SIGTERM, syscall.SIGINT:
log.Info("promxy received exit signal, starting graceful shutdown")
logrus.Info("promxy received exit signal, starting graceful shutdown")

// Stop all services we are running
stopping = true // start failing healthchecks
notifierManager.Stop() // stop alert notifier
ruleManager.Stop() // Stop rule manager

if opts.ShutdownDelay > 0 {
log.Infof("promxy delaying shutdown by %v", opts.ShutdownDelay)
logrus.Infof("promxy delaying shutdown by %v", opts.ShutdownDelay)
time.Sleep(opts.ShutdownDelay)
}
log.Infof("promxy exiting with timeout: %v", opts.ShutdownTimeout)
logrus.Infof("promxy exiting with timeout: %v", opts.ShutdownTimeout)
defer cancel()
if opts.ShutdownTimeout > 0 {
ctx, cancel = context.WithTimeout(ctx, opts.ShutdownTimeout)
Expand All @@ -477,7 +476,7 @@ func main() {
srv.Shutdown(ctx)
return
default:
log.Errorf("Uncaught signal: %v", sig)
logrus.Errorf("Uncaught signal: %v", sig)
}

}
Expand Down
26 changes: 13 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ module github.com/jacksontj/promxy
go 1.13

require (
github.com/Azure/go-autorest/autorest v0.11.15
github.com/Azure/go-autorest/autorest v0.11.20
github.com/go-kit/kit v0.10.0
github.com/gogo/protobuf v1.3.1
github.com/gogo/protobuf v1.3.2
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/snappy v0.0.2
github.com/jessevdk/go-flags v1.4.0
github.com/golang/snappy v0.0.4
github.com/jessevdk/go-flags v1.5.0
github.com/julienschmidt/httprouter v1.3.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.9.0
github.com/prometheus/client_golang v1.11.1-0.20210607165600-196536534fbb
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.15.0
github.com/prometheus/exporter-toolkit v0.5.1
github.com/prometheus/prometheus v1.8.1-0.20200513230854-c784807932c2
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.6.1
go.uber.org/atomic v1.7.0
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324
github.com/prometheus/common v0.30.0
github.com/prometheus/exporter-toolkit v0.6.1
github.com/prometheus/prometheus v1.8.2-0.20210707132820-dc8f50559534
github.com/sirupsen/logrus v1.7.0
github.com/stretchr/testify v1.7.0
go.uber.org/atomic v1.9.0
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
gopkg.in/yaml.v2 v2.4.0
k8s.io/klog v1.0.0
)

replace github.com/prometheus/prometheus => github.com/jacksontj/prometheus v1.8.1-0.20210816231554-929ddf93a7db
replace github.com/prometheus/prometheus => github.com/jacksontj/prometheus v1.8.1-0.20210917180120-0c8fa0a92ce8

replace github.com/golang/glog => github.com/kubermatic/glog-gokit v0.0.0-20181129151237-8ab7e4c2d352

Expand Down
Loading