From b7bdf6fab224e0a1126454b62bb30246acc2d2e0 Mon Sep 17 00:00:00 2001 From: Mateusz Gozdek Date: Fri, 22 Oct 2021 10:19:38 +0200 Subject: [PATCH] Fix imports formatting According to https://github.com/prometheus/prometheus/commit/282990880615ab698fe9583b21ae52e19c333f46#r58457095. Signed-off-by: Mateusz Gozdek --- cmd/promtool/backfill.go | 1 + cmd/promtool/backfill_test.go | 3 ++- cmd/promtool/main_test.go | 3 ++- cmd/promtool/rules.go | 1 + cmd/promtool/rules_test.go | 3 ++- cmd/promtool/sd_test.go | 1 + cmd/promtool/tsdb.go | 3 +-- discovery/http/http_test.go | 3 ++- discovery/kubernetes/endpoints.go | 3 +-- discovery/moby/docker.go | 1 + discovery/moby/network.go | 1 + discovery/puppetdb/puppetdb_test.go | 3 ++- discovery/puppetdb/resources.go | 1 + discovery/scaleway/baremetal.go | 5 +++-- discovery/scaleway/instance.go | 5 +++-- discovery/scaleway/scaleway.go | 3 ++- promql/parser/printer_test.go | 4 ++-- storage/remote/metadata_watcher.go | 1 + storage/remote/metadata_watcher_test.go | 3 ++- storage/remote/queue_manager.go | 4 ++-- storage/remote/read_handler.go | 2 +- tsdb/agent/db.go | 3 ++- tsdb/agent/db_test.go | 3 ++- tsdb/exemplar.go | 1 + tsdb/exemplar_test.go | 2 +- tsdb/head_wal.go | 11 +++++------ 26 files changed, 45 insertions(+), 29 deletions(-) diff --git a/cmd/promtool/backfill.go b/cmd/promtool/backfill.go index b626743de..6cd8fd1f3 100644 --- a/cmd/promtool/backfill.go +++ b/cmd/promtool/backfill.go @@ -21,6 +21,7 @@ import ( "github.com/go-kit/log" "github.com/pkg/errors" + "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/pkg/textparse" "github.com/prometheus/prometheus/tsdb" diff --git a/cmd/promtool/backfill_test.go b/cmd/promtool/backfill_test.go index 4bbb5602c..932d00cca 100644 --- a/cmd/promtool/backfill_test.go +++ b/cmd/promtool/backfill_test.go @@ -22,10 +22,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb" - "github.com/stretchr/testify/require" ) type backfillSample struct { diff --git a/cmd/promtool/main_test.go b/cmd/promtool/main_test.go index 138548fc7..0c2eb26d7 100644 --- a/cmd/promtool/main_test.go +++ b/cmd/promtool/main_test.go @@ -21,9 +21,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/pkg/rulefmt" - "github.com/stretchr/testify/require" ) func TestQueryRange(t *testing.T) { diff --git a/cmd/promtool/rules.go b/cmd/promtool/rules.go index ff98e80d8..e05f5ca7a 100644 --- a/cmd/promtool/rules.go +++ b/cmd/promtool/rules.go @@ -23,6 +23,7 @@ import ( "github.com/pkg/errors" v1 "github.com/prometheus/client_golang/api/prometheus/v1" "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/pkg/timestamp" "github.com/prometheus/prometheus/rules" diff --git a/cmd/promtool/rules_test.go b/cmd/promtool/rules_test.go index 868dff984..6e51785ed 100644 --- a/cmd/promtool/rules_test.go +++ b/cmd/promtool/rules_test.go @@ -25,9 +25,10 @@ import ( "github.com/go-kit/log" v1 "github.com/prometheus/client_golang/api/prometheus/v1" "github.com/prometheus/common/model" + "github.com/stretchr/testify/require" + "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/tsdb" - "github.com/stretchr/testify/require" ) type mockQueryRangeAPI struct { diff --git a/cmd/promtool/sd_test.go b/cmd/promtool/sd_test.go index d9d974481..793b8ebb3 100644 --- a/cmd/promtool/sd_test.go +++ b/cmd/promtool/sd_test.go @@ -17,6 +17,7 @@ import ( "testing" "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/discovery/targetgroup" "github.com/prometheus/prometheus/pkg/labels" diff --git a/cmd/promtool/tsdb.go b/cmd/promtool/tsdb.go index 5e77802a9..6318336ce 100644 --- a/cmd/promtool/tsdb.go +++ b/cmd/promtool/tsdb.go @@ -31,8 +31,6 @@ import ( "text/tabwriter" "time" - "github.com/prometheus/prometheus/tsdb/index" - "github.com/alecthomas/units" "github.com/go-kit/log" "github.com/pkg/errors" @@ -42,6 +40,7 @@ import ( "github.com/prometheus/prometheus/tsdb/chunks" tsdb_errors "github.com/prometheus/prometheus/tsdb/errors" "github.com/prometheus/prometheus/tsdb/fileutil" + "github.com/prometheus/prometheus/tsdb/index" ) const timeDelta = 30000 diff --git a/discovery/http/http_test.go b/discovery/http/http_test.go index b7a0369e7..896eec1be 100644 --- a/discovery/http/http_test.go +++ b/discovery/http/http_test.go @@ -24,8 +24,9 @@ import ( "github.com/go-kit/log" "github.com/prometheus/common/config" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/discovery/targetgroup" "github.com/stretchr/testify/require" + + "github.com/prometheus/prometheus/discovery/targetgroup" ) func TestHTTPValidRefresh(t *testing.T) { diff --git a/discovery/kubernetes/endpoints.go b/discovery/kubernetes/endpoints.go index 49e515a14..510b33f44 100644 --- a/discovery/kubernetes/endpoints.go +++ b/discovery/kubernetes/endpoints.go @@ -18,8 +18,6 @@ import ( "net" "strconv" - "github.com/prometheus/prometheus/util/strutil" - "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/pkg/errors" @@ -29,6 +27,7 @@ import ( "k8s.io/client-go/util/workqueue" "github.com/prometheus/prometheus/discovery/targetgroup" + "github.com/prometheus/prometheus/util/strutil" ) var ( diff --git a/discovery/moby/docker.go b/discovery/moby/docker.go index deabcdd1e..162833ece 100644 --- a/discovery/moby/docker.go +++ b/discovery/moby/docker.go @@ -28,6 +28,7 @@ import ( "github.com/go-kit/log" "github.com/prometheus/common/config" "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/discovery" "github.com/prometheus/prometheus/discovery/refresh" "github.com/prometheus/prometheus/discovery/targetgroup" diff --git a/discovery/moby/network.go b/discovery/moby/network.go index 3982e5777..0e0d0041d 100644 --- a/discovery/moby/network.go +++ b/discovery/moby/network.go @@ -19,6 +19,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/client" + "github.com/prometheus/prometheus/util/strutil" ) diff --git a/discovery/puppetdb/puppetdb_test.go b/discovery/puppetdb/puppetdb_test.go index 3fcfab549..25340bea7 100644 --- a/discovery/puppetdb/puppetdb_test.go +++ b/discovery/puppetdb/puppetdb_test.go @@ -25,8 +25,9 @@ import ( "github.com/go-kit/log" "github.com/prometheus/common/config" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/discovery/targetgroup" "github.com/stretchr/testify/require" + + "github.com/prometheus/prometheus/discovery/targetgroup" ) func mockServer(t *testing.T) *httptest.Server { diff --git a/discovery/puppetdb/resources.go b/discovery/puppetdb/resources.go index 64b3a781e..27792b646 100644 --- a/discovery/puppetdb/resources.go +++ b/discovery/puppetdb/resources.go @@ -18,6 +18,7 @@ import ( "strings" "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/util/strutil" ) diff --git a/discovery/scaleway/baremetal.go b/discovery/scaleway/baremetal.go index 9e002b987..c313e6695 100644 --- a/discovery/scaleway/baremetal.go +++ b/discovery/scaleway/baremetal.go @@ -25,10 +25,11 @@ import ( "github.com/prometheus/common/config" "github.com/prometheus/common/model" "github.com/prometheus/common/version" - "github.com/prometheus/prometheus/discovery/refresh" - "github.com/prometheus/prometheus/discovery/targetgroup" "github.com/scaleway/scaleway-sdk-go/api/baremetal/v1" "github.com/scaleway/scaleway-sdk-go/scw" + + "github.com/prometheus/prometheus/discovery/refresh" + "github.com/prometheus/prometheus/discovery/targetgroup" ) type baremetalDiscovery struct { diff --git a/discovery/scaleway/instance.go b/discovery/scaleway/instance.go index a78c5e93c..67311216d 100644 --- a/discovery/scaleway/instance.go +++ b/discovery/scaleway/instance.go @@ -25,10 +25,11 @@ import ( "github.com/prometheus/common/config" "github.com/prometheus/common/model" "github.com/prometheus/common/version" - "github.com/prometheus/prometheus/discovery/refresh" - "github.com/prometheus/prometheus/discovery/targetgroup" "github.com/scaleway/scaleway-sdk-go/api/instance/v1" "github.com/scaleway/scaleway-sdk-go/scw" + + "github.com/prometheus/prometheus/discovery/refresh" + "github.com/prometheus/prometheus/discovery/targetgroup" ) const ( diff --git a/discovery/scaleway/scaleway.go b/discovery/scaleway/scaleway.go index 920f087a1..ed3d7f391 100644 --- a/discovery/scaleway/scaleway.go +++ b/discovery/scaleway/scaleway.go @@ -24,10 +24,11 @@ import ( "github.com/pkg/errors" "github.com/prometheus/common/config" "github.com/prometheus/common/model" + "github.com/scaleway/scaleway-sdk-go/scw" + "github.com/prometheus/prometheus/discovery" "github.com/prometheus/prometheus/discovery/refresh" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/scaleway/scaleway-sdk-go/scw" ) // metaLabelPrefix is the meta prefix used for all meta labels. diff --git a/promql/parser/printer_test.go b/promql/parser/printer_test.go index e687820c9..2a7e438a2 100644 --- a/promql/parser/printer_test.go +++ b/promql/parser/printer_test.go @@ -16,9 +16,9 @@ package parser import ( "testing" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/stretchr/testify/require" + + "github.com/prometheus/prometheus/pkg/labels" ) func TestExprString(t *testing.T) { diff --git a/storage/remote/metadata_watcher.go b/storage/remote/metadata_watcher.go index 1096e406a..eee36463b 100644 --- a/storage/remote/metadata_watcher.go +++ b/storage/remote/metadata_watcher.go @@ -21,6 +21,7 @@ import ( "github.com/go-kit/log/level" "github.com/pkg/errors" "github.com/prometheus/common/model" + "github.com/prometheus/prometheus/scrape" ) diff --git a/storage/remote/metadata_watcher_test.go b/storage/remote/metadata_watcher_test.go index c8114fbd6..d51011a8c 100644 --- a/storage/remote/metadata_watcher_test.go +++ b/storage/remote/metadata_watcher_test.go @@ -20,9 +20,10 @@ import ( "github.com/pkg/errors" "github.com/prometheus/common/model" + "github.com/stretchr/testify/require" + "github.com/prometheus/prometheus/pkg/textparse" "github.com/prometheus/prometheus/scrape" - "github.com/stretchr/testify/require" ) var ( diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index 8664555a5..d76b63405 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -26,10 +26,10 @@ import ( "github.com/golang/snappy" "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/ext" - "go.uber.org/atomic" - "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" + "go.uber.org/atomic" + "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/pkg/relabel" diff --git a/storage/remote/read_handler.go b/storage/remote/read_handler.go index ceea4579a..581b54a52 100644 --- a/storage/remote/read_handler.go +++ b/storage/remote/read_handler.go @@ -20,8 +20,8 @@ import ( "github.com/go-kit/log" "github.com/go-kit/log/level" - "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/pkg/gate" "github.com/prometheus/prometheus/pkg/labels" diff --git a/tsdb/agent/db.go b/tsdb/agent/db.go index 30d779355..36e843e83 100644 --- a/tsdb/agent/db.go +++ b/tsdb/agent/db.go @@ -25,6 +25,8 @@ import ( "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" + "go.uber.org/atomic" + "github.com/prometheus/prometheus/pkg/exemplar" "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/pkg/timestamp" @@ -33,7 +35,6 @@ import ( "github.com/prometheus/prometheus/tsdb" "github.com/prometheus/prometheus/tsdb/record" "github.com/prometheus/prometheus/tsdb/wal" - "go.uber.org/atomic" ) var ErrUnsupported = errors.New("unsupported operation with WAL-only storage") diff --git a/tsdb/agent/db_test.go b/tsdb/agent/db_test.go index 8f6cdc68a..464caa75d 100644 --- a/tsdb/agent/db_test.go +++ b/tsdb/agent/db_test.go @@ -29,12 +29,13 @@ import ( "github.com/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" + "github.com/stretchr/testify/require" + "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/storage/remote" "github.com/prometheus/prometheus/tsdb/record" "github.com/prometheus/prometheus/tsdb/tsdbutil" "github.com/prometheus/prometheus/tsdb/wal" - "github.com/stretchr/testify/require" ) func TestUnsupported(t *testing.T) { diff --git a/tsdb/exemplar.go b/tsdb/exemplar.go index 63ac512c9..53cb5c9d9 100644 --- a/tsdb/exemplar.go +++ b/tsdb/exemplar.go @@ -20,6 +20,7 @@ import ( "unicode/utf8" "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/pkg/exemplar" "github.com/prometheus/prometheus/pkg/labels" diff --git a/tsdb/exemplar_test.go b/tsdb/exemplar_test.go index db47780fd..7876d9563 100644 --- a/tsdb/exemplar_test.go +++ b/tsdb/exemplar_test.go @@ -22,9 +22,9 @@ import ( "strings" "testing" + "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" - "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/pkg/exemplar" "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/storage" diff --git a/tsdb/head_wal.go b/tsdb/head_wal.go index 3f6416e17..4fa030a49 100644 --- a/tsdb/head_wal.go +++ b/tsdb/head_wal.go @@ -25,18 +25,17 @@ import ( "sync" "time" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/tsdb/chunkenc" - "github.com/prometheus/prometheus/tsdb/encoding" - tsdb_errors "github.com/prometheus/prometheus/tsdb/errors" - "github.com/prometheus/prometheus/tsdb/fileutil" - "github.com/go-kit/log/level" "github.com/pkg/errors" "go.uber.org/atomic" "github.com/prometheus/prometheus/pkg/exemplar" + "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/storage" + "github.com/prometheus/prometheus/tsdb/chunkenc" + "github.com/prometheus/prometheus/tsdb/encoding" + tsdb_errors "github.com/prometheus/prometheus/tsdb/errors" + "github.com/prometheus/prometheus/tsdb/fileutil" "github.com/prometheus/prometheus/tsdb/record" "github.com/prometheus/prometheus/tsdb/tombstones" "github.com/prometheus/prometheus/tsdb/wal"