From 4d1d1360d7b0bdaca1357a56d92ab11a11b423c4 Mon Sep 17 00:00:00 2001 From: jojohappy Date: Wed, 25 Mar 2020 17:13:33 +0800 Subject: [PATCH] Fixed inconsistent metrics and methods Signed-off-by: jojohappy --- cmd/thanos/bucket.go | 2 +- cmd/thanos/compact.go | 2 +- cmd/thanos/downsample.go | 2 +- cmd/thanos/query.go | 2 +- cmd/thanos/receive.go | 3 ++- cmd/thanos/rule.go | 2 +- cmd/thanos/sidecar.go | 3 ++- cmd/thanos/store.go | 2 +- pkg/replicate/replicator.go | 3 ++- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cmd/thanos/bucket.go b/cmd/thanos/bucket.go index 9eaf8d2ce5..8034450dc2 100644 --- a/cmd/thanos/bucket.go +++ b/cmd/thanos/bucket.go @@ -334,7 +334,7 @@ func registerBucketWeb(m map[string]setupFunc, root *kingpin.CmdClause, name str httpProbe := prober.NewHTTP() statusProber := prober.Combine( httpProbe, - prober.NewInstrumentation(comp, logger, prometheus.WrapRegistererWithPrefix("thanos_", reg)), + prober.NewInstrumentation(comp, logger, extprom.WrapRegistererWithPrefix("thanos_", reg)), ) srv := httpserver.New(logger, reg, comp, httpProbe, diff --git a/cmd/thanos/compact.go b/cmd/thanos/compact.go index e926b6fa4e..e356131d31 100644 --- a/cmd/thanos/compact.go +++ b/cmd/thanos/compact.go @@ -227,7 +227,7 @@ func runCompact( httpProbe := prober.NewHTTP() statusProber := prober.Combine( httpProbe, - prober.NewInstrumentation(component, logger, prometheus.WrapRegistererWithPrefix("thanos_", reg)), + prober.NewInstrumentation(component, logger, extprom.WrapRegistererWithPrefix("thanos_", reg)), ) srv := httpserver.New(logger, reg, component, httpProbe, diff --git a/cmd/thanos/downsample.go b/cmd/thanos/downsample.go index 293ef59adf..f10c9ca97a 100644 --- a/cmd/thanos/downsample.go +++ b/cmd/thanos/downsample.go @@ -87,7 +87,7 @@ func RunDownsample( httpProbe := prober.NewHTTP() statusProber := prober.Combine( httpProbe, - prober.NewInstrumentation(comp, logger, prometheus.WrapRegistererWithPrefix("thanos_", reg)), + prober.NewInstrumentation(comp, logger, extprom.WrapRegistererWithPrefix("thanos_", reg)), ) metrics := newDownsampleMetrics(reg) diff --git a/cmd/thanos/query.go b/cmd/thanos/query.go index 0d687b02e1..ed266904e7 100644 --- a/cmd/thanos/query.go +++ b/cmd/thanos/query.go @@ -318,7 +318,7 @@ func runQuery( statusProber := prober.Combine( httpProbe, grpcProbe, - prober.NewInstrumentation(comp, logger, reg), + prober.NewInstrumentation(comp, logger, extprom.WrapRegistererWithPrefix("thanos_", reg)), ) // Start query API + UI HTTP server. diff --git a/cmd/thanos/receive.go b/cmd/thanos/receive.go index 59db2ed840..2296e4649e 100644 --- a/cmd/thanos/receive.go +++ b/cmd/thanos/receive.go @@ -24,6 +24,7 @@ import ( "github.com/thanos-io/thanos/pkg/component" "github.com/thanos-io/thanos/pkg/extflag" "github.com/thanos-io/thanos/pkg/extgrpc" + "github.com/thanos-io/thanos/pkg/extprom" "github.com/thanos-io/thanos/pkg/objstore/client" "github.com/thanos-io/thanos/pkg/prober" "github.com/thanos-io/thanos/pkg/receive" @@ -212,7 +213,7 @@ func runReceive( statusProber := prober.Combine( httpProbe, grpcProbe, - prober.NewInstrumentation(comp, logger, prometheus.WrapRegistererWithPrefix("thanos_", reg)), + prober.NewInstrumentation(comp, logger, extprom.WrapRegistererWithPrefix("thanos_", reg)), ) confContentYaml, err := objStoreConfig.Content() diff --git a/cmd/thanos/rule.go b/cmd/thanos/rule.go index cdcf3c3ae1..e3186eb53c 100644 --- a/cmd/thanos/rule.go +++ b/cmd/thanos/rule.go @@ -522,7 +522,7 @@ func runRule( statusProber := prober.Combine( httpProbe, grpcProbe, - prober.NewInstrumentation(comp, logger, prometheus.WrapRegistererWithPrefix("thanos_", reg)), + prober.NewInstrumentation(comp, logger, extprom.WrapRegistererWithPrefix("thanos_", reg)), ) // Start gRPC server. diff --git a/cmd/thanos/sidecar.go b/cmd/thanos/sidecar.go index 3024b1a716..caed499963 100644 --- a/cmd/thanos/sidecar.go +++ b/cmd/thanos/sidecar.go @@ -24,6 +24,7 @@ import ( "github.com/thanos-io/thanos/pkg/component" "github.com/thanos-io/thanos/pkg/extflag" "github.com/thanos-io/thanos/pkg/exthttp" + "github.com/thanos-io/thanos/pkg/extprom" thanosmodel "github.com/thanos-io/thanos/pkg/model" "github.com/thanos-io/thanos/pkg/objstore/client" "github.com/thanos-io/thanos/pkg/prober" @@ -163,7 +164,7 @@ func runSidecar( statusProber := prober.Combine( httpProbe, grpcProbe, - prober.NewInstrumentation(comp, logger, prometheus.WrapRegistererWithPrefix("thanos_", reg)), + prober.NewInstrumentation(comp, logger, extprom.WrapRegistererWithPrefix("thanos_", reg)), ) srv := httpserver.New(logger, reg, comp, httpProbe, diff --git a/cmd/thanos/store.go b/cmd/thanos/store.go index 7a4f88a038..55e52661ff 100644 --- a/cmd/thanos/store.go +++ b/cmd/thanos/store.go @@ -168,7 +168,7 @@ func runStore( statusProber := prober.Combine( httpProbe, grpcProbe, - prober.NewInstrumentation(component, logger, prometheus.WrapRegistererWithPrefix("thanos_", reg)), + prober.NewInstrumentation(component, logger, extprom.WrapRegistererWithPrefix("thanos_", reg)), ) srv := httpserver.New(logger, reg, component, httpProbe, diff --git a/pkg/replicate/replicator.go b/pkg/replicate/replicator.go index 1e674fa6a4..187726b41c 100644 --- a/pkg/replicate/replicator.go +++ b/pkg/replicate/replicator.go @@ -24,6 +24,7 @@ import ( "github.com/thanos-io/thanos/pkg/compact" "github.com/thanos-io/thanos/pkg/component" "github.com/thanos-io/thanos/pkg/extflag" + "github.com/thanos-io/thanos/pkg/extprom" "github.com/thanos-io/thanos/pkg/objstore/client" "github.com/thanos-io/thanos/pkg/prober" "github.com/thanos-io/thanos/pkg/runutil" @@ -81,7 +82,7 @@ func RunReplicate( httpProbe := prober.NewHTTP() statusProber := prober.Combine( httpProbe, - prober.NewInstrumentation(component.Replicate, logger, prometheus.WrapRegistererWithPrefix("thanos_", reg)), + prober.NewInstrumentation(component.Replicate, logger, extprom.WrapRegistererWithPrefix("thanos_", reg)), ) s := http.New(logger, reg, component.Replicate, httpProbe,