diff --git a/go.mod b/go.mod index ab1cff51184..850519209f1 100644 --- a/go.mod +++ b/go.mod @@ -34,7 +34,7 @@ require ( github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b github.com/pkg/errors v0.9.1 github.com/prometheus/alertmanager v0.27.0 - github.com/prometheus/client_golang v1.20.4 + github.com/prometheus/client_golang v1.20.5 github.com/prometheus/client_model v0.6.1 github.com/prometheus/common v0.59.1 github.com/prometheus/prometheus v1.99.0 @@ -282,7 +282,7 @@ require ( ) // Using a fork of Prometheus with Mimir-specific changes. -replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20241015102654-eaa7eae2d877 +replace github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20241016140351-5e9a771537ba // Replace memberlist with our fork which includes some fixes that haven't been // merged upstream yet: diff --git a/go.sum b/go.sum index 5d9684048b1..61fe6285365 100644 --- a/go.sum +++ b/go.sum @@ -1270,8 +1270,8 @@ github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56 h1:X8IKQ0wu40wp github.com/grafana/gomemcache v0.0.0-20240229205252-cd6a66d6fb56/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU= github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe h1:yIXAAbLswn7VNWBIvM71O2QsgfgW9fRXZNR0DXe6pDU= github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/grafana/mimir-prometheus v0.0.0-20241015102654-eaa7eae2d877 h1:HRrL6+agPwe5uuKwI7mdR8f5rUERPB8HuDw3UX10kHM= -github.com/grafana/mimir-prometheus v0.0.0-20241015102654-eaa7eae2d877/go.mod h1:oyDm7JaLUh+QGuGkC7iXC8IyTUq5rlh1ba2CRm9DlVg= +github.com/grafana/mimir-prometheus v0.0.0-20241016140351-5e9a771537ba h1:vTiUTY+yGoXJAxKA8h2GC6ynHoxbuMjTdp/pVrXlE/E= +github.com/grafana/mimir-prometheus v0.0.0-20241016140351-5e9a771537ba/go.mod h1:AvqWbZV+ePQxe3xQT4IX1iP1/evmMJKI7sNxzx20S6Y= github.com/grafana/opentracing-contrib-go-stdlib v0.0.0-20230509071955-f410e79da956 h1:em1oddjXL8c1tL0iFdtVtPloq2hRPen2MJQKoAWpxu0= github.com/grafana/opentracing-contrib-go-stdlib v0.0.0-20230509071955-f410e79da956/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= github.com/grafana/prometheus-alertmanager v0.25.1-0.20240924175849-b8b7c2c74eb6 h1:nT8QXdJo6wHMBcF0xEoXxEWkoUZOyzV/jyi/u9l7YEk= @@ -1583,8 +1583,8 @@ github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= diff --git a/pkg/compactor/blocks_cleaner_test.go b/pkg/compactor/blocks_cleaner_test.go index ab1e6d59e76..cd7dee90368 100644 --- a/pkg/compactor/blocks_cleaner_test.go +++ b/pkg/compactor/blocks_cleaner_test.go @@ -464,7 +464,12 @@ func TestBlocksCleaner_ShouldNotCleanupUserThatDoesntBelongToShardAnymore(t *tes require.ElementsMatch(t, []string{"user-1", "user-2"}, cleaner.lastOwnedUsers) // But there are no metrics for any user, because we did not in fact clean them. - test.AssertGatherAndCompare(t, reg, "", "cortex_bucket_blocks_count") + assert.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(` + # HELP cortex_bucket_blocks_count Total number of blocks in the bucket. Includes blocks marked for deletion, but not partial blocks. + # TYPE cortex_bucket_blocks_count gauge + `), + "cortex_bucket_blocks_count", + )) // Running cleanUsers again will see that users are no longer owned. require.NoError(t, cleaner.runCleanupWithErr(ctx)) diff --git a/pkg/compactor/compactor_test.go b/pkg/compactor/compactor_test.go index ec087c181b1..bd4afca4eaf 100644 --- a/pkg/compactor/compactor_test.go +++ b/pkg/compactor/compactor_test.go @@ -967,7 +967,7 @@ func TestMultitenantCompactor_ShouldNotCompactBlocksForUsersMarkedForDeletion(t "cortex_compactor_block_cleanup_started_total", "cortex_compactor_block_cleanup_completed_total", "cortex_compactor_block_cleanup_failed_total", "cortex_bucket_blocks_count", "cortex_bucket_blocks_marked_for_deletion_count", "cortex_bucket_index_last_successful_update_timestamp_seconds", } - testutil.AssertGatherAndCompare(t, registry, ` + assert.NoError(t, prom_testutil.GatherAndCompare(registry, strings.NewReader(` # TYPE cortex_compactor_runs_started_total counter # HELP cortex_compactor_runs_started_total Total number of compaction runs started. cortex_compactor_runs_started_total 1 @@ -1006,7 +1006,7 @@ func TestMultitenantCompactor_ShouldNotCompactBlocksForUsersMarkedForDeletion(t # TYPE cortex_compactor_block_cleanup_failed_total counter # HELP cortex_compactor_block_cleanup_failed_total Total number of blocks cleanup runs failed. cortex_compactor_block_cleanup_failed_total 0 - `, testedMetrics...) + `), testedMetrics...)) } func TestMultitenantCompactor_ShouldCompactAllUsersOnShardingEnabledButOnlyOneInstanceRunning(t *testing.T) { diff --git a/pkg/distributor/distributor_test.go b/pkg/distributor/distributor_test.go index 72a5ad262c2..e6a26355d17 100644 --- a/pkg/distributor/distributor_test.go +++ b/pkg/distributor/distributor_test.go @@ -377,7 +377,7 @@ func TestDistributor_MetricsCleanup(t *testing.T) { d.latestSeenSampleTimestampPerUser.WithLabelValues("userA").Set(1111) d.labelValuesWithNewlinesPerUser.WithLabelValues("userA").Inc() - util_test.AssertGatherAndCompare(t, reg, ` + require.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(` # HELP cortex_distributor_deduped_samples_total The total number of deduplicated samples. # TYPE cortex_distributor_deduped_samples_total counter cortex_distributor_deduped_samples_total{cluster="cluster1",user="userA"} 1 @@ -420,11 +420,23 @@ func TestDistributor_MetricsCleanup(t *testing.T) { # HELP cortex_distributor_label_values_with_newlines_total Total number of label values with newlines seen at ingestion time. # TYPE cortex_distributor_label_values_with_newlines_total counter cortex_distributor_label_values_with_newlines_total{user="userA"} 1 - `, metrics...) + `), metrics...)) d.cleanupInactiveUser("userA") - util_test.AssertGatherAndCompare(t, reg, ` + require.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(` + # HELP cortex_distributor_deduped_samples_total The total number of deduplicated samples. + # TYPE cortex_distributor_deduped_samples_total counter + + # HELP cortex_distributor_latest_seen_sample_timestamp_seconds Unix timestamp of latest received sample per user. + # TYPE cortex_distributor_latest_seen_sample_timestamp_seconds gauge + + # HELP cortex_distributor_metadata_in_total The total number of metadata the have come in to the distributor, including rejected. + # TYPE cortex_distributor_metadata_in_total counter + + # HELP cortex_distributor_non_ha_samples_received_total The total number of received samples for a user that has HA tracking turned on, but the sample didn't contain both HA labels. + # TYPE cortex_distributor_non_ha_samples_received_total counter + # HELP cortex_distributor_received_metadata_total The total number of received metadata, excluding rejected. # TYPE cortex_distributor_received_metadata_total counter cortex_distributor_received_metadata_total{user="userB"} 10 @@ -436,7 +448,16 @@ func TestDistributor_MetricsCleanup(t *testing.T) { # HELP cortex_distributor_received_exemplars_total The total number of received exemplars, excluding rejected and deduped exemplars. # TYPE cortex_distributor_received_exemplars_total counter cortex_distributor_received_exemplars_total{user="userB"} 10 - `, metrics...) + + # HELP cortex_distributor_samples_in_total The total number of samples that have come in to the distributor, including rejected or deduped samples. + # TYPE cortex_distributor_samples_in_total counter + + # HELP cortex_distributor_exemplars_in_total The total number of exemplars that have come in to the distributor, including rejected or deduped exemplars. + # TYPE cortex_distributor_exemplars_in_total counter + + # HELP cortex_distributor_label_values_with_newlines_total Total number of label values with newlines seen at ingestion time. + # TYPE cortex_distributor_label_values_with_newlines_total counter + `), metrics...)) } func TestDistributor_PushRequestRateLimiter(t *testing.T) { @@ -1666,7 +1687,7 @@ func TestDistributor_ExemplarValidation(t *testing.T) { } assert.Equal(t, tc.expectedExemplars, tc.req.Timeseries) - util_test.AssertGatherAndCompare(t, regs[0], tc.expectedMetrics, "cortex_discarded_exemplars_total") + assert.NoError(t, testutil.GatherAndCompare(regs[0], strings.NewReader(tc.expectedMetrics), "cortex_discarded_exemplars_total")) }) } } @@ -7169,7 +7190,7 @@ func TestDistributor_StorageConfigMetrics(t *testing.T) { happyIngesters: 3, replicationFactor: 3, }) - util_test.AssertGatherAndCompare(t, regs[0], ` + assert.NoError(t, testutil.GatherAndCompare(regs[0], strings.NewReader(` # HELP cortex_distributor_replication_factor The configured replication factor. # TYPE cortex_distributor_replication_factor gauge cortex_distributor_replication_factor 3 @@ -7177,7 +7198,7 @@ func TestDistributor_StorageConfigMetrics(t *testing.T) { # HELP cortex_distributor_ingest_storage_enabled Whether writes are being processed via ingest storage. Equal to 1 if ingest storage is enabled, 0 if disabled. # TYPE cortex_distributor_ingest_storage_enabled gauge cortex_distributor_ingest_storage_enabled 0 - `, "cortex_distributor_replication_factor", "cortex_distributor_ingest_storage_enabled") + `), "cortex_distributor_replication_factor", "cortex_distributor_ingest_storage_enabled")) }) t.Run("migration to ingest storage", func(t *testing.T) { @@ -7190,7 +7211,7 @@ func TestDistributor_StorageConfigMetrics(t *testing.T) { happyIngesters: 3, replicationFactor: 3, }) - util_test.AssertGatherAndCompare(t, regs[0], ` + assert.NoError(t, testutil.GatherAndCompare(regs[0], strings.NewReader(` # HELP cortex_distributor_replication_factor The configured replication factor. # TYPE cortex_distributor_replication_factor gauge cortex_distributor_replication_factor 3 @@ -7198,7 +7219,7 @@ func TestDistributor_StorageConfigMetrics(t *testing.T) { # HELP cortex_distributor_ingest_storage_enabled Whether writes are being processed via ingest storage. Equal to 1 if ingest storage is enabled, 0 if disabled. # TYPE cortex_distributor_ingest_storage_enabled gauge cortex_distributor_ingest_storage_enabled 1 - `, "cortex_distributor_replication_factor", "cortex_distributor_ingest_storage_enabled") + `), "cortex_distributor_replication_factor", "cortex_distributor_ingest_storage_enabled")) }) t.Run("ingest storage", func(t *testing.T) { @@ -7210,11 +7231,11 @@ func TestDistributor_StorageConfigMetrics(t *testing.T) { happyIngesters: 3, replicationFactor: 3, }) - util_test.AssertGatherAndCompare(t, regs[0], ` + assert.NoError(t, testutil.GatherAndCompare(regs[0], strings.NewReader(` # HELP cortex_distributor_ingest_storage_enabled Whether writes are being processed via ingest storage. Equal to 1 if ingest storage is enabled, 0 if disabled. # TYPE cortex_distributor_ingest_storage_enabled gauge cortex_distributor_ingest_storage_enabled 1 - `, "cortex_distributor_replication_factor", "cortex_distributor_ingest_storage_enabled") + `), "cortex_distributor_replication_factor", "cortex_distributor_ingest_storage_enabled")) }) } diff --git a/pkg/frontend/v1/frontend_test.go b/pkg/frontend/v1/frontend_test.go index 4bb09c83cbe..f4c55b02e8b 100644 --- a/pkg/frontend/v1/frontend_test.go +++ b/pkg/frontend/v1/frontend_test.go @@ -40,7 +40,6 @@ import ( "github.com/grafana/mimir/pkg/querier/stats" querier_worker "github.com/grafana/mimir/pkg/querier/worker" "github.com/grafana/mimir/pkg/scheduler/queue" - util_test "github.com/grafana/mimir/pkg/util/test" ) const ( @@ -223,7 +222,10 @@ func TestFrontendMetricsCleanup(t *testing.T) { fr.cleanupInactiveUserMetrics("1") - util_test.AssertGatherAndCompare(t, reg, "", "cortex_query_frontend_queue_length") + require.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(` + # HELP cortex_query_frontend_queue_length Number of queries in the queue. + # TYPE cortex_query_frontend_queue_length gauge + `), "cortex_query_frontend_queue_length")) } testFrontend(t, defaultFrontendConfig(), handler, test, nil, reg) diff --git a/pkg/ingester/ingester_test.go b/pkg/ingester/ingester_test.go index 588433fbef0..2780367a3ee 100644 --- a/pkg/ingester/ingester_test.go +++ b/pkg/ingester/ingester_test.go @@ -3345,7 +3345,8 @@ func TestIngester_Push(t *testing.T) { mn := append(metricNames, testData.additionalMetrics...) // Check tracked Prometheus metrics - util_test.AssertGatherAndCompare(t, registry, testData.expectedMetrics, mn...) + err = testutil.GatherAndCompare(registry, strings.NewReader(testData.expectedMetrics), mn...) + assert.NoError(t, err) // Check anonymous usage stats. expectedTenantsCount := 0 @@ -3570,7 +3571,7 @@ func TestIngester_Push_DecreaseInactiveSeries(t *testing.T) { cortex_ingester_memory_series_removed_total{user="test-2"} 0 ` - util_test.AssertGatherAndCompare(t, registry, expectedMetrics, metricNames...) + assert.NoError(t, testutil.GatherAndCompare(registry, strings.NewReader(expectedMetrics), metricNames...)) } func BenchmarkIngesterPush(b *testing.B) { @@ -7267,7 +7268,7 @@ func TestIngesterCompactAndCloseIdleTSDB(t *testing.T) { metricsToCheck := []string{"cortex_ingester_memory_series_created_total", "cortex_ingester_memory_series_removed_total", "cortex_ingester_memory_users", "cortex_ingester_active_series", "cortex_ingester_memory_metadata", "cortex_ingester_memory_metadata_created_total", "cortex_ingester_memory_metadata_removed_total"} - util_test.AssertGatherAndCompare(t, r, ` + require.NoError(t, testutil.GatherAndCompare(r, strings.NewReader(` # HELP cortex_ingester_memory_series_created_total The total number of series that were created per user. # TYPE cortex_ingester_memory_series_created_total counter cortex_ingester_memory_series_created_total{user="1"} 1 @@ -7291,7 +7292,7 @@ func TestIngesterCompactAndCloseIdleTSDB(t *testing.T) { # HELP cortex_ingester_memory_metadata_created_total The total number of metadata that were created per user # TYPE cortex_ingester_memory_metadata_created_total counter cortex_ingester_memory_metadata_created_total{user="1"} 1 - `, metricsToCheck...) + `), metricsToCheck...)) // Wait until TSDB has been closed and removed. test.Poll(t, 20*time.Second, 0, func() interface{} { @@ -7305,22 +7306,31 @@ func TestIngesterCompactAndCloseIdleTSDB(t *testing.T) { require.Equal(t, int64(0), i.seriesCount.Load()) // Flushing removed all series from memory. // Verify that user has disappeared from metrics. - util_test.AssertGatherAndCompare(t, r, ` + require.NoError(t, testutil.GatherAndCompare(r, strings.NewReader(` + # HELP cortex_ingester_memory_series_created_total The total number of series that were created per user. + # TYPE cortex_ingester_memory_series_created_total counter + + # HELP cortex_ingester_memory_series_removed_total The total number of series that were removed per user. + # TYPE cortex_ingester_memory_series_removed_total counter + # HELP cortex_ingester_memory_users The current number of users in memory. # TYPE cortex_ingester_memory_users gauge cortex_ingester_memory_users 0 + # HELP cortex_ingester_active_series Number of currently active series per user. + # TYPE cortex_ingester_active_series gauge + # HELP cortex_ingester_memory_metadata The current number of metadata in memory. # TYPE cortex_ingester_memory_metadata gauge cortex_ingester_memory_metadata 0 - `, metricsToCheck...) + `), metricsToCheck...)) // Pushing another sample will recreate TSDB. pushSingleSampleWithMetadata(t, i) i.updateActiveSeries(time.Now()) // User is back. - util_test.AssertGatherAndCompare(t, r, ` + require.NoError(t, testutil.GatherAndCompare(r, strings.NewReader(` # HELP cortex_ingester_memory_series_created_total The total number of series that were created per user. # TYPE cortex_ingester_memory_series_created_total counter cortex_ingester_memory_series_created_total{user="1"} 1 @@ -7344,7 +7354,7 @@ func TestIngesterCompactAndCloseIdleTSDB(t *testing.T) { # HELP cortex_ingester_memory_metadata_created_total The total number of metadata that were created per user # TYPE cortex_ingester_memory_metadata_created_total counter cortex_ingester_memory_metadata_created_total{user="1"} 1 - `, metricsToCheck...) + `), metricsToCheck...)) } func verifyCompactedHead(t *testing.T, i *Ingester, expected bool) { @@ -8490,7 +8500,7 @@ func TestIngesterMetadataMetrics(t *testing.T) { "cortex_ingester_memory_metadata", } - util_test.AssertGatherAndCompare(t, reg, ` + assert.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(` # HELP cortex_ingester_memory_metadata The current number of metadata in memory. # TYPE cortex_ingester_memory_metadata gauge cortex_ingester_memory_metadata 90 @@ -8499,11 +8509,11 @@ func TestIngesterMetadataMetrics(t *testing.T) { cortex_ingester_memory_metadata_created_total{user="1"} 30 cortex_ingester_memory_metadata_created_total{user="2"} 30 cortex_ingester_memory_metadata_created_total{user="3"} 30 - `, metricNames...) + `), metricNames...)) time.Sleep(40 * time.Millisecond) ing.purgeUserMetricsMetadata() - util_test.AssertGatherAndCompare(t, reg, ` + assert.NoError(t, testutil.GatherAndCompare(reg, strings.NewReader(` # HELP cortex_ingester_memory_metadata The current number of metadata in memory. # TYPE cortex_ingester_memory_metadata gauge cortex_ingester_memory_metadata 0 @@ -8517,7 +8527,7 @@ func TestIngesterMetadataMetrics(t *testing.T) { cortex_ingester_memory_metadata_removed_total{user="1"} 30 cortex_ingester_memory_metadata_removed_total{user="2"} 30 cortex_ingester_memory_metadata_removed_total{user="3"} 30 - `, metricNames...) + `), metricNames...)) } @@ -8967,7 +8977,7 @@ func TestIngesterActiveSeries(t *testing.T) { ` // Check tracked Prometheus metrics - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) }, }, "should cleanup metrics when tsdb closed": { @@ -9014,10 +9024,11 @@ func TestIngesterActiveSeries(t *testing.T) { ` // Check tracked Prometheus metrics - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) // close tsdbs and check for cleanup ingester.closeAllTSDB() - util_test.AssertGatherAndCompare(t, gatherer, "", metricNames...) + expectedMetrics = "" + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) }, }, "should track custom matchers, removing when zero": { @@ -9065,7 +9076,7 @@ func TestIngesterActiveSeries(t *testing.T) { ` // Check tracked Prometheus metrics - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) // Pushing second time to have entires which are not going to be purged currentTime = time.Now() @@ -9103,12 +9114,12 @@ func TestIngesterActiveSeries(t *testing.T) { ` // Check tracked Prometheus metrics - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) // Update active series again in a further future where no series are active anymore. currentTime = currentTime.Add(ingester.cfg.ActiveSeriesMetrics.IdleTimeout) ingester.updateActiveSeries(currentTime) - util_test.AssertGatherAndCompare(t, gatherer, "", metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(""), metricNames...)) }, }, "successful push, active series disabled": { @@ -9125,7 +9136,7 @@ func TestIngesterActiveSeries(t *testing.T) { expectedMetrics := `` // Check tracked Prometheus metrics - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) // Check that no active series are returned matchers := []*labels.Matcher{labels.MustNewMatcher(labels.MatchEqual, "team", "a")} @@ -9331,7 +9342,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="test_user"} 16 ` // Check tracked Prometheus metrics - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) // Add new runtime configs activeSeriesTenantOverride := new(TenantLimitsMock) @@ -9372,7 +9383,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_false_flagbased",user="other_test_user"} 16 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="other_test_user"} 16 ` - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) // Saving time before second push to avoid purging it before exposing. currentTime = time.Now() @@ -9415,7 +9426,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_a",user="test_user"} 16 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_b",user="test_user"} 16 ` - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) }, }, "remove runtime overwrite and revert to flag based config": { @@ -9465,7 +9476,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_b",user="test_user"} 16 ` // Check tracked Prometheus metrics - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) // Remove runtime configs limits := defaultLimitsTestConfig() @@ -9501,7 +9512,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { # TYPE cortex_ingester_active_series_loading gauge cortex_ingester_active_series_loading{user="test_user"} 1 ` - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) // Saving time before second push to avoid purging it before exposing. currentTime = time.Now() @@ -9544,7 +9555,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_false_flagbased",user="test_user"} 16 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="test_user"} 16 ` - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) }, }, "changing runtime override should result in new metrics": { @@ -9582,7 +9593,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { cortex_ingester_active_native_histogram_buckets_custom_tracker{name="bool_is_true_flagbased",user="test_user"} 16 ` // Check tracked Prometheus metrics - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) // Change runtime configs activeSeriesTenantOverride := new(TenantLimitsMock) @@ -9604,7 +9615,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { # TYPE cortex_ingester_active_series_loading gauge cortex_ingester_active_series_loading{user="test_user"} 1 ` - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) // Saving time before second push to avoid purging it before exposing. currentTime = time.Now() @@ -9643,7 +9654,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_c",user="test_user"} 16 cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_d",user="test_user"} 16 ` - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) }, }, "should cleanup loading metric at close": { @@ -9693,7 +9704,7 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { cortex_ingester_active_native_histogram_buckets_custom_tracker{name="team_b",user="test_user"} 16 ` // Check tracked Prometheus metrics - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) // Remove all configs limits := defaultLimitsTestConfig() @@ -9707,11 +9718,11 @@ func TestIngesterActiveSeriesConfigChanges(t *testing.T) { cortex_ingester_active_series_loading{user="test_user"} 1 cortex_ingester_active_series_loading{user="other_test_user"} 1 ` - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) ingester.closeAllTSDB() expectedMetrics = ` ` - util_test.AssertGatherAndCompare(t, gatherer, expectedMetrics, metricNames...) + require.NoError(t, testutil.GatherAndCompare(gatherer, strings.NewReader(expectedMetrics), metricNames...)) }, }, } @@ -10938,7 +10949,8 @@ func TestIngester_PushWithSampledErrors(t *testing.T) { } // Check tracked Prometheus metrics - util_test.AssertGatherAndCompare(t, registry, testData.expectedMetrics, metricNames...) + err = testutil.GatherAndCompare(registry, strings.NewReader(testData.expectedMetrics), metricNames...) + assert.NoError(t, err) }) } } diff --git a/pkg/storage/ingest/partition_offset_client_test.go b/pkg/storage/ingest/partition_offset_client_test.go index eddab581fb6..1017f4cdd79 100644 --- a/pkg/storage/ingest/partition_offset_client_test.go +++ b/pkg/storage/ingest/partition_offset_client_test.go @@ -20,7 +20,6 @@ import ( "github.com/twmb/franz-go/pkg/kmsg" "go.uber.org/atomic" - "github.com/grafana/mimir/pkg/util/test" "github.com/grafana/mimir/pkg/util/testkafka" ) @@ -410,9 +409,9 @@ func TestPartitionOffsetClient_FetchPartitionsLastProducedOffsets(t *testing.T) require.NoError(t, err) assert.Empty(t, offsets) - test.AssertGatherAndCompare(t, reg, "", + assert.NoError(t, promtest.GatherAndCompare(reg, strings.NewReader(""), "cortex_ingest_storage_reader_last_produced_offset_requests_total", - "cortex_ingest_storage_reader_last_produced_offset_failures_total") + "cortex_ingest_storage_reader_last_produced_offset_failures_total")) }) t.Run("should honor context deadline and not fail other in-flight requests issued while the canceled one was still running", func(t *testing.T) { diff --git a/pkg/streamingpromql/compat/fallback_engine_test.go b/pkg/streamingpromql/compat/fallback_engine_test.go index c00adb4795d..91c4cfb85a4 100644 --- a/pkg/streamingpromql/compat/fallback_engine_test.go +++ b/pkg/streamingpromql/compat/fallback_engine_test.go @@ -5,18 +5,18 @@ package compat import ( "context" "errors" + "strings" "testing" "time" "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" + promtest "github.com/prometheus/client_golang/prometheus/testutil" "github.com/prometheus/prometheus/promql" "github.com/prometheus/prometheus/promql/parser" "github.com/prometheus/prometheus/storage" "github.com/prometheus/prometheus/util/stats" "github.com/stretchr/testify/require" - - util_test "github.com/grafana/mimir/pkg/util/test" ) func TestEngineWithFallback(t *testing.T) { @@ -45,11 +45,11 @@ func TestEngineWithFallback(t *testing.T) { require.Equal(t, preferredEngine.query, query, "should return query from preferred engine") require.False(t, fallbackEngine.wasCalled, "should not call fallback engine if expression is supported by preferred engine") - util_test.AssertGatherAndCompare(t, reg, ` + require.NoError(t, promtest.GatherAndCompare(reg, strings.NewReader(` # HELP cortex_mimir_query_engine_supported_queries_total Total number of queries that were supported by the Mimir query engine. # TYPE cortex_mimir_query_engine_supported_queries_total counter cortex_mimir_query_engine_supported_queries_total 1 - `, "cortex_mimir_query_engine_supported_queries_total", "cortex_mimir_query_engine_unsupported_queries_total") + `), "cortex_mimir_query_engine_supported_queries_total", "cortex_mimir_query_engine_unsupported_queries_total")) }) t.Run("should fall back for unsupported expressions", func(t *testing.T) { @@ -63,14 +63,14 @@ func TestEngineWithFallback(t *testing.T) { require.NoError(t, err) require.Equal(t, fallbackEngine.query, query, "should return query from fallback engine if expression is not supported by preferred engine") - util_test.AssertGatherAndCompare(t, reg, ` + require.NoError(t, promtest.GatherAndCompare(reg, strings.NewReader(` # HELP cortex_mimir_query_engine_supported_queries_total Total number of queries that were supported by the Mimir query engine. # TYPE cortex_mimir_query_engine_supported_queries_total counter cortex_mimir_query_engine_supported_queries_total 0 # HELP cortex_mimir_query_engine_unsupported_queries_total Total number of queries that were not supported by the Mimir query engine and so fell back to Prometheus' engine. # TYPE cortex_mimir_query_engine_unsupported_queries_total counter cortex_mimir_query_engine_unsupported_queries_total{reason="this expression is not supported"} 1 - `, "cortex_mimir_query_engine_supported_queries_total", "cortex_mimir_query_engine_unsupported_queries_total") + `), "cortex_mimir_query_engine_supported_queries_total", "cortex_mimir_query_engine_unsupported_queries_total")) }) t.Run("should not fall back if creating query fails for another reason", func(t *testing.T) { @@ -96,14 +96,14 @@ func TestEngineWithFallback(t *testing.T) { require.NoError(t, err) require.Equal(t, fallbackEngine.query, query, "should return query from fallback engine if expression is not supported by preferred engine") - util_test.AssertGatherAndCompare(t, reg, ` + require.NoError(t, promtest.GatherAndCompare(reg, strings.NewReader(` # HELP cortex_mimir_query_engine_supported_queries_total Total number of queries that were supported by the Mimir query engine. # TYPE cortex_mimir_query_engine_supported_queries_total counter cortex_mimir_query_engine_supported_queries_total 0 # HELP cortex_mimir_query_engine_unsupported_queries_total Total number of queries that were not supported by the Mimir query engine and so fell back to Prometheus' engine. # TYPE cortex_mimir_query_engine_unsupported_queries_total counter cortex_mimir_query_engine_unsupported_queries_total{reason="fallback forced by HTTP header"} 1 - `, "cortex_mimir_query_engine_supported_queries_total", "cortex_mimir_query_engine_unsupported_queries_total") + `), "cortex_mimir_query_engine_supported_queries_total", "cortex_mimir_query_engine_unsupported_queries_total")) }) }) } diff --git a/pkg/util/test/metrics.go b/pkg/util/test/metrics.go index 78a43f83504..6c7c38aedd4 100644 --- a/pkg/util/test/metrics.go +++ b/pkg/util/test/metrics.go @@ -3,15 +3,9 @@ package test import ( - "bufio" "fmt" "io" "strings" - "testing" - - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/testutil" - "github.com/stretchr/testify/assert" ) type ExpectedMetricsContext struct { @@ -66,63 +60,3 @@ func (m *ExpectedMetrics) GetOutput() io.Reader { func (m *ExpectedMetrics) GetNames() []string { return m.Names } - -// AssertGatherAndCompare asserts that metrics in expectedText are found among g's metrics. -// If, however, any metrics are provided, the following rules apply: -// * Provided metrics that also exist in expectedText are required to be found among g's metrics. -// * Provided metrics that don't exist in expectedText are required to be absent from g's metrics. -func AssertGatherAndCompare(t *testing.T, g prometheus.Gatherer, expectedText string, metrics ...string) { - t.Helper() - assert.NoError(t, gatherAndCompare(g, expectedText, metrics...)) -} - -func gatherAndCompare(g prometheus.Gatherer, expectedText string, metrics ...string) error { - if len(metrics) == 0 { - return testutil.GatherAndCompare(g, strings.NewReader(expectedText)) - } - - sc := bufio.NewScanner(strings.NewReader(expectedText)) - absent := make([]string, len(metrics)) - copy(absent, metrics) - required := make([]string, 0, len(metrics)) - for sc.Scan() { - line := strings.TrimSpace(sc.Text()) - if len(line) == 0 || strings.HasPrefix(line, "#") { - continue - } - for i, metric := range absent { - if strings.HasPrefix(line, metric) && (line[len(metric)] == ' ' || line[len(metric)] == '{') { - absent = append(absent[:i], absent[i+1:]...) - required = append(required, metric) - break - } - } - } - // Sanity check. - if len(required)+len(absent) != len(metrics) { - panic(fmt.Errorf("length of required+absent doesn't match up with metrics")) - } - - if len(required) > 0 { - if err := testutil.GatherAndCompare(g, strings.NewReader(expectedText), required...); err != nil { - return err - } - } - - notAbsent := []string{} - for _, metric := range absent { - count, err := testutil.GatherAndCount(g, metric) - if err != nil { - return fmt.Errorf("GatherAndCount(g, %s): %w", metric, err) - } - - if count > 0 { - notAbsent = append(notAbsent, metric) - } - } - if len(notAbsent) > 0 { - return fmt.Errorf("should be absent: metrics=%s", strings.Join(notAbsent, ", ")) - } - - return nil -} diff --git a/pkg/util/test/metrics_test.go b/pkg/util/test/metrics_test.go deleted file mode 100644 index 43978aa6784..00000000000 --- a/pkg/util/test/metrics_test.go +++ /dev/null @@ -1,126 +0,0 @@ -// SPDX-License-Identifier: AGPL-3.0-only - -package test - -import ( - "testing" - - dto "github.com/prometheus/client_model/go" - "github.com/stretchr/testify/require" - "google.golang.org/protobuf/proto" -) - -func TestAssertGatherAndCompare(t *testing.T) { - g := fakeGatherer{ - metrics: []*dto.MetricFamily{ - { - Name: proto.String("cortex_distributor_deduped_samples_total"), - Help: proto.String("The total number of deduplicated samples."), - Metric: []*dto.Metric{ - { - Label: []*dto.LabelPair{ - { - Name: proto.String("environment"), - Value: proto.String("test"), - }, - }, - TimestampMs: proto.Int64(1000), - Counter: &dto.Counter{ - Value: proto.Float64(1), - }, - }, - }, - }, - }, - } - - t.Run("don't specify any metrics", func(t *testing.T) { - // When not specifying any metrics, an error should be returned due to missing metric - // cortex_distributor_latest_seen_sample_timestamp_seconds. - err := gatherAndCompare(g, ` - # HELP cortex_distributor_deduped_samples_total The total number of deduplicated samples. - # TYPE cortex_distributor_deduped_samples_total counter - cortex_distributor_deduped_samples_total{environment="test"} 1 1000 - - # HELP cortex_distributor_latest_seen_sample_timestamp_seconds Unix timestamp of latest received sample per user. - # TYPE cortex_distributor_latest_seen_sample_timestamp_seconds gauge - cortex_distributor_latest_seen_sample_timestamp_seconds{user="userA"} 1111 - `) - require.EqualError(t, err, ` # HELP cortex_distributor_deduped_samples_total The total number of deduplicated samples. - # TYPE cortex_distributor_deduped_samples_total counter - cortex_distributor_deduped_samples_total{environment="test"} 1 1000 -+# HELP cortex_distributor_latest_seen_sample_timestamp_seconds Unix timestamp of latest received sample per user. -+# TYPE cortex_distributor_latest_seen_sample_timestamp_seconds gauge -+cortex_distributor_latest_seen_sample_timestamp_seconds{user="userA"} 1111 - `) - }) - - t.Run("specify required metric", func(t *testing.T) { - // When specifying that cortex_distributor_deduped_samples_total as the one required metric, - // cortex_distributor_latest_seen_sample_timestamp_seconds should be ignored even if it's missing. - AssertGatherAndCompare(t, g, ` - # HELP cortex_distributor_deduped_samples_total The total number of deduplicated samples. - # TYPE cortex_distributor_deduped_samples_total counter - cortex_distributor_deduped_samples_total{environment="test"} 1 1000 - - # HELP cortex_distributor_latest_seen_sample_timestamp_seconds Unix timestamp of latest received sample per user. - # TYPE cortex_distributor_latest_seen_sample_timestamp_seconds gauge - cortex_distributor_latest_seen_sample_timestamp_seconds{user="userA"} 1111 - `, "cortex_distributor_deduped_samples_total") - }) - - t.Run("specify required metric which isn't there", func(t *testing.T) { - // When specifying that cortex_distributor_deduped_samples_total as the one required metric, - // cortex_distributor_latest_seen_sample_timestamp_seconds should be ignored even if it's missing. - err := gatherAndCompare(g, ` - # HELP cortex_distributor_deduped_samples_total The total number of deduplicated samples. - # TYPE cortex_distributor_deduped_samples_total counter - cortex_distributor_deduped_samples_total{environment="test"} 1 1000 - - # HELP cortex_distributor_latest_seen_sample_timestamp_seconds Unix timestamp of latest received sample per user. - # TYPE cortex_distributor_latest_seen_sample_timestamp_seconds gauge - cortex_distributor_latest_seen_sample_timestamp_seconds{user="userA"} 1111 - `, "cortex_distributor_latest_seen_sample_timestamp_seconds") - require.EqualError(t, err, "expected metric name(s) not found: [cortex_distributor_latest_seen_sample_timestamp_seconds]") - }) - - t.Run("specify required metric and absent metric", func(t *testing.T) { - // Verify that cortex_distributor_deduped_samples_total is found among metrics returned by g, - // and that conversely, cortex_distributor_non_ha_samples_received_total is not found among - // metrics returned by g. - // cortex_distributor_latest_seen_sample_timestamp_seconds is ignored, since it's not among - // the specified metrics. - AssertGatherAndCompare(t, g, ` - # HELP cortex_distributor_deduped_samples_total The total number of deduplicated samples. - # TYPE cortex_distributor_deduped_samples_total counter - cortex_distributor_deduped_samples_total{environment="test"} 1 1000 - - # HELP cortex_distributor_latest_seen_sample_timestamp_seconds Unix timestamp of latest received sample per user. - # TYPE cortex_distributor_latest_seen_sample_timestamp_seconds gauge - cortex_distributor_latest_seen_sample_timestamp_seconds{user="userA"} 1111 - `, "cortex_distributor_deduped_samples_total", "cortex_distributor_non_ha_samples_received_total") - }) - - t.Run("specify absent metric which is actually there", func(t *testing.T) { - // Verify that cortex_distributor_deduped_samples_total is found among metrics returned by g, - // and that conversely, cortex_distributor_non_ha_samples_received_total is not found among - // metrics returned by g. - // cortex_distributor_latest_seen_sample_timestamp_seconds is ignored, since it's not among - // the specified metrics. - err := gatherAndCompare(g, ` - # HELP cortex_distributor_latest_seen_sample_timestamp_seconds Unix timestamp of latest received sample per user. - # TYPE cortex_distributor_latest_seen_sample_timestamp_seconds gauge - cortex_distributor_latest_seen_sample_timestamp_seconds{user="userA"} 1111 - `, "cortex_distributor_deduped_samples_total", "cortex_distributor_non_ha_samples_received_total") - require.EqualError(t, err, "should be absent: metrics=cortex_distributor_deduped_samples_total") - }) -} - -type fakeGatherer struct { - metrics []*dto.MetricFamily - err error -} - -func (g fakeGatherer) Gather() ([]*dto.MetricFamily, error) { - return g.metrics, g.err -} diff --git a/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go b/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go index e0ac3466654..6f1200180a7 100644 --- a/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go +++ b/vendor/github.com/prometheus/client_golang/prometheus/testutil/testutil.go @@ -158,6 +158,9 @@ func GatherAndCount(g prometheus.Gatherer, metricNames ...string) (int, error) { // ScrapeAndCompare calls a remote exporter's endpoint which is expected to return some metrics in // plain text format. Then it compares it with the results that the `expected` would return. // If the `metricNames` is not empty it would filter the comparison only to the given metric names. +// +// NOTE: Be mindful of accidental discrepancies between expected and metricNames; metricNames filter +// both expected and scraped metrics. See https://github.com/prometheus/client_golang/issues/1351. func ScrapeAndCompare(url string, expected io.Reader, metricNames ...string) error { resp, err := http.Get(url) if err != nil { @@ -185,6 +188,9 @@ func ScrapeAndCompare(url string, expected io.Reader, metricNames ...string) err // CollectAndCompare collects the metrics identified by `metricNames` and compares them in the Prometheus text // exposition format to the data read from expected. +// +// NOTE: Be mindful of accidental discrepancies between expected and metricNames; metricNames filter +// both expected and collected metrics. See https://github.com/prometheus/client_golang/issues/1351. func CollectAndCompare(c prometheus.Collector, expected io.Reader, metricNames ...string) error { reg := prometheus.NewPedanticRegistry() if err := reg.Register(c); err != nil { @@ -197,6 +203,9 @@ func CollectAndCompare(c prometheus.Collector, expected io.Reader, metricNames . // it to an expected output read from the provided Reader in the Prometheus text // exposition format. If any metricNames are provided, only metrics with those // names are compared. +// +// NOTE: Be mindful of accidental discrepancies between expected and metricNames; metricNames filter +// both expected and gathered metrics. See https://github.com/prometheus/client_golang/issues/1351. func GatherAndCompare(g prometheus.Gatherer, expected io.Reader, metricNames ...string) error { return TransactionalGatherAndCompare(prometheus.ToTransactionalGatherer(g), expected, metricNames...) } @@ -205,6 +214,9 @@ func GatherAndCompare(g prometheus.Gatherer, expected io.Reader, metricNames ... // it to an expected output read from the provided Reader in the Prometheus text // exposition format. If any metricNames are provided, only metrics with those // names are compared. +// +// NOTE: Be mindful of accidental discrepancies between expected and metricNames; metricNames filter +// both expected and gathered metrics. See https://github.com/prometheus/client_golang/issues/1351. func TransactionalGatherAndCompare(g prometheus.TransactionalGatherer, expected io.Reader, metricNames ...string) error { got, done, err := g.Gather() defer done() @@ -277,15 +289,6 @@ func compareMetricFamilies(got, expected []*dto.MetricFamily, metricNames ...str if metricNames != nil { got = filterMetrics(got, metricNames) expected = filterMetrics(expected, metricNames) - if len(metricNames) > len(got) { - var missingMetricNames []string - for _, name := range metricNames { - if ok := hasMetricByName(got, name); !ok { - missingMetricNames = append(missingMetricNames, name) - } - } - return fmt.Errorf("expected metric name(s) not found: %v", missingMetricNames) - } } return compare(got, expected) @@ -327,12 +330,3 @@ func filterMetrics(metrics []*dto.MetricFamily, names []string) []*dto.MetricFam } return filtered } - -func hasMetricByName(metrics []*dto.MetricFamily, name string) bool { - for _, mf := range metrics { - if mf.GetName() == name { - return true - } - } - return false -} diff --git a/vendor/modules.txt b/vendor/modules.txt index b94c4ff63c6..43b19c38d61 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -970,7 +970,7 @@ github.com/prometheus/alertmanager/timeinterval github.com/prometheus/alertmanager/tracing github.com/prometheus/alertmanager/types github.com/prometheus/alertmanager/ui -# github.com/prometheus/client_golang v1.20.4 +# github.com/prometheus/client_golang v1.20.5 ## explicit; go 1.20 github.com/prometheus/client_golang/api github.com/prometheus/client_golang/api/prometheus/v1 @@ -1007,7 +1007,7 @@ github.com/prometheus/exporter-toolkit/web github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/prometheus/prometheus v1.99.0 => github.com/grafana/mimir-prometheus v0.0.0-20241015102654-eaa7eae2d877 +# github.com/prometheus/prometheus v1.99.0 => github.com/grafana/mimir-prometheus v0.0.0-20241016140351-5e9a771537ba ## explicit; go 1.22.0 github.com/prometheus/prometheus/config github.com/prometheus/prometheus/discovery @@ -1671,7 +1671,7 @@ sigs.k8s.io/kustomize/kyaml/yaml/walk sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 sigs.k8s.io/yaml/goyaml.v3 -# github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20241015102654-eaa7eae2d877 +# github.com/prometheus/prometheus => github.com/grafana/mimir-prometheus v0.0.0-20241016140351-5e9a771537ba # github.com/hashicorp/memberlist => github.com/grafana/memberlist v0.3.1-0.20220714140823-09ffed8adbbe # gopkg.in/yaml.v3 => github.com/colega/go-yaml-yaml v0.0.0-20220720105220-255a8d16d094 # github.com/grafana/regexp => github.com/grafana/regexp v0.0.0-20240531075221-3685f1377d7b