Skip to content

Commit

Permalink
Use prometheus v2.9.2 and tsdb master
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Rabot <[email protected]>
  • Loading branch information
Sylvain Rabot committed May 10, 2019
1 parent 139e6ef commit 6206d92
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 126 deletions.
33 changes: 15 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,21 @@ require (
github.com/fortytw2/leaktest v1.3.0
github.com/fsnotify/fsnotify v1.4.7
github.com/go-kit/kit v0.8.0
github.com/gogo/protobuf v1.2.0
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db
github.com/gogo/protobuf v1.2.1
github.com/golang/snappy v0.0.1
github.com/google/martian v2.1.0+incompatible // indirect
github.com/googleapis/gax-go v2.0.2+incompatible // indirect
github.com/gophercloud/gophercloud v0.0.0-20181206160319-9d88c34913a9
github.com/gophercloud/gophercloud v0.0.0-20190301152420-fca40860790e
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0
github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20181025070259-68e3a13e4117
github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86
github.com/hashicorp/go-sockaddr v1.0.2
github.com/hashicorp/go-version v1.2.0
github.com/hashicorp/golang-lru v0.5.1
github.com/hashicorp/memberlist v0.1.0
github.com/julienschmidt/httprouter v1.1.0 // indirect
github.com/hashicorp/memberlist v0.1.3
github.com/lovoo/gcloud-opentracing v0.3.0
github.com/miekg/dns v1.1.8
github.com/minio/minio-go v0.0.0-20190131015406-c8a261de75c1
github.com/mozillazg/go-cos v0.11.0
github.com/mozillazg/go-cos v0.12.0
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223
github.com/oklog/run v1.0.0
github.com/oklog/ulid v1.3.1
Expand All @@ -33,19 +32,17 @@ require (
github.com/opentracing/basictracer-go v1.0.0
github.com/opentracing/opentracing-go v1.0.2
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v0.9.2
github.com/prometheus/common v0.0.0-20181218105931-67670fe90761
github.com/prometheus/prometheus v0.0.0-20190328180107-4d60eb36dcbe
github.com/prometheus/tsdb v0.6.1
go.opencensus.io v0.19.0 // indirect
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
github.com/prometheus/common v0.3.0
github.com/prometheus/prometheus v0.0.0-20190424153033-d3245f150225
github.com/prometheus/tsdb v0.7.2-0.20190507100016-6ac81cc7a9c5
golang.org/x/net v0.0.0-20190311183353-d8887717615a
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc // indirect
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
google.golang.org/api v0.1.0
google.golang.org/appengine v1.4.0 // indirect
google.golang.org/grpc v1.17.0
google.golang.org/api v0.3.2
google.golang.org/grpc v1.19.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
gopkg.in/yaml.v2 v2.2.2
Expand Down
236 changes: 138 additions & 98 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/block/metadata/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func renameFile(logger log.Logger, from, to string) error {
return err
}

if err = fileutil.Fsync(pdir); err != nil {
if err = fileutil.Fdatasync(pdir); err != nil {
runutil.CloseWithLogOnErr(logger, pdir, "close dir")
return err
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/compact/downsample/downsample.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/prometheus/tsdb"
"github.com/prometheus/tsdb/chunkenc"
"github.com/prometheus/tsdb/chunks"
tsdb_errors "github.com/prometheus/tsdb/errors"
"github.com/prometheus/tsdb/index"
"github.com/prometheus/tsdb/labels"
)
Expand Down Expand Up @@ -63,7 +64,7 @@ func Downsample(
// Remove blockDir in case of errors.
defer func() {
if err != nil {
var merr tsdb.MultiError
var merr tsdb_errors.MultiError
merr.Add(err)
merr.Add(os.RemoveAll(blockDir))
err = merr.Err()
Expand Down
7 changes: 4 additions & 3 deletions pkg/compact/downsample/streamed_block_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/prometheus/tsdb"
"github.com/prometheus/tsdb/chunks"
"github.com/prometheus/tsdb/fileutil"
tsdb_errors "github.com/prometheus/tsdb/errors"
"github.com/prometheus/tsdb/index"
"github.com/prometheus/tsdb/labels"
)
Expand Down Expand Up @@ -83,7 +84,7 @@ func NewStreamedBlockWriter(
// We should close any opened Closer up to an error.
defer func() {
if err != nil {
var merr tsdb.MultiError
var merr tsdb_errors.MultiError
merr.Add(err)
for _, cl := range closers {
merr.Add(cl.Close())
Expand Down Expand Up @@ -169,7 +170,7 @@ func (w *streamedBlockWriter) Close() error {
}
w.finalized = true

merr := tsdb.MultiError{}
merr := tsdb_errors.MultiError{}

if w.ignoreFinalize {
// Close open file descriptors anyway.
Expand Down Expand Up @@ -234,7 +235,7 @@ func (w *streamedBlockWriter) syncDir() (err error) {

defer runutil.CloseWithErrCapture(&err, df, "close temporary block blockDir")

if err := fileutil.Fsync(df); err != nil {
if err := fileutil.Fdatasync(df); err != nil {
return errors.Wrap(err, "sync temporary blockDir")
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/rule/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/pkg/errors"
"github.com/prometheus/prometheus/pkg/rulefmt"
"github.com/prometheus/prometheus/rules"
"github.com/prometheus/tsdb"
tsdb_errors "github.com/prometheus/tsdb/errors"
yaml "gopkg.in/yaml.v2"
)

Expand Down Expand Up @@ -112,7 +112,7 @@ func (r RuleGroup) MarshalYAML() (interface{}, error) {
// special field in RuleGroup file.
func (m *Managers) Update(dataDir string, evalInterval time.Duration, files []string) error {
var (
errs tsdb.MultiError
errs tsdb_errors.MultiError
filesMap = map[storepb.PartialResponseStrategy][]string{}
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/runutil/runutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import (
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/pkg/errors"
"github.com/prometheus/tsdb"
tsdb_errors "github.com/prometheus/tsdb/errors"
)

// Repeat executes f every interval seconds until stopc is closed.
Expand Down Expand Up @@ -111,7 +111,7 @@ func CloseWithLogOnErr(logger log.Logger, closer io.Closer, format string, a ...
// CloseWithErrCapture runs function and on error return error by argument including the given error (usually
// from caller function).
func CloseWithErrCapture(err *error, closer io.Closer, format string, a ...interface{}) {
merr := tsdb.MultiError{}
merr := tsdb_errors.MultiError{}

merr.Add(*err)
merr.Add(errors.Wrapf(closer.Close(), format, a...))
Expand Down
2 changes: 1 addition & 1 deletion pkg/shipper/shipper.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ func renameFile(logger log.Logger, from, to string) error {
return err
}

if err = fileutil.Fsync(pdir); err != nil {
if err = fileutil.Fdatasync(pdir); err != nil {
runutil.CloseWithLogOnErr(logger, pdir, "rename file dir close")
return err
}
Expand Down

0 comments on commit 6206d92

Please sign in to comment.