From c954cd9d1d4e3530be2939d39d8633c38b70913f Mon Sep 17 00:00:00 2001 From: beorn7 Date: Mon, 8 Nov 2021 15:23:17 +0100 Subject: [PATCH] Move packages out of deprecated pkg directory This creates a new `model` directory and moves all data-model related packages over there: exemplar labels relabel rulefmt textparse timestamp value All the others are more or less utilities and have been moved to `util`: gate logging modetimevfs pool runtime Signed-off-by: beorn7 --- cmd/prometheus/main.go | 10 +++++----- cmd/prometheus/main_test.go | 2 +- cmd/promtool/backfill.go | 4 ++-- cmd/promtool/backfill_test.go | 2 +- cmd/promtool/main.go | 4 ++-- cmd/promtool/main_test.go | 4 ++-- cmd/promtool/rules.go | 4 ++-- cmd/promtool/rules_test.go | 2 +- cmd/promtool/sd.go | 2 +- cmd/promtool/sd_test.go | 4 ++-- cmd/promtool/tsdb.go | 2 +- cmd/promtool/unittest.go | 2 +- config/config.go | 4 ++-- config/config_test.go | 4 ++-- {pkg => model}/exemplar/exemplar.go | 2 +- {pkg => model}/labels/labels.go | 0 {pkg => model}/labels/labels_test.go | 0 {pkg => model}/labels/matcher.go | 0 {pkg => model}/labels/matcher_test.go | 0 {pkg => model}/labels/regexp.go | 0 {pkg => model}/labels/regexp_test.go | 0 {pkg => model}/labels/test_utils.go | 0 {pkg => model}/relabel/relabel.go | 2 +- {pkg => model}/relabel/relabel_test.go | 2 +- {pkg => model}/rulefmt/rulefmt.go | 2 +- {pkg => model}/rulefmt/rulefmt_test.go | 0 .../rulefmt/testdata/bad_annotation.bad.yaml | 0 {pkg => model}/rulefmt/testdata/bad_expr.bad.yaml | 0 {pkg => model}/rulefmt/testdata/bad_field.bad.yaml | 0 {pkg => model}/rulefmt/testdata/bad_lname.bad.yaml | 0 .../rulefmt/testdata/duplicate_grp.bad.yaml | 0 .../rulefmt/testdata/invalid_label_name.bad.yaml | 0 .../rulefmt/testdata/invalid_record_name.bad.yaml | 0 .../rulefmt/testdata/no_rec_alert.bad.yaml | 0 {pkg => model}/rulefmt/testdata/noexpr.bad.yaml | 0 .../rulefmt/testdata/record_and_alert.bad.yaml | 0 {pkg => model}/rulefmt/testdata/test.yaml | 0 {pkg => model}/textparse/README.md | 0 {pkg => model}/textparse/interface.go | 4 ++-- {pkg => model}/textparse/openmetricslex.l | 0 {pkg => model}/textparse/openmetricslex.l.go | 0 {pkg => model}/textparse/openmetricsparse.go | 6 +++--- {pkg => model}/textparse/openmetricsparse_test.go | 4 ++-- {pkg => model}/textparse/promlex.l | 0 {pkg => model}/textparse/promlex.l.go | 0 {pkg => model}/textparse/promparse.go | 6 +++--- {pkg => model}/textparse/promparse_test.go | 2 +- {pkg => model}/textparse/promtestdata.nometa.txt | 0 {pkg => model}/textparse/promtestdata.txt | 0 {pkg => model}/timestamp/timestamp.go | 0 {pkg => model}/value/value.go | 0 notifier/notifier.go | 4 ++-- notifier/notifier_test.go | 4 ++-- pkg/README.md | 3 --- promql/bench_test.go | 2 +- promql/engine.go | 6 +++--- promql/engine_test.go | 4 ++-- promql/functions.go | 2 +- promql/functions_test.go | 4 ++-- promql/fuzz.go | 2 +- promql/parser/ast.go | 2 +- promql/parser/generated_parser.y | 4 ++-- promql/parser/generated_parser.y.go | 4 ++-- promql/parser/parse.go | 4 ++-- promql/parser/parse_test.go | 2 +- promql/parser/printer.go | 2 +- promql/parser/printer_test.go | 2 +- promql/quantile.go | 2 +- promql/test.go | 6 +++--- promql/test_test.go | 2 +- promql/value.go | 2 +- rules/alerting.go | 6 +++--- rules/alerting_test.go | 4 ++-- rules/manager.go | 8 ++++---- rules/manager_test.go | 8 ++++---- rules/recording.go | 4 ++-- rules/recording_test.go | 4 ++-- scrape/helpers_test.go | 4 ++-- scrape/manager.go | 2 +- scrape/manager_test.go | 4 ++-- scrape/scrape.go | 14 +++++++------- scrape/scrape_test.go | 12 ++++++------ scrape/target.go | 8 ++++---- scrape/target_test.go | 2 +- storage/fanout.go | 4 ++-- storage/fanout_test.go | 2 +- storage/generic.go | 2 +- storage/interface.go | 4 ++-- storage/merge.go | 2 +- storage/merge_test.go | 2 +- storage/noop.go | 2 +- storage/remote/codec.go | 6 +++--- storage/remote/codec_test.go | 4 ++-- storage/remote/metadata_watcher_test.go | 2 +- storage/remote/queue_manager.go | 4 ++-- storage/remote/queue_manager_test.go | 6 +++--- storage/remote/read.go | 2 +- storage/remote/read_handler.go | 4 ++-- storage/remote/read_handler_test.go | 2 +- storage/remote/read_test.go | 2 +- storage/remote/storage.go | 4 ++-- storage/remote/write.go | 4 ++-- storage/remote/write_handler.go | 2 +- storage/remote/write_handler_test.go | 4 ++-- storage/remote/write_test.go | 4 ++-- storage/secondary.go | 2 +- storage/series.go | 2 +- template/template_test.go | 2 +- tsdb/agent/db.go | 6 +++--- tsdb/agent/db_test.go | 2 +- tsdb/agent/series.go | 2 +- tsdb/block.go | 2 +- tsdb/block_test.go | 2 +- tsdb/blockwriter.go | 2 +- tsdb/blockwriter_test.go | 2 +- tsdb/compact_test.go | 2 +- tsdb/db.go | 2 +- tsdb/db_test.go | 2 +- tsdb/exemplar.go | 4 ++-- tsdb/exemplar_test.go | 4 ++-- tsdb/head.go | 4 ++-- tsdb/head_append.go | 4 ++-- tsdb/head_bench_test.go | 2 +- tsdb/head_read.go | 2 +- tsdb/head_test.go | 4 ++-- tsdb/head_wal.go | 4 ++-- tsdb/index/index.go | 2 +- tsdb/index/index_test.go | 2 +- tsdb/index/postings.go | 2 +- tsdb/index/postings_test.go | 2 +- tsdb/mocks_test.go | 2 +- tsdb/querier.go | 2 +- tsdb/querier_bench_test.go | 2 +- tsdb/querier_test.go | 2 +- tsdb/record/record.go | 2 +- tsdb/record/record_test.go | 2 +- tsdb/repair_test.go | 2 +- tsdb/test/labels_test.go | 2 +- tsdb/wal.go | 2 +- tsdb/wal/checkpoint_test.go | 2 +- tsdb/wal/watcher.go | 2 +- tsdb/wal/watcher_test.go | 2 +- tsdb/wal_test.go | 2 +- {pkg => util}/gate/gate.go | 0 {pkg => util}/logging/dedupe.go | 0 {pkg => util}/logging/dedupe_test.go | 0 {pkg => util}/logging/file.go | 0 {pkg => util}/logging/file_test.go | 0 {pkg => util}/logging/ratelimit.go | 0 {pkg => util}/modtimevfs/modtimevfs.go | 0 {pkg => util}/pool/pool.go | 0 {pkg => util}/pool/pool_test.go | 0 {pkg => util}/runtime/limits_default.go | 0 {pkg => util}/runtime/limits_windows.go | 0 {pkg => util}/runtime/statfs.go | 0 {pkg => util}/runtime/statfs_default.go | 0 {pkg => util}/runtime/statfs_linux_386.go | 1 + {pkg => util}/runtime/statfs_uint32.go | 1 + {pkg => util}/runtime/uname_default.go | 0 {pkg => util}/runtime/uname_linux.go | 0 {pkg => util}/runtime/vmlimits_default.go | 0 {pkg => util}/runtime/vmlimits_openbsd.go | 0 util/teststorage/storage.go | 4 ++-- web/api/v1/api.go | 8 ++++---- web/api/v1/api_test.go | 8 ++++---- web/federate.go | 6 +++--- web/federate_test.go | 2 +- web/ui/assets_generate.go | 2 +- 168 files changed, 207 insertions(+), 208 deletions(-) rename {pkg => model}/exemplar/exemplar.go (97%) rename {pkg => model}/labels/labels.go (100%) rename {pkg => model}/labels/labels_test.go (100%) rename {pkg => model}/labels/matcher.go (100%) rename {pkg => model}/labels/matcher_test.go (100%) rename {pkg => model}/labels/regexp.go (100%) rename {pkg => model}/labels/regexp_test.go (100%) rename {pkg => model}/labels/test_utils.go (100%) rename {pkg => model}/relabel/relabel.go (99%) rename {pkg => model}/relabel/relabel_test.go (99%) rename {pkg => model}/rulefmt/rulefmt.go (99%) rename {pkg => model}/rulefmt/rulefmt_test.go (100%) rename {pkg => model}/rulefmt/testdata/bad_annotation.bad.yaml (100%) rename {pkg => model}/rulefmt/testdata/bad_expr.bad.yaml (100%) rename {pkg => model}/rulefmt/testdata/bad_field.bad.yaml (100%) rename {pkg => model}/rulefmt/testdata/bad_lname.bad.yaml (100%) rename {pkg => model}/rulefmt/testdata/duplicate_grp.bad.yaml (100%) rename {pkg => model}/rulefmt/testdata/invalid_label_name.bad.yaml (100%) rename {pkg => model}/rulefmt/testdata/invalid_record_name.bad.yaml (100%) rename {pkg => model}/rulefmt/testdata/no_rec_alert.bad.yaml (100%) rename {pkg => model}/rulefmt/testdata/noexpr.bad.yaml (100%) rename {pkg => model}/rulefmt/testdata/record_and_alert.bad.yaml (100%) rename {pkg => model}/rulefmt/testdata/test.yaml (100%) rename {pkg => model}/textparse/README.md (100%) rename {pkg => model}/textparse/interface.go (97%) rename {pkg => model}/textparse/openmetricslex.l (100%) rename {pkg => model}/textparse/openmetricslex.l.go (100%) rename {pkg => model}/textparse/openmetricsparse.go (98%) rename {pkg => model}/textparse/openmetricsparse_test.go (99%) rename {pkg => model}/textparse/promlex.l (100%) rename {pkg => model}/textparse/promlex.l.go (100%) rename {pkg => model}/textparse/promparse.go (98%) rename {pkg => model}/textparse/promparse_test.go (99%) rename {pkg => model}/textparse/promtestdata.nometa.txt (100%) rename {pkg => model}/textparse/promtestdata.txt (100%) rename {pkg => model}/timestamp/timestamp.go (100%) rename {pkg => model}/value/value.go (100%) delete mode 100644 pkg/README.md rename {pkg => util}/gate/gate.go (100%) rename {pkg => util}/logging/dedupe.go (100%) rename {pkg => util}/logging/dedupe_test.go (100%) rename {pkg => util}/logging/file.go (100%) rename {pkg => util}/logging/file_test.go (100%) rename {pkg => util}/logging/ratelimit.go (100%) rename {pkg => util}/modtimevfs/modtimevfs.go (100%) rename {pkg => util}/pool/pool.go (100%) rename {pkg => util}/pool/pool_test.go (100%) rename {pkg => util}/runtime/limits_default.go (100%) rename {pkg => util}/runtime/limits_windows.go (100%) rename {pkg => util}/runtime/statfs.go (100%) rename {pkg => util}/runtime/statfs_default.go (100%) rename {pkg => util}/runtime/statfs_linux_386.go (99%) rename {pkg => util}/runtime/statfs_uint32.go (99%) rename {pkg => util}/runtime/uname_default.go (100%) rename {pkg => util}/runtime/uname_linux.go (100%) rename {pkg => util}/runtime/vmlimits_default.go (100%) rename {pkg => util}/runtime/vmlimits_openbsd.go (100%) diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index 21f60678e..562fd727f 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -60,12 +60,10 @@ import ( _ "github.com/prometheus/prometheus/discovery/install" // Register service discovery implementations. "github.com/prometheus/prometheus/discovery/legacymanager" "github.com/prometheus/prometheus/discovery/targetgroup" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" "github.com/prometheus/prometheus/notifier" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/logging" - "github.com/prometheus/prometheus/pkg/relabel" - prom_runtime "github.com/prometheus/prometheus/pkg/runtime" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/rules" "github.com/prometheus/prometheus/scrape" @@ -73,6 +71,8 @@ import ( "github.com/prometheus/prometheus/storage/remote" "github.com/prometheus/prometheus/tsdb" "github.com/prometheus/prometheus/tsdb/agent" + "github.com/prometheus/prometheus/util/logging" + prom_runtime "github.com/prometheus/prometheus/util/runtime" "github.com/prometheus/prometheus/util/strutil" "github.com/prometheus/prometheus/web" ) diff --git a/cmd/prometheus/main_test.go b/cmd/prometheus/main_test.go index c8f15b559..c3ada32b6 100644 --- a/cmd/prometheus/main_test.go +++ b/cmd/prometheus/main_test.go @@ -32,8 +32,8 @@ import ( "github.com/prometheus/common/model" "github.com/stretchr/testify/require" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/notifier" - "github.com/prometheus/prometheus/pkg/labels" "github.com/prometheus/prometheus/rules" ) diff --git a/cmd/promtool/backfill.go b/cmd/promtool/backfill.go index 6cd8fd1f3..d1c8f9633 100644 --- a/cmd/promtool/backfill.go +++ b/cmd/promtool/backfill.go @@ -22,8 +22,8 @@ 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/model/labels" + "github.com/prometheus/prometheus/model/textparse" "github.com/prometheus/prometheus/tsdb" tsdb_errors "github.com/prometheus/prometheus/tsdb/errors" ) diff --git a/cmd/promtool/backfill_test.go b/cmd/promtool/backfill_test.go index 932d00cca..c9493f134 100644 --- a/cmd/promtool/backfill_test.go +++ b/cmd/promtool/backfill_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb" ) diff --git a/cmd/promtool/main.go b/cmd/promtool/main.go index 5ba483566..7ae656c68 100644 --- a/cmd/promtool/main.go +++ b/cmd/promtool/main.go @@ -49,9 +49,9 @@ import ( _ "github.com/prometheus/prometheus/discovery/install" // Register service discovery implementations. "github.com/prometheus/prometheus/discovery/kubernetes" "github.com/prometheus/prometheus/discovery/targetgroup" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/rulefmt" "github.com/prometheus/prometheus/notifier" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/rulefmt" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/scrape" ) diff --git a/cmd/promtool/main_test.go b/cmd/promtool/main_test.go index 0c2eb26d7..1a8a47060 100644 --- a/cmd/promtool/main_test.go +++ b/cmd/promtool/main_test.go @@ -23,8 +23,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/rulefmt" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/rulefmt" ) func TestQueryRange(t *testing.T) { diff --git a/cmd/promtool/rules.go b/cmd/promtool/rules.go index e05f5ca7a..7afca02f1 100644 --- a/cmd/promtool/rules.go +++ b/cmd/promtool/rules.go @@ -24,8 +24,8 @@ import ( 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/model/labels" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/rules" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb" diff --git a/cmd/promtool/rules_test.go b/cmd/promtool/rules_test.go index 6e51785ed..10d59d5cc 100644 --- a/cmd/promtool/rules_test.go +++ b/cmd/promtool/rules_test.go @@ -27,7 +27,7 @@ import ( "github.com/prometheus/common/model" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb" ) diff --git a/cmd/promtool/sd.go b/cmd/promtool/sd.go index c1cd8e28b..f3b2c13b4 100644 --- a/cmd/promtool/sd.go +++ b/cmd/promtool/sd.go @@ -26,7 +26,7 @@ import ( "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/discovery" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/scrape" ) diff --git a/cmd/promtool/sd_test.go b/cmd/promtool/sd_test.go index 793b8ebb3..7f80437cf 100644 --- a/cmd/promtool/sd_test.go +++ b/cmd/promtool/sd_test.go @@ -20,8 +20,8 @@ import ( "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/relabel" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" "github.com/stretchr/testify/require" ) diff --git a/cmd/promtool/tsdb.go b/cmd/promtool/tsdb.go index a3f134fd9..2e5d854de 100644 --- a/cmd/promtool/tsdb.go +++ b/cmd/promtool/tsdb.go @@ -38,7 +38,7 @@ import ( "github.com/go-kit/log" "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb" "github.com/prometheus/prometheus/tsdb/chunks" tsdb_errors "github.com/prometheus/prometheus/tsdb/errors" diff --git a/cmd/promtool/unittest.go b/cmd/promtool/unittest.go index 637846303..62e2843d4 100644 --- a/cmd/promtool/unittest.go +++ b/cmd/promtool/unittest.go @@ -30,7 +30,7 @@ import ( "github.com/prometheus/common/model" yaml "gopkg.in/yaml.v2" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/rules" diff --git a/config/config.go b/config/config.go index a247898a9..502077e68 100644 --- a/config/config.go +++ b/config/config.go @@ -33,8 +33,8 @@ import ( yaml "gopkg.in/yaml.v2" "github.com/prometheus/prometheus/discovery" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/relabel" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" ) var ( diff --git a/config/config_test.go b/config/config_test.go index 4fe5731a2..e8d52d4aa 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -52,8 +52,8 @@ import ( "github.com/prometheus/prometheus/discovery/uyuni" "github.com/prometheus/prometheus/discovery/xds" "github.com/prometheus/prometheus/discovery/zookeeper" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/relabel" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" ) func mustParseURL(u string) *config.URL { diff --git a/pkg/exemplar/exemplar.go b/model/exemplar/exemplar.go similarity index 97% rename from pkg/exemplar/exemplar.go rename to model/exemplar/exemplar.go index 27ba64d4b..2e39cf689 100644 --- a/pkg/exemplar/exemplar.go +++ b/model/exemplar/exemplar.go @@ -13,7 +13,7 @@ package exemplar -import "github.com/prometheus/prometheus/pkg/labels" +import "github.com/prometheus/prometheus/model/labels" // The combined length of the label names and values of an Exemplar's LabelSet MUST NOT exceed 128 UTF-8 characters // https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#exemplars diff --git a/pkg/labels/labels.go b/model/labels/labels.go similarity index 100% rename from pkg/labels/labels.go rename to model/labels/labels.go diff --git a/pkg/labels/labels_test.go b/model/labels/labels_test.go similarity index 100% rename from pkg/labels/labels_test.go rename to model/labels/labels_test.go diff --git a/pkg/labels/matcher.go b/model/labels/matcher.go similarity index 100% rename from pkg/labels/matcher.go rename to model/labels/matcher.go diff --git a/pkg/labels/matcher_test.go b/model/labels/matcher_test.go similarity index 100% rename from pkg/labels/matcher_test.go rename to model/labels/matcher_test.go diff --git a/pkg/labels/regexp.go b/model/labels/regexp.go similarity index 100% rename from pkg/labels/regexp.go rename to model/labels/regexp.go diff --git a/pkg/labels/regexp_test.go b/model/labels/regexp_test.go similarity index 100% rename from pkg/labels/regexp_test.go rename to model/labels/regexp_test.go diff --git a/pkg/labels/test_utils.go b/model/labels/test_utils.go similarity index 100% rename from pkg/labels/test_utils.go rename to model/labels/test_utils.go diff --git a/pkg/relabel/relabel.go b/model/relabel/relabel.go similarity index 99% rename from pkg/relabel/relabel.go rename to model/relabel/relabel.go index ec452f5b5..db08f3c85 100644 --- a/pkg/relabel/relabel.go +++ b/model/relabel/relabel.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) var ( diff --git a/pkg/relabel/relabel_test.go b/model/relabel/relabel_test.go similarity index 99% rename from pkg/relabel/relabel_test.go rename to model/relabel/relabel_test.go index 868699122..1e50344a0 100644 --- a/pkg/relabel/relabel_test.go +++ b/model/relabel/relabel_test.go @@ -19,7 +19,7 @@ import ( "github.com/prometheus/common/model" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) func TestRelabel(t *testing.T) { diff --git a/pkg/rulefmt/rulefmt.go b/model/rulefmt/rulefmt.go similarity index 99% rename from pkg/rulefmt/rulefmt.go rename to model/rulefmt/rulefmt.go index 13fd07c22..6f03347d1 100644 --- a/pkg/rulefmt/rulefmt.go +++ b/model/rulefmt/rulefmt.go @@ -25,7 +25,7 @@ import ( "github.com/prometheus/common/model" yaml "gopkg.in/yaml.v3" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/template" ) diff --git a/pkg/rulefmt/rulefmt_test.go b/model/rulefmt/rulefmt_test.go similarity index 100% rename from pkg/rulefmt/rulefmt_test.go rename to model/rulefmt/rulefmt_test.go diff --git a/pkg/rulefmt/testdata/bad_annotation.bad.yaml b/model/rulefmt/testdata/bad_annotation.bad.yaml similarity index 100% rename from pkg/rulefmt/testdata/bad_annotation.bad.yaml rename to model/rulefmt/testdata/bad_annotation.bad.yaml diff --git a/pkg/rulefmt/testdata/bad_expr.bad.yaml b/model/rulefmt/testdata/bad_expr.bad.yaml similarity index 100% rename from pkg/rulefmt/testdata/bad_expr.bad.yaml rename to model/rulefmt/testdata/bad_expr.bad.yaml diff --git a/pkg/rulefmt/testdata/bad_field.bad.yaml b/model/rulefmt/testdata/bad_field.bad.yaml similarity index 100% rename from pkg/rulefmt/testdata/bad_field.bad.yaml rename to model/rulefmt/testdata/bad_field.bad.yaml diff --git a/pkg/rulefmt/testdata/bad_lname.bad.yaml b/model/rulefmt/testdata/bad_lname.bad.yaml similarity index 100% rename from pkg/rulefmt/testdata/bad_lname.bad.yaml rename to model/rulefmt/testdata/bad_lname.bad.yaml diff --git a/pkg/rulefmt/testdata/duplicate_grp.bad.yaml b/model/rulefmt/testdata/duplicate_grp.bad.yaml similarity index 100% rename from pkg/rulefmt/testdata/duplicate_grp.bad.yaml rename to model/rulefmt/testdata/duplicate_grp.bad.yaml diff --git a/pkg/rulefmt/testdata/invalid_label_name.bad.yaml b/model/rulefmt/testdata/invalid_label_name.bad.yaml similarity index 100% rename from pkg/rulefmt/testdata/invalid_label_name.bad.yaml rename to model/rulefmt/testdata/invalid_label_name.bad.yaml diff --git a/pkg/rulefmt/testdata/invalid_record_name.bad.yaml b/model/rulefmt/testdata/invalid_record_name.bad.yaml similarity index 100% rename from pkg/rulefmt/testdata/invalid_record_name.bad.yaml rename to model/rulefmt/testdata/invalid_record_name.bad.yaml diff --git a/pkg/rulefmt/testdata/no_rec_alert.bad.yaml b/model/rulefmt/testdata/no_rec_alert.bad.yaml similarity index 100% rename from pkg/rulefmt/testdata/no_rec_alert.bad.yaml rename to model/rulefmt/testdata/no_rec_alert.bad.yaml diff --git a/pkg/rulefmt/testdata/noexpr.bad.yaml b/model/rulefmt/testdata/noexpr.bad.yaml similarity index 100% rename from pkg/rulefmt/testdata/noexpr.bad.yaml rename to model/rulefmt/testdata/noexpr.bad.yaml diff --git a/pkg/rulefmt/testdata/record_and_alert.bad.yaml b/model/rulefmt/testdata/record_and_alert.bad.yaml similarity index 100% rename from pkg/rulefmt/testdata/record_and_alert.bad.yaml rename to model/rulefmt/testdata/record_and_alert.bad.yaml diff --git a/pkg/rulefmt/testdata/test.yaml b/model/rulefmt/testdata/test.yaml similarity index 100% rename from pkg/rulefmt/testdata/test.yaml rename to model/rulefmt/testdata/test.yaml diff --git a/pkg/textparse/README.md b/model/textparse/README.md similarity index 100% rename from pkg/textparse/README.md rename to model/textparse/README.md diff --git a/pkg/textparse/interface.go b/model/textparse/interface.go similarity index 97% rename from pkg/textparse/interface.go rename to model/textparse/interface.go index 557e56662..cff86c0ed 100644 --- a/pkg/textparse/interface.go +++ b/model/textparse/interface.go @@ -16,8 +16,8 @@ package textparse import ( "mime" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" ) // Parser parses samples from a byte slice of samples in the official diff --git a/pkg/textparse/openmetricslex.l b/model/textparse/openmetricslex.l similarity index 100% rename from pkg/textparse/openmetricslex.l rename to model/textparse/openmetricslex.l diff --git a/pkg/textparse/openmetricslex.l.go b/model/textparse/openmetricslex.l.go similarity index 100% rename from pkg/textparse/openmetricslex.l.go rename to model/textparse/openmetricslex.l.go diff --git a/pkg/textparse/openmetricsparse.go b/model/textparse/openmetricsparse.go similarity index 98% rename from pkg/textparse/openmetricsparse.go rename to model/textparse/openmetricsparse.go index 565efd359..bbd39e3d5 100644 --- a/pkg/textparse/openmetricsparse.go +++ b/model/textparse/openmetricsparse.go @@ -27,9 +27,9 @@ import ( "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/value" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/value" ) var allowedSuffixes = [][]byte{[]byte("_total"), []byte("_bucket")} diff --git a/pkg/textparse/openmetricsparse_test.go b/model/textparse/openmetricsparse_test.go similarity index 99% rename from pkg/textparse/openmetricsparse_test.go rename to model/textparse/openmetricsparse_test.go index 9a19a2f4d..b460dd9f5 100644 --- a/pkg/textparse/openmetricsparse_test.go +++ b/model/textparse/openmetricsparse_test.go @@ -19,8 +19,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" ) func TestOpenMetricsParse(t *testing.T) { diff --git a/pkg/textparse/promlex.l b/model/textparse/promlex.l similarity index 100% rename from pkg/textparse/promlex.l rename to model/textparse/promlex.l diff --git a/pkg/textparse/promlex.l.go b/model/textparse/promlex.l.go similarity index 100% rename from pkg/textparse/promlex.l.go rename to model/textparse/promlex.l.go diff --git a/pkg/textparse/promparse.go b/model/textparse/promparse.go similarity index 98% rename from pkg/textparse/promparse.go rename to model/textparse/promparse.go index 3c885af0b..8dc23a6b0 100644 --- a/pkg/textparse/promparse.go +++ b/model/textparse/promparse.go @@ -28,9 +28,9 @@ import ( "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/value" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/value" ) type promlexer struct { diff --git a/pkg/textparse/promparse_test.go b/model/textparse/promparse_test.go similarity index 99% rename from pkg/textparse/promparse_test.go rename to model/textparse/promparse_test.go index 653f0dd05..b6e57108b 100644 --- a/pkg/textparse/promparse_test.go +++ b/model/textparse/promparse_test.go @@ -25,7 +25,7 @@ import ( "github.com/prometheus/common/model" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) func TestPromParse(t *testing.T) { diff --git a/pkg/textparse/promtestdata.nometa.txt b/model/textparse/promtestdata.nometa.txt similarity index 100% rename from pkg/textparse/promtestdata.nometa.txt rename to model/textparse/promtestdata.nometa.txt diff --git a/pkg/textparse/promtestdata.txt b/model/textparse/promtestdata.txt similarity index 100% rename from pkg/textparse/promtestdata.txt rename to model/textparse/promtestdata.txt diff --git a/pkg/timestamp/timestamp.go b/model/timestamp/timestamp.go similarity index 100% rename from pkg/timestamp/timestamp.go rename to model/timestamp/timestamp.go diff --git a/pkg/value/value.go b/model/value/value.go similarity index 100% rename from pkg/value/value.go rename to model/value/value.go diff --git a/notifier/notifier.go b/notifier/notifier.go index d378beb60..0fca28c33 100644 --- a/notifier/notifier.go +++ b/notifier/notifier.go @@ -41,8 +41,8 @@ import ( "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/relabel" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" ) const ( diff --git a/notifier/notifier_test.go b/notifier/notifier_test.go index 807c6bc7f..4a2747efd 100644 --- a/notifier/notifier_test.go +++ b/notifier/notifier_test.go @@ -35,8 +35,8 @@ import ( "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/relabel" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" ) func TestPostPath(t *testing.T) { diff --git a/pkg/README.md b/pkg/README.md deleted file mode 100644 index 3aa989ffc..000000000 --- a/pkg/README.md +++ /dev/null @@ -1,3 +0,0 @@ -The `pkg` directory is deprecated. -Please do not add new packages to this directory. -Existing packages will be moved elsewhere eventually. diff --git a/promql/bench_test.go b/promql/bench_test.go index 6eb177250..a46b4fcf7 100644 --- a/promql/bench_test.go +++ b/promql/bench_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/util/teststorage" diff --git a/promql/engine.go b/promql/engine.go index 5be7ef3ee..1525c7b7a 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -35,9 +35,9 @@ import ( "github.com/prometheus/common/model" "github.com/uber/jaeger-client-go" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/timestamp" - "github.com/prometheus/prometheus/pkg/value" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/timestamp" + "github.com/prometheus/prometheus/model/value" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/util/stats" diff --git a/promql/engine_test.go b/promql/engine_test.go index 0986a22e5..9d888956b 100644 --- a/promql/engine_test.go +++ b/promql/engine_test.go @@ -26,8 +26,8 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/storage" ) diff --git a/promql/functions.go b/promql/functions.go index 19bcc6449..d3647a1a0 100644 --- a/promql/functions.go +++ b/promql/functions.go @@ -24,7 +24,7 @@ import ( "github.com/pkg/errors" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/promql/parser" ) diff --git a/promql/functions_test.go b/promql/functions_test.go index 19ee105da..589afc5fd 100644 --- a/promql/functions_test.go +++ b/promql/functions_test.go @@ -21,8 +21,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/util/teststorage" ) diff --git a/promql/fuzz.go b/promql/fuzz.go index b34fbbc66..7aaebdd6b 100644 --- a/promql/fuzz.go +++ b/promql/fuzz.go @@ -20,7 +20,7 @@ package promql import ( "io" - "github.com/prometheus/prometheus/pkg/textparse" + "github.com/prometheus/prometheus/model/textparse" "github.com/prometheus/prometheus/promql/parser" ) diff --git a/promql/parser/ast.go b/promql/parser/ast.go index e9fcdae08..fc144cbbc 100644 --- a/promql/parser/ast.go +++ b/promql/parser/ast.go @@ -19,7 +19,7 @@ import ( "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" ) diff --git a/promql/parser/generated_parser.y b/promql/parser/generated_parser.y index fcf504aca..433f45259 100644 --- a/promql/parser/generated_parser.y +++ b/promql/parser/generated_parser.y @@ -20,8 +20,8 @@ import ( "strconv" "time" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/value" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/value" ) %} diff --git a/promql/parser/generated_parser.y.go b/promql/parser/generated_parser.y.go index 71bce62bc..87f25f024 100644 --- a/promql/parser/generated_parser.y.go +++ b/promql/parser/generated_parser.y.go @@ -13,8 +13,8 @@ import ( "strconv" "time" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/value" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/value" ) //line promql/parser/generated_parser.y:28 diff --git a/promql/parser/parse.go b/promql/parser/parse.go index 2c44c3c2c..5b60c5ed5 100644 --- a/promql/parser/parse.go +++ b/promql/parser/parse.go @@ -26,8 +26,8 @@ import ( "github.com/pkg/errors" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/util/strutil" ) diff --git a/promql/parser/parse_test.go b/promql/parser/parse_test.go index 99cc924e0..790064d37 100644 --- a/promql/parser/parse_test.go +++ b/promql/parser/parse_test.go @@ -24,7 +24,7 @@ import ( "github.com/prometheus/common/model" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) var testExpr = []struct { diff --git a/promql/parser/printer.go b/promql/parser/printer.go index f5cfe789b..b21444cbf 100644 --- a/promql/parser/printer.go +++ b/promql/parser/printer.go @@ -21,7 +21,7 @@ import ( "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) // Tree returns a string of the tree structure of the given node. diff --git a/promql/parser/printer_test.go b/promql/parser/printer_test.go index 2a7e438a2..caaff7e46 100644 --- a/promql/parser/printer_test.go +++ b/promql/parser/printer_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) func TestExprString(t *testing.T) { diff --git a/promql/quantile.go b/promql/quantile.go index a25f8917c..e2de98840 100644 --- a/promql/quantile.go +++ b/promql/quantile.go @@ -17,7 +17,7 @@ import ( "math" "sort" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) // Helpers to calculate quantiles. diff --git a/promql/test.go b/promql/test.go index d577b25d1..19b2dd830 100644 --- a/promql/test.go +++ b/promql/test.go @@ -27,9 +27,9 @@ import ( "github.com/prometheus/common/model" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb" diff --git a/promql/test_test.go b/promql/test_test.go index ec50e5753..845aef256 100644 --- a/promql/test_test.go +++ b/promql/test_test.go @@ -20,7 +20,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) func TestLazyLoader_WithSamplesTill(t *testing.T) { diff --git a/promql/value.go b/promql/value.go index ddcc8a1a4..81af1ad9d 100644 --- a/promql/value.go +++ b/promql/value.go @@ -21,7 +21,7 @@ import ( "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" diff --git a/rules/alerting.go b/rules/alerting.go index 57cc252e1..929f7586d 100644 --- a/rules/alerting.go +++ b/rules/alerting.go @@ -28,9 +28,9 @@ import ( "github.com/prometheus/common/model" yaml "gopkg.in/yaml.v2" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/rulefmt" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/rulefmt" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/template" diff --git a/rules/alerting_test.go b/rules/alerting_test.go index 42882f4f6..31139298d 100644 --- a/rules/alerting_test.go +++ b/rules/alerting_test.go @@ -22,8 +22,8 @@ import ( "github.com/go-kit/log" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/util/teststorage" diff --git a/rules/manager.go b/rules/manager.go index 2ab7eb62d..70b09b752 100644 --- a/rules/manager.go +++ b/rules/manager.go @@ -29,10 +29,10 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/rulefmt" - "github.com/prometheus/prometheus/pkg/timestamp" - "github.com/prometheus/prometheus/pkg/value" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/rulefmt" + "github.com/prometheus/prometheus/model/timestamp" + "github.com/prometheus/prometheus/model/value" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/storage" diff --git a/rules/manager_test.go b/rules/manager_test.go index b70409842..5d9c602b9 100644 --- a/rules/manager_test.go +++ b/rules/manager_test.go @@ -30,10 +30,10 @@ import ( "go.uber.org/goleak" yaml "gopkg.in/yaml.v2" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/rulefmt" - "github.com/prometheus/prometheus/pkg/timestamp" - "github.com/prometheus/prometheus/pkg/value" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/rulefmt" + "github.com/prometheus/prometheus/model/timestamp" + "github.com/prometheus/prometheus/model/value" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/storage" diff --git a/rules/recording.go b/rules/recording.go index 0081690b8..0681db9a2 100644 --- a/rules/recording.go +++ b/rules/recording.go @@ -23,8 +23,8 @@ import ( yaml "gopkg.in/yaml.v2" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/rulefmt" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/rulefmt" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/util/strutil" diff --git a/rules/recording_test.go b/rules/recording_test.go index d6b0b6c2a..dd06b775f 100644 --- a/rules/recording_test.go +++ b/rules/recording_test.go @@ -21,8 +21,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/util/teststorage" diff --git a/scrape/helpers_test.go b/scrape/helpers_test.go index 7a043c0b1..686cf9632 100644 --- a/scrape/helpers_test.go +++ b/scrape/helpers_test.go @@ -17,8 +17,8 @@ import ( "context" "math/rand" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" ) diff --git a/scrape/manager.go b/scrape/manager.go index a4a7e5a50..35d47a86b 100644 --- a/scrape/manager.go +++ b/scrape/manager.go @@ -27,7 +27,7 @@ import ( "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/util/osutil" ) diff --git a/scrape/manager_test.go b/scrape/manager_test.go index 302113875..6c5091bb6 100644 --- a/scrape/manager_test.go +++ b/scrape/manager_test.go @@ -25,8 +25,8 @@ import ( "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/relabel" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" ) func TestPopulateLabels(t *testing.T) { diff --git a/scrape/scrape.go b/scrape/scrape.go index 161ede6ff..e6e55900b 100644 --- a/scrape/scrape.go +++ b/scrape/scrape.go @@ -40,14 +40,14 @@ import ( "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/pool" - "github.com/prometheus/prometheus/pkg/relabel" - "github.com/prometheus/prometheus/pkg/textparse" - "github.com/prometheus/prometheus/pkg/timestamp" - "github.com/prometheus/prometheus/pkg/value" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" + "github.com/prometheus/prometheus/model/textparse" + "github.com/prometheus/prometheus/model/timestamp" + "github.com/prometheus/prometheus/model/value" "github.com/prometheus/prometheus/storage" + "github.com/prometheus/prometheus/util/pool" ) // ScrapeTimestampTolerance is the tolerance for scrape appends timestamps diff --git a/scrape/scrape_test.go b/scrape/scrape_test.go index e52ea96aa..5ab573112 100644 --- a/scrape/scrape_test.go +++ b/scrape/scrape_test.go @@ -38,12 +38,12 @@ import ( "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/relabel" - "github.com/prometheus/prometheus/pkg/textparse" - "github.com/prometheus/prometheus/pkg/timestamp" - "github.com/prometheus/prometheus/pkg/value" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" + "github.com/prometheus/prometheus/model/textparse" + "github.com/prometheus/prometheus/model/timestamp" + "github.com/prometheus/prometheus/model/value" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/util/teststorage" "github.com/prometheus/prometheus/util/testutil" diff --git a/scrape/target.go b/scrape/target.go index 38fea83b3..59d6c9403 100644 --- a/scrape/target.go +++ b/scrape/target.go @@ -27,10 +27,10 @@ import ( "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/relabel" - "github.com/prometheus/prometheus/pkg/textparse" - "github.com/prometheus/prometheus/pkg/value" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" + "github.com/prometheus/prometheus/model/textparse" + "github.com/prometheus/prometheus/model/value" "github.com/prometheus/prometheus/storage" ) diff --git a/scrape/target_test.go b/scrape/target_test.go index fa03c068e..32ab4669e 100644 --- a/scrape/target_test.go +++ b/scrape/target_test.go @@ -31,7 +31,7 @@ import ( "github.com/prometheus/prometheus/config" "github.com/prometheus/prometheus/discovery/targetgroup" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) const ( diff --git a/storage/fanout.go b/storage/fanout.go index 17bac242d..2d0d33215 100644 --- a/storage/fanout.go +++ b/storage/fanout.go @@ -20,8 +20,8 @@ import ( "github.com/go-kit/log/level" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" tsdb_errors "github.com/prometheus/prometheus/tsdb/errors" ) diff --git a/storage/fanout_test.go b/storage/fanout_test.go index 725ffec49..cc228e666 100644 --- a/storage/fanout_test.go +++ b/storage/fanout_test.go @@ -21,7 +21,7 @@ import ( "github.com/prometheus/common/model" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/util/teststorage" ) diff --git a/storage/generic.go b/storage/generic.go index 817122bc1..6762f32a1 100644 --- a/storage/generic.go +++ b/storage/generic.go @@ -17,7 +17,7 @@ package storage import ( - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) type genericQuerier interface { diff --git a/storage/interface.go b/storage/interface.go index fb4a2e414..1c76de86a 100644 --- a/storage/interface.go +++ b/storage/interface.go @@ -18,8 +18,8 @@ import ( "errors" "fmt" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" ) diff --git a/storage/merge.go b/storage/merge.go index 49757e2c3..01e667751 100644 --- a/storage/merge.go +++ b/storage/merge.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" tsdb_errors "github.com/prometheus/prometheus/tsdb/errors" diff --git a/storage/merge_test.go b/storage/merge_test.go index 0aabcdb96..c0b49c836 100644 --- a/storage/merge_test.go +++ b/storage/merge_test.go @@ -23,7 +23,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/tsdbutil" ) diff --git a/storage/noop.go b/storage/noop.go index c63353b92..83953ca43 100644 --- a/storage/noop.go +++ b/storage/noop.go @@ -14,7 +14,7 @@ package storage import ( - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) type noopQuerier struct{} diff --git a/storage/remote/codec.go b/storage/remote/codec.go index 545138da5..a9f6af0f3 100644 --- a/storage/remote/codec.go +++ b/storage/remote/codec.go @@ -26,9 +26,9 @@ import ( "github.com/pkg/errors" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/textparse" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/textparse" "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" diff --git a/storage/remote/codec_test.go b/storage/remote/codec_test.go index 8aad3afeb..b5949cd31 100644 --- a/storage/remote/codec_test.go +++ b/storage/remote/codec_test.go @@ -20,8 +20,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/textparse" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/textparse" "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/storage" ) diff --git a/storage/remote/metadata_watcher_test.go b/storage/remote/metadata_watcher_test.go index d51011a8c..3660bb9a7 100644 --- a/storage/remote/metadata_watcher_test.go +++ b/storage/remote/metadata_watcher_test.go @@ -22,7 +22,7 @@ import ( "github.com/prometheus/common/model" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/textparse" + "github.com/prometheus/prometheus/model/textparse" "github.com/prometheus/prometheus/scrape" ) diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index f4e74273b..e7aafaf3e 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -31,8 +31,8 @@ import ( "go.uber.org/atomic" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/relabel" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/scrape" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/storage/remote/queue_manager_test.go b/storage/remote/queue_manager_test.go index 3706544f0..64a3d6462 100644 --- a/storage/remote/queue_manager_test.go +++ b/storage/remote/queue_manager_test.go @@ -38,9 +38,9 @@ import ( "go.uber.org/atomic" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/textparse" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/textparse" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/scrape" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/storage/remote/read.go b/storage/remote/read.go index 7f1d749e6..071763593 100644 --- a/storage/remote/read.go +++ b/storage/remote/read.go @@ -18,7 +18,7 @@ import ( "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" ) diff --git a/storage/remote/read_handler.go b/storage/remote/read_handler.go index 581b54a52..e1f1df21c 100644 --- a/storage/remote/read_handler.go +++ b/storage/remote/read_handler.go @@ -23,10 +23,10 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/gate" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/storage" + "github.com/prometheus/prometheus/util/gate" ) type readHandler struct { diff --git a/storage/remote/read_handler_test.go b/storage/remote/read_handler_test.go index 8962a8ba3..86edbe0b9 100644 --- a/storage/remote/read_handler_test.go +++ b/storage/remote/read_handler_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/storage" diff --git a/storage/remote/read_test.go b/storage/remote/read_test.go index 67c0f6f74..bf3bff1de 100644 --- a/storage/remote/read_test.go +++ b/storage/remote/read_test.go @@ -27,7 +27,7 @@ import ( "github.com/stretchr/testify/require" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/storage" ) diff --git a/storage/remote/storage.go b/storage/remote/storage.go index cebbffdd1..c82db1f9d 100644 --- a/storage/remote/storage.go +++ b/storage/remote/storage.go @@ -27,10 +27,10 @@ import ( "gopkg.in/yaml.v2" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/logging" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/scrape" "github.com/prometheus/prometheus/storage" + "github.com/prometheus/prometheus/util/logging" ) // String constants for instrumentation. diff --git a/storage/remote/write.go b/storage/remote/write.go index b3bd983bc..bd330fe8b 100644 --- a/storage/remote/write.go +++ b/storage/remote/write.go @@ -25,8 +25,8 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/wal" ) diff --git a/storage/remote/write_handler.go b/storage/remote/write_handler.go index ba8b3446b..42e106038 100644 --- a/storage/remote/write_handler.go +++ b/storage/remote/write_handler.go @@ -22,7 +22,7 @@ import ( "github.com/go-kit/log/level" "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/exemplar" + "github.com/prometheus/prometheus/model/exemplar" "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/storage" ) diff --git a/storage/remote/write_handler_test.go b/storage/remote/write_handler_test.go index 7d467c8fb..5eb17d3b8 100644 --- a/storage/remote/write_handler_test.go +++ b/storage/remote/write_handler_test.go @@ -25,8 +25,8 @@ import ( "github.com/go-kit/log" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/storage" ) diff --git a/storage/remote/write_test.go b/storage/remote/write_test.go index 27c568e1c..9f0954e34 100644 --- a/storage/remote/write_test.go +++ b/storage/remote/write_test.go @@ -26,8 +26,8 @@ import ( "github.com/stretchr/testify/require" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/relabel" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/relabel" ) var cfg = config.RemoteWriteConfig{ diff --git a/storage/secondary.go b/storage/secondary.go index 64a83b5e7..d66a28617 100644 --- a/storage/secondary.go +++ b/storage/secondary.go @@ -16,7 +16,7 @@ package storage import ( "sync" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) // secondaryQuerier is a wrapper that allows a querier to be treated in a best effort manner. diff --git a/storage/series.go b/storage/series.go index d92b4fd18..3a5790c2a 100644 --- a/storage/series.go +++ b/storage/series.go @@ -17,7 +17,7 @@ import ( "math" "sort" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/tsdbutil" diff --git a/template/template_test.go b/template/template_test.go index 8cb657867..063c43b6e 100644 --- a/template/template_test.go +++ b/template/template_test.go @@ -22,7 +22,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/promql" ) diff --git a/tsdb/agent/db.go b/tsdb/agent/db.go index 40161a445..b86249427 100644 --- a/tsdb/agent/db.go +++ b/tsdb/agent/db.go @@ -27,9 +27,9 @@ import ( "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" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/storage/remote" "github.com/prometheus/prometheus/tsdb" diff --git a/tsdb/agent/db_test.go b/tsdb/agent/db_test.go index 464caa75d..04e264ef6 100644 --- a/tsdb/agent/db_test.go +++ b/tsdb/agent/db_test.go @@ -31,7 +31,7 @@ import ( dto "github.com/prometheus/client_model/go" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage/remote" "github.com/prometheus/prometheus/tsdb/record" "github.com/prometheus/prometheus/tsdb/tsdbutil" diff --git a/tsdb/agent/series.go b/tsdb/agent/series.go index 80c440ae6..73fcb6009 100644 --- a/tsdb/agent/series.go +++ b/tsdb/agent/series.go @@ -16,7 +16,7 @@ package agent import ( "sync" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunks" ) diff --git a/tsdb/block.go b/tsdb/block.go index 0f2cd3ea3..e4db21f85 100644 --- a/tsdb/block.go +++ b/tsdb/block.go @@ -28,7 +28,7 @@ import ( "github.com/oklog/ulid" "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/block_test.go b/tsdb/block_test.go index 2bfeb841c..cebcde578 100644 --- a/tsdb/block_test.go +++ b/tsdb/block_test.go @@ -30,7 +30,7 @@ import ( "github.com/go-kit/log" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/fileutil" diff --git a/tsdb/blockwriter.go b/tsdb/blockwriter.go index a5a5d7474..064cd01c7 100644 --- a/tsdb/blockwriter.go +++ b/tsdb/blockwriter.go @@ -24,7 +24,7 @@ import ( "github.com/oklog/ulid" "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" ) diff --git a/tsdb/blockwriter_test.go b/tsdb/blockwriter_test.go index 07b500d7a..a47f3983e 100644 --- a/tsdb/blockwriter_test.go +++ b/tsdb/blockwriter_test.go @@ -24,7 +24,7 @@ import ( "github.com/go-kit/log" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/tsdbutil" ) diff --git a/tsdb/compact_test.go b/tsdb/compact_test.go index e30f2b190..bac9bfdfe 100644 --- a/tsdb/compact_test.go +++ b/tsdb/compact_test.go @@ -29,7 +29,7 @@ import ( prom_testutil "github.com/prometheus/client_golang/prometheus/testutil" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/fileutil" diff --git a/tsdb/db.go b/tsdb/db.go index c3b4af093..64e2a2bfb 100644 --- a/tsdb/db.go +++ b/tsdb/db.go @@ -36,7 +36,7 @@ import ( "golang.org/x/sync/errgroup" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/db_test.go b/tsdb/db_test.go index 4faf70b32..6120e896b 100644 --- a/tsdb/db_test.go +++ b/tsdb/db_test.go @@ -40,7 +40,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/exemplar.go b/tsdb/exemplar.go index 53cb5c9d9..516b538e1 100644 --- a/tsdb/exemplar.go +++ b/tsdb/exemplar.go @@ -22,8 +22,8 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" ) diff --git a/tsdb/exemplar_test.go b/tsdb/exemplar_test.go index 7876d9563..1418dcca9 100644 --- a/tsdb/exemplar_test.go +++ b/tsdb/exemplar_test.go @@ -25,8 +25,8 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" ) diff --git a/tsdb/head.go b/tsdb/head.go index 02b6b7b4e..2d96ba942 100644 --- a/tsdb/head.go +++ b/tsdb/head.go @@ -29,8 +29,8 @@ import ( "go.uber.org/atomic" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/head_append.go b/tsdb/head_append.go index a0b38e728..1f67f8626 100644 --- a/tsdb/head_append.go +++ b/tsdb/head_append.go @@ -21,8 +21,8 @@ import ( "github.com/go-kit/log/level" "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/head_bench_test.go b/tsdb/head_bench_test.go index 2f9100d13..a62429137 100644 --- a/tsdb/head_bench_test.go +++ b/tsdb/head_bench_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/atomic" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) func BenchmarkHeadStripeSeriesCreate(b *testing.B) { diff --git a/tsdb/head_read.go b/tsdb/head_read.go index 1f0f18627..cfe7b3045 100644 --- a/tsdb/head_read.go +++ b/tsdb/head_read.go @@ -21,7 +21,7 @@ import ( "github.com/go-kit/log/level" "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/head_test.go b/tsdb/head_test.go index d696b55a8..42f8a1e7b 100644 --- a/tsdb/head_test.go +++ b/tsdb/head_test.go @@ -37,8 +37,8 @@ import ( "go.uber.org/atomic" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/head_wal.go b/tsdb/head_wal.go index 5c63b3f19..5d5c995b3 100644 --- a/tsdb/head_wal.go +++ b/tsdb/head_wal.go @@ -29,8 +29,8 @@ import ( "github.com/pkg/errors" "go.uber.org/atomic" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/index/index.go b/tsdb/index/index.go index f5d69fceb..8e5eec6ce 100644 --- a/tsdb/index/index.go +++ b/tsdb/index/index.go @@ -30,7 +30,7 @@ import ( "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/encoding" diff --git a/tsdb/index/index_test.go b/tsdb/index/index_test.go index be5636ed2..c859dbb47 100644 --- a/tsdb/index/index_test.go +++ b/tsdb/index/index_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/index/postings.go b/tsdb/index/postings.go index 4a4d5506b..10312d84d 100644 --- a/tsdb/index/postings.go +++ b/tsdb/index/postings.go @@ -20,7 +20,7 @@ import ( "sort" "sync" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" ) diff --git a/tsdb/index/postings_test.go b/tsdb/index/postings_test.go index 8e9790f59..8cb76b0ad 100644 --- a/tsdb/index/postings_test.go +++ b/tsdb/index/postings_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" ) diff --git a/tsdb/mocks_test.go b/tsdb/mocks_test.go index 1c3cc4103..268017caa 100644 --- a/tsdb/mocks_test.go +++ b/tsdb/mocks_test.go @@ -16,7 +16,7 @@ package tsdb import ( "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/querier.go b/tsdb/querier.go index 4c48b9098..4719470a7 100644 --- a/tsdb/querier.go +++ b/tsdb/querier.go @@ -21,7 +21,7 @@ import ( "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/querier_bench_test.go b/tsdb/querier_bench_test.go index ed2d6fb4b..71dfef35b 100644 --- a/tsdb/querier_bench_test.go +++ b/tsdb/querier_bench_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) // Make entries ~50B in size, to emulate real-world high cardinality. diff --git a/tsdb/querier_test.go b/tsdb/querier_test.go index 804de3ab9..119875844 100644 --- a/tsdb/querier_test.go +++ b/tsdb/querier_test.go @@ -29,7 +29,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunkenc" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/tsdb/record/record.go b/tsdb/record/record.go index d6fa30ac0..79b7eaddb 100644 --- a/tsdb/record/record.go +++ b/tsdb/record/record.go @@ -20,7 +20,7 @@ import ( "github.com/pkg/errors" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/encoding" diff --git a/tsdb/record/record_test.go b/tsdb/record/record_test.go index f69989d50..0e241fd2f 100644 --- a/tsdb/record/record_test.go +++ b/tsdb/record/record_test.go @@ -20,7 +20,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/encoding" "github.com/prometheus/prometheus/tsdb/tombstones" ) diff --git a/tsdb/repair_test.go b/tsdb/repair_test.go index dc0fa598e..35fb7bbe1 100644 --- a/tsdb/repair_test.go +++ b/tsdb/repair_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/fileutil" "github.com/prometheus/prometheus/tsdb/index" diff --git a/tsdb/test/labels_test.go b/tsdb/test/labels_test.go index 07242181d..354dbf836 100644 --- a/tsdb/test/labels_test.go +++ b/tsdb/test/labels_test.go @@ -18,7 +18,7 @@ import ( "crypto/rand" "testing" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" ) func BenchmarkMapClone(b *testing.B) { diff --git a/tsdb/wal.go b/tsdb/wal.go index a0672f405..05661779f 100644 --- a/tsdb/wal.go +++ b/tsdb/wal.go @@ -32,7 +32,7 @@ import ( "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/encoding" diff --git a/tsdb/wal/checkpoint_test.go b/tsdb/wal/checkpoint_test.go index eed29be94..554a4b5d2 100644 --- a/tsdb/wal/checkpoint_test.go +++ b/tsdb/wal/checkpoint_test.go @@ -26,7 +26,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/record" ) diff --git a/tsdb/wal/watcher.go b/tsdb/wal/watcher.go index accefa7aa..3c47b58d0 100644 --- a/tsdb/wal/watcher.go +++ b/tsdb/wal/watcher.go @@ -30,7 +30,7 @@ import ( "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/tsdb/record" ) diff --git a/tsdb/wal/watcher_test.go b/tsdb/wal/watcher_test.go index d453b9da2..1c76ea585 100644 --- a/tsdb/wal/watcher_test.go +++ b/tsdb/wal/watcher_test.go @@ -25,7 +25,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/record" ) diff --git a/tsdb/wal_test.go b/tsdb/wal_test.go index 21d0a8b14..6b57cc230 100644 --- a/tsdb/wal_test.go +++ b/tsdb/wal_test.go @@ -30,7 +30,7 @@ import ( "github.com/go-kit/log" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/record" diff --git a/pkg/gate/gate.go b/util/gate/gate.go similarity index 100% rename from pkg/gate/gate.go rename to util/gate/gate.go diff --git a/pkg/logging/dedupe.go b/util/logging/dedupe.go similarity index 100% rename from pkg/logging/dedupe.go rename to util/logging/dedupe.go diff --git a/pkg/logging/dedupe_test.go b/util/logging/dedupe_test.go similarity index 100% rename from pkg/logging/dedupe_test.go rename to util/logging/dedupe_test.go diff --git a/pkg/logging/file.go b/util/logging/file.go similarity index 100% rename from pkg/logging/file.go rename to util/logging/file.go diff --git a/pkg/logging/file_test.go b/util/logging/file_test.go similarity index 100% rename from pkg/logging/file_test.go rename to util/logging/file_test.go diff --git a/pkg/logging/ratelimit.go b/util/logging/ratelimit.go similarity index 100% rename from pkg/logging/ratelimit.go rename to util/logging/ratelimit.go diff --git a/pkg/modtimevfs/modtimevfs.go b/util/modtimevfs/modtimevfs.go similarity index 100% rename from pkg/modtimevfs/modtimevfs.go rename to util/modtimevfs/modtimevfs.go diff --git a/pkg/pool/pool.go b/util/pool/pool.go similarity index 100% rename from pkg/pool/pool.go rename to util/pool/pool.go diff --git a/pkg/pool/pool_test.go b/util/pool/pool_test.go similarity index 100% rename from pkg/pool/pool_test.go rename to util/pool/pool_test.go diff --git a/pkg/runtime/limits_default.go b/util/runtime/limits_default.go similarity index 100% rename from pkg/runtime/limits_default.go rename to util/runtime/limits_default.go diff --git a/pkg/runtime/limits_windows.go b/util/runtime/limits_windows.go similarity index 100% rename from pkg/runtime/limits_windows.go rename to util/runtime/limits_windows.go diff --git a/pkg/runtime/statfs.go b/util/runtime/statfs.go similarity index 100% rename from pkg/runtime/statfs.go rename to util/runtime/statfs.go diff --git a/pkg/runtime/statfs_default.go b/util/runtime/statfs_default.go similarity index 100% rename from pkg/runtime/statfs_default.go rename to util/runtime/statfs_default.go diff --git a/pkg/runtime/statfs_linux_386.go b/util/runtime/statfs_linux_386.go similarity index 99% rename from pkg/runtime/statfs_linux_386.go rename to util/runtime/statfs_linux_386.go index 7494a0adf..b45eecdd3 100644 --- a/pkg/runtime/statfs_linux_386.go +++ b/util/runtime/statfs_linux_386.go @@ -23,6 +23,7 @@ import ( // Statfs returns the file system type (Unix only) func Statfs(path string) string { + // Types of file systems that may be returned by `statfs` fsTypes := map[int32]string{ 0xadf5: "ADFS_SUPER_MAGIC", diff --git a/pkg/runtime/statfs_uint32.go b/util/runtime/statfs_uint32.go similarity index 99% rename from pkg/runtime/statfs_uint32.go rename to util/runtime/statfs_uint32.go index 72d670a39..fa10ebc96 100644 --- a/pkg/runtime/statfs_uint32.go +++ b/util/runtime/statfs_uint32.go @@ -23,6 +23,7 @@ import ( // Statfs returns the file system type (Unix only) func Statfs(path string) string { + // Types of file systems that may be returned by `statfs` fsTypes := map[uint32]string{ 0xadf5: "ADFS_SUPER_MAGIC", diff --git a/pkg/runtime/uname_default.go b/util/runtime/uname_default.go similarity index 100% rename from pkg/runtime/uname_default.go rename to util/runtime/uname_default.go diff --git a/pkg/runtime/uname_linux.go b/util/runtime/uname_linux.go similarity index 100% rename from pkg/runtime/uname_linux.go rename to util/runtime/uname_linux.go diff --git a/pkg/runtime/vmlimits_default.go b/util/runtime/vmlimits_default.go similarity index 100% rename from pkg/runtime/vmlimits_default.go rename to util/runtime/vmlimits_default.go diff --git a/pkg/runtime/vmlimits_openbsd.go b/util/runtime/vmlimits_openbsd.go similarity index 100% rename from pkg/runtime/vmlimits_openbsd.go rename to util/runtime/vmlimits_openbsd.go diff --git a/util/teststorage/storage.go b/util/teststorage/storage.go index d4efcac43..a82989477 100644 --- a/util/teststorage/storage.go +++ b/util/teststorage/storage.go @@ -21,8 +21,8 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb" "github.com/prometheus/prometheus/util/testutil" diff --git a/web/api/v1/api.go b/web/api/v1/api.go index dc9c01d9a..39d07383c 100644 --- a/web/api/v1/api.go +++ b/web/api/v1/api.go @@ -39,10 +39,10 @@ import ( "github.com/prometheus/common/route" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/textparse" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/textparse" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/rules" diff --git a/web/api/v1/api_test.go b/web/api/v1/api_test.go index a04a3d8db..5112201f4 100644 --- a/web/api/v1/api_test.go +++ b/web/api/v1/api_test.go @@ -40,10 +40,10 @@ import ( "github.com/stretchr/testify/require" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/exemplar" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/textparse" - "github.com/prometheus/prometheus/pkg/timestamp" + "github.com/prometheus/prometheus/model/exemplar" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/textparse" + "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/prompb" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/promql/parser" diff --git a/web/federate.go b/web/federate.go index f97579ad4..c7a2ff61d 100644 --- a/web/federate.go +++ b/web/federate.go @@ -26,9 +26,9 @@ import ( "github.com/prometheus/common/expfmt" "github.com/prometheus/common/model" - "github.com/prometheus/prometheus/pkg/labels" - "github.com/prometheus/prometheus/pkg/timestamp" - "github.com/prometheus/prometheus/pkg/value" + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/model/timestamp" + "github.com/prometheus/prometheus/model/value" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/storage" diff --git a/web/federate_test.go b/web/federate_test.go index 35a02bb44..201109e88 100644 --- a/web/federate_test.go +++ b/web/federate_test.go @@ -28,7 +28,7 @@ import ( "github.com/stretchr/testify/require" "github.com/prometheus/prometheus/config" - "github.com/prometheus/prometheus/pkg/labels" + "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/tsdb" diff --git a/web/ui/assets_generate.go b/web/ui/assets_generate.go index 884329bd0..47f1a43c0 100644 --- a/web/ui/assets_generate.go +++ b/web/ui/assets_generate.go @@ -22,7 +22,7 @@ import ( "github.com/shurcooL/vfsgen" - "github.com/prometheus/prometheus/pkg/modtimevfs" + "github.com/prometheus/prometheus/util/modtimevfs" "github.com/prometheus/prometheus/web/ui" )