Merge ~ubuntu-docker-images/ubuntu-docker-images/+git/cortex:1.7-21.04-update into ~ubuntu-docker-images/ubuntu-docker-images/+git/cortex:edge

Proposed by Sergio Durigan Junior
Status: Merged
Merge reported by: Sergio Durigan Junior
Merged at revision: 9d7b9aade3aacedfcc5aa792dea5aec5d7434ad9
Proposed branch: ~ubuntu-docker-images/ubuntu-docker-images/+git/cortex:1.7-21.04-update
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/cortex:edge
Diff against target: 1120401 lines (+114309/-31190) (has conflicts)
1268 files modified
.github/ISSUE_TEMPLATE/bug_report.md (+30/-0)
.github/ISSUE_TEMPLATE/feature_request.md (+20/-0)
.github/stale.yml (+1/-1)
.github/workflows-doc.md (+82/-0)
.github/workflows/scripts/install-docker.sh (+7/-0)
.github/workflows/test-build-deploy.yml (+253/-0)
.gitignore (+13/-0)
ADOPTERS.md (+5/-0)
CHANGELOG.md (+274/-1)
MAINTAINERS (+1/-1)
Makefile (+56/-20)
Makefile.local.example (+10/-0)
README.md (+26/-7)
RELEASE.md (+7/-3)
SECURITY.md (+79/-0)
VERSION (+1/-1)
build-image/Dockerfile (+2/-2)
cmd/blocksconvert/main.go (+5/-0)
cmd/cortex/main.go (+18/-9)
cmd/cortex/main_test.go (+5/-0)
dev/null (+0/-178)
development/tsdb-blocks-storage-s3-gossip/.data-ingester-1/.gitignore (+2/-0)
development/tsdb-blocks-storage-s3-gossip/.data-ingester-2/.gitignore (+2/-0)
development/tsdb-blocks-storage-s3-gossip/.data-minio/.gitignore (+5/-0)
development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-alertmanager/.gitignore (+2/-0)
development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-ruler/.gitignore (+2/-0)
development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-tsdb/.gitignore (+2/-0)
development/tsdb-blocks-storage-s3-gossip/.dockerignore (+4/-0)
development/tsdb-blocks-storage-s3-gossip/.gitignore (+1/-0)
development/tsdb-blocks-storage-s3-gossip/compose-down.sh (+5/-0)
development/tsdb-blocks-storage-s3-gossip/compose-up.sh (+10/-0)
development/tsdb-blocks-storage-s3-gossip/config/cortex.yaml (+143/-0)
development/tsdb-blocks-storage-s3-gossip/config/grafana-agent.yaml (+64/-0)
development/tsdb-blocks-storage-s3-gossip/config/prometheus.yaml (+57/-0)
development/tsdb-blocks-storage-s3-gossip/config/runtime.yaml (+1/-0)
development/tsdb-blocks-storage-s3-gossip/dev.dockerfile (+10/-0)
development/tsdb-blocks-storage-s3-gossip/docker-compose.yml (+338/-0)
development/tsdb-blocks-storage-s3-single-binary/config/cortex.yaml (+3/-0)
development/tsdb-blocks-storage-s3-single-binary/config/runtime.yaml (+1/-0)
development/tsdb-blocks-storage-s3/.data-minio/.gitignore (+1/-0)
development/tsdb-blocks-storage-s3/.data-minio/cortex-ruler/.gitignore (+2/-0)
development/tsdb-blocks-storage-s3/config/cortex.yaml (+25/-3)
development/tsdb-blocks-storage-s3/config/grafana-agent.yaml (+9/-3)
development/tsdb-blocks-storage-s3/config/prometheus.yaml (+9/-3)
development/tsdb-blocks-storage-s3/config/runtime.yaml (+1/-0)
development/tsdb-blocks-storage-s3/docker-compose.yml (+126/-24)
development/tsdb-blocks-storage-s3/goland/TSDB Query-frontend (using scheduler).run.xml (+6/-0)
development/tsdb-blocks-storage-s3/goland/TSDB Query-scheduler.run.xml (+6/-0)
development/tsdb-blocks-storage-s3/goland/ruler-1.run.xml (+5/-0)
development/tsdb-blocks-storage-s3/goland/ruler-2.run.xml (+5/-0)
development/tsdb-blocks-storage-swift-single-binary/.data-cortex-1/.gitignore (+2/-0)
development/tsdb-blocks-storage-swift-single-binary/.data-cortex-2/.gitignore (+2/-0)
development/tsdb-blocks-storage-swift-single-binary/.dockerignore (+4/-0)
development/tsdb-blocks-storage-swift-single-binary/.gitignore (+2/-0)
development/tsdb-blocks-storage-swift-single-binary/compose-down.sh (+5/-0)
development/tsdb-blocks-storage-swift-single-binary/compose-up.sh (+7/-0)
development/tsdb-blocks-storage-swift-single-binary/config/cortex.yaml (+84/-0)
development/tsdb-blocks-storage-swift-single-binary/config/grafana-agent.yaml (+26/-0)
development/tsdb-blocks-storage-swift-single-binary/config/prometheus.yaml (+19/-0)
development/tsdb-blocks-storage-swift-single-binary/config/runtime.yaml (+1/-0)
development/tsdb-blocks-storage-swift-single-binary/dev.dockerfile (+5/-0)
development/tsdb-blocks-storage-swift-single-binary/docker-compose.yml (+100/-0)
docs/_index.md (+46/-5)
docs/api/_index.md (+100/-7)
docs/architecture.md (+29/-8)
docs/blocks-storage/_index.md (+6/-5)
docs/blocks-storage/bucket-index.md (+61/-0)
docs/blocks-storage/compactor.md (+66/-11)
docs/blocks-storage/compactor.template (+14/-3)
docs/blocks-storage/convert-stored-chunks-to-blocks.md (+23/-1)
docs/blocks-storage/learn-more.md (+21/-0)
docs/blocks-storage/production-tips.md (+12/-0)
docs/blocks-storage/querier.md (+219/-20)
docs/blocks-storage/querier.template (+18/-1)
docs/blocks-storage/store-gateway.md (+222/-14)
docs/blocks-storage/store-gateway.template (+26/-0)
docs/case-studies/_index.md (+1/-1)
docs/case-studies/buoyant-cloud.md (+83/-0)
docs/chunks-storage/_index.md (+36/-0)
docs/chunks-storage/aws-tips.md (+8/-11)
docs/chunks-storage/caching.md (+7/-5)
docs/chunks-storage/ingesters-with-wal.md (+4/-2)
docs/chunks-storage/schema-config.md (+149/-0)
docs/chunks-storage/table-manager.md (+69/-0)
docs/configuration/_index.md (+1/-1)
docs/configuration/arguments.md (+29/-26)
docs/configuration/config-file-reference.md (+885/-117)
docs/configuration/config-file-reference.template (+1/-0)
docs/configuration/single-process-config-blocks-gossip-1.yaml (+1/-1)
docs/configuration/single-process-config-blocks-gossip-2.yaml (+1/-1)
docs/configuration/single-process-config-blocks-tls.yaml (+3/-2)
docs/configuration/v1-guarantees.md (+22/-4)
docs/contributing/how-to-add-a-maintainer.md (+1/-1)
docs/contributing/how-to-update-the-build-image.md (+1/-1)
docs/contributing/how-to-upgrade-golang-version.md (+2/-2)
docs/getting-started/getting-started-blocks.md (+2/-2)
docs/guides/authentication-and-authorisation.md (+26/-4)
docs/guides/capacity-planning.md (+1/-1)
docs/guides/deleting-series.md (+1/-1)
docs/guides/glossary.md (+118/-0)
docs/guides/grpc-storage-plugin.md (+1/-1)
docs/guides/ha-pair-handling.md (+1/-1)
docs/guides/ingesters-rolling-updates.md (+2/-2)
docs/guides/limitations.md (+45/-0)
docs/guides/running-chunks-storage-in-production.md (+10/-10)
docs/guides/running-chunks-storage-with-cassandra.md (+9/-9)
docs/guides/running-cortex-on-kubernetes.md (+2/-2)
docs/guides/sharded_ruler.md (+1/-1)
docs/guides/shuffle-sharding.md (+105/-0)
docs/guides/tls.md (+1/-1)
docs/guides/tracing.md (+1/-1)
docs/guides/zone-replication.md (+40/-15)
docs/operations/_index.md (+1/-1)
docs/operations/scalable-query-frontend.md (+42/-15)
docs/proposals/_index.md (+1/-1)
docs/proposals/blocks-storage-bucket-index.md (+109/-0)
docs/proposals/cross-tenant-query-federation.md (+124/-0)
docs/proposals/scalable-alertmanager.md (+78/-0)
docs/proposals/shuffle-sharding-and-zone-awareness.md (+110/-0)
docs/proposals/shuffle-sharding-on-the-read-path.md (+347/-0)
docs/proposals/tenant-deletion.md (+152/-0)
docs/roadmap.md (+1/-1)
go.mod (+43/-22)
go.sum (+285/-112)
integration/alertmanager_test.go (+179/-10)
integration/api_endpoints_test.go (+23/-0)
integration/asserts.go (+16/-10)
integration/backward_compatibility_test.go (+80/-56)
integration/chunks_delete_series_test.go (+1/-1)
integration/chunks_storage_backends_test.go (+15/-13)
integration/configs.go (+77/-37)
integration/e2e/db/db.go (+4/-3)
integration/e2e/images/images.go (+2/-2)
integration/e2e/metrics.go (+11/-1)
integration/e2e/metrics_options.go (+6/-0)
integration/e2e/scenario_test.go (+2/-2)
integration/e2e/service.go (+65/-23)
integration/e2e/util.go (+17/-0)
integration/e2ecortex/client.go (+38/-41)
integration/e2ecortex/services.go (+67/-2)
integration/e2ecortex/storage.go (+1/-1)
integration/getting_started_single_process_config_test.go (+12/-4)
integration/ingester_flush_test.go (+4/-4)
integration/ingester_hand_over_test.go (+2/-2)
integration/ingester_limits_test.go (+136/-0)
integration/ingester_sharding_test.go (+147/-0)
integration/integration_memberlist_single_binary_test.go (+1/-1)
integration/querier_remote_read_test.go (+3/-3)
integration/querier_sharding_test.go (+195/-0)
integration/querier_streaming_mixed_ingester_test.go (+2/-3)
integration/querier_tenant_federation_test.go (+181/-0)
integration/querier_test.go (+263/-31)
integration/query_frontend_test.go (+175/-79)
integration/ruler_test.go (+163/-8)
integration/s3_storage_client_test.go (+1/-1)
integration/zone_aware_test.go (+152/-0)
k8s/alertmanager-dep.yaml (+1/-1)
k8s/configs-dep.yaml (+1/-1)
k8s/distributor-dep.yaml (+1/-1)
k8s/ingester-dep.yaml (+1/-1)
k8s/querier-dep.yaml (+1/-1)
k8s/query-frontend-dep.yaml (+1/-1)
k8s/ruler-dep.yaml (+1/-1)
k8s/table-manager-dep.yaml (+1/-1)
oci/Dockerfile.ubuntu (+50/-0)
oci/README.md (+12/-0)
oci/data/cortex.yaml (+5/-0)
pkg/alertmanager/alertmanager.go (+36/-1)
pkg/alertmanager/alertmanager_http.go (+53/-0)
pkg/alertmanager/alertmanager_metrics.go (+33/-28)
pkg/alertmanager/alertmanager_metrics_test.go (+76/-4)
pkg/alertmanager/alertmanager_ring.go (+114/-0)
pkg/alertmanager/alertmanager_ring_test.go (+55/-0)
pkg/alertmanager/alerts/objectclient/store.go (+8/-3)
pkg/alertmanager/api.go (+18/-8)
pkg/alertmanager/api_test.go (+104/-52)
pkg/alertmanager/lifecycle.go (+28/-0)
pkg/alertmanager/multitenant.go (+398/-106)
pkg/alertmanager/multitenant_test.go (+609/-83)
pkg/alertmanager/storage.go (+29/-10)
pkg/api/api.go (+153/-205)
pkg/api/handlers.go (+254/-11)
pkg/api/handlers_test.go (+109/-0)
pkg/api/middlewares.go (+3/-3)
pkg/api/queryable_test.go (+2/-0)
pkg/chunk/aws/dynamodb_storage_client.go (+10/-2)
pkg/chunk/aws/fixtures.go (+1/-4)
pkg/chunk/aws/s3_storage_client.go (+69/-22)
pkg/chunk/aws/s3_storage_client_test.go (+1/-1)
pkg/chunk/azure/blob_storage_client.go (+18/-14)
pkg/chunk/cache/redis_client.go (+15/-13)
pkg/chunk/cassandra/storage_client.go (+25/-3)
pkg/chunk/cassandra/storage_client_test.go (+42/-0)
pkg/chunk/cassandra/testdata/example.com-key.pem (+27/-0)
pkg/chunk/cassandra/testdata/example.com.ca.pem (+25/-0)
pkg/chunk/cassandra/testdata/example.com.pem (+27/-0)
pkg/chunk/chunk.go (+15/-40)
pkg/chunk/chunk_store.go (+23/-13)
pkg/chunk/chunk_test.go (+1/-1)
pkg/chunk/composite_store.go (+4/-4)
pkg/chunk/encoding/bigchunk.go (+4/-0)
pkg/chunk/encoding/chunk.go (+51/-3)
pkg/chunk/encoding/chunk_test.go (+72/-0)
pkg/chunk/encoding/doubledelta.go (+4/-0)
pkg/chunk/encoding/varbit.go (+4/-0)
pkg/chunk/gcp/bigtable_index_client.go (+1/-1)
pkg/chunk/gcp/fixtures.go (+1/-3)
pkg/chunk/gcp/gcs_object_client.go (+39/-23)
pkg/chunk/grpc/grpc_client.go (+1/-1)
pkg/chunk/inmemory_storage_client.go (+35/-6)
pkg/chunk/local/boltdb_index_client.go (+32/-28)
pkg/chunk/local/fixtures.go (+1/-3)
pkg/chunk/local/fs_object_client.go (+52/-35)
pkg/chunk/local/fs_object_client_test.go (+72/-29)
pkg/chunk/openstack/swift_object_client.go (+32/-50)
pkg/chunk/purger/blocks_purger_api.go (+122/-0)
pkg/chunk/purger/blocks_purger_api_test.go (+90/-0)
pkg/chunk/purger/delete_plan.pb.go (+30/-30)
pkg/chunk/purger/delete_requests_store.go (+21/-10)
pkg/chunk/purger/purger.go (+2/-2)
pkg/chunk/purger/purger_test.go (+10/-7)
pkg/chunk/purger/request_handler.go (+4/-4)
pkg/chunk/purger/tombstones.go (+56/-5)
pkg/chunk/purger/tombstones_test.go (+73/-1)
pkg/chunk/schema_config.go (+2/-15)
pkg/chunk/schema_test.go (+2/-2)
pkg/chunk/schema_util.go (+25/-8)
pkg/chunk/schema_util_test.go (+1/-1)
pkg/chunk/series_store.go (+2/-2)
pkg/chunk/storage/caching_index_client.go (+2/-2)
pkg/chunk/storage/caching_index_client.pb.go (+23/-23)
pkg/chunk/storage/factory.go (+11/-8)
pkg/chunk/storage_client.go (+15/-7)
pkg/chunk/table_manager.go (+10/-19)
pkg/chunk/util/util.go (+21/-0)
pkg/compactor/blocks_cleaner.go (+244/-73)
pkg/compactor/blocks_cleaner_test.go (+369/-52)
pkg/compactor/compactor.go (+258/-72)
pkg/compactor/compactor_ring.go (+12/-3)
pkg/compactor/compactor_ring_test.go (+2/-0)
pkg/compactor/compactor_test.go (+346/-103)
pkg/compactor/syncer_metrics.go (+13/-24)
pkg/configs/api/api.go (+5/-5)
pkg/configs/client/client.go (+3/-0)
pkg/configs/db/postgres/postgres.go (+14/-0)
pkg/configs/legacy_promql/functions_test.go (+8/-8)
pkg/cortex/cortex.go (+112/-64)
pkg/cortex/cortex_test.go (+12/-7)
pkg/cortex/modules.go (+289/-143)
pkg/cortex/modules_test.go (+101/-0)
pkg/cortex/runtime_config.go (+13/-1)
pkg/cortex/runtime_config_test.go (+99/-0)
pkg/cortex/server_service.go (+1/-0)
pkg/cortex/status.go (+4/-0)
pkg/distributor/distributor.go (+117/-43)
pkg/distributor/distributor_ring.go (+3/-3)
pkg/distributor/distributor_test.go (+460/-151)
pkg/distributor/ha_tracker.go (+74/-24)
pkg/distributor/ha_tracker_test.go (+129/-8)
pkg/distributor/query.go (+60/-18)
pkg/frontend/config.go (+80/-0)
pkg/frontend/downstream_roundtripper.go (+40/-0)
pkg/frontend/frontend_test.go (+286/-0)
pkg/frontend/transport/handler.go (+203/-0)
pkg/frontend/transport/handler_test.go (+30/-0)
pkg/frontend/transport/roundtripper.go (+47/-0)
pkg/frontend/v1/frontend.go (+291/-0)
pkg/frontend/v1/frontend_test.go (+65/-126)
pkg/frontend/v1/frontendv1pb/frontend.pb.go (+351/-92)
pkg/frontend/v1/frontendv1pb/frontend.proto (+40/-0)
pkg/frontend/v1/queue_test.go (+170/-0)
pkg/frontend/v2/frontend.go (+319/-0)
pkg/frontend/v2/frontend_scheduler_worker.go (+328/-0)
pkg/frontend/v2/frontend_test.go (+274/-0)
pkg/frontend/v2/frontendv2pb/frontend.pb.go (+782/-0)
pkg/frontend/v2/frontendv2pb/frontend.proto (+28/-0)
pkg/ingester/active_series.go (+244/-0)
pkg/ingester/active_series_test.go (+213/-0)
pkg/ingester/client/client_test.go (+2/-2)
pkg/ingester/client/compat.go (+6/-0)
pkg/ingester/client/cortex.pb.go (+274/-113)
pkg/ingester/client/cortex.proto (+5/-1)
pkg/ingester/flush.go (+25/-0)
pkg/ingester/flush_test.go (+3/-2)
pkg/ingester/ingester.go (+77/-22)
pkg/ingester/ingester_test.go (+100/-7)
pkg/ingester/ingester_v2.go (+582/-124)
pkg/ingester/ingester_v2_test.go (+714/-29)
pkg/ingester/lifecycle_test.go (+33/-3)
pkg/ingester/limiter.go (+52/-16)
pkg/ingester/limiter_test.go (+177/-305)
pkg/ingester/metrics.go (+64/-38)
pkg/ingester/metrics_test.go (+199/-0)
pkg/ingester/user_state.go (+27/-2)
pkg/ingester/user_state_test.go (+16/-0)
pkg/ingester/wal.go (+5/-36)
pkg/querier/block.go (+5/-4)
pkg/querier/block_test.go (+21/-16)
pkg/querier/blocks_consistency_checker.go (+10/-9)
pkg/querier/blocks_consistency_checker_test.go (+37/-38)
pkg/querier/blocks_finder_bucket_index.go (+108/-0)
pkg/querier/blocks_finder_bucket_index_test.go (+221/-0)
pkg/querier/blocks_finder_bucket_scan.go (+69/-58)
pkg/querier/blocks_finder_bucket_scan_test.go (+202/-185)
pkg/querier/blocks_store_queryable.go (+394/-70)
pkg/querier/blocks_store_queryable_test.go (+632/-89)
pkg/querier/blocks_store_replicated_set.go (+3/-4)
pkg/querier/blocks_store_replicated_set_test.go (+69/-71)
pkg/querier/chunk_store_queryable.go (+10/-2)
pkg/querier/chunk_store_queryable_test.go (+1/-1)
pkg/querier/chunk_tar_test.go (+2/-2)
pkg/querier/chunks_handler.go (+2/-2)
pkg/querier/distributor_queryable.go (+14/-11)
pkg/querier/distributor_queryable_test.go (+6/-4)
pkg/querier/lazyquery/lazyquery.go (+1/-1)
pkg/querier/querier.go (+197/-30)
pkg/querier/querier_benchmark_test.go (+1/-1)
pkg/querier/querier_test.go (+315/-78)
pkg/querier/queryrange/limits.go (+50/-64)
pkg/querier/queryrange/limits_test.go (+218/-0)
pkg/querier/queryrange/query_range.go (+28/-11)
pkg/querier/queryrange/query_range_test.go (+3/-3)
pkg/querier/queryrange/queryable_test.go (+4/-4)
pkg/querier/queryrange/queryrange.pb.go (+63/-63)
pkg/querier/queryrange/querysharding_test.go (+4/-4)
pkg/querier/queryrange/results_cache.go (+51/-16)
pkg/querier/queryrange/results_cache_test.go (+65/-34)
pkg/querier/queryrange/retry.go (+3/-1)
pkg/querier/queryrange/roundtrip.go (+20/-9)
pkg/querier/queryrange/roundtrip_test.go (+1/-1)
pkg/querier/queryrange/split_by_interval_test.go (+1/-1)
pkg/querier/queryrange/util.go (+72/-0)
pkg/querier/remote_read.go (+3/-5)
pkg/querier/stats/stats.go (+69/-0)
pkg/querier/stats/stats.pb.go (+414/-0)
pkg/querier/stats/stats.proto (+16/-0)
pkg/querier/stats/time_middleware.go (+30/-0)
pkg/querier/store_gateway_client.go (+1/-1)
pkg/querier/store_gateway_client_test.go (+8/-0)
pkg/querier/tenantfederation/merge_queryable.go (+309/-0)
pkg/querier/tenantfederation/merge_queryable_test.go (+338/-0)
pkg/querier/tenantfederation/tenant_federation.go (+14/-0)
pkg/querier/worker/frontend_processor.go (+78/-93)
pkg/querier/worker/frontend_processor_test.go (+75/-0)
pkg/querier/worker/processor_manager.go (+75/-0)
pkg/querier/worker/scheduler_processor.go (+217/-0)
pkg/querier/worker/worker.go (+266/-0)
pkg/querier/worker/worker_test.go (+49/-50)
pkg/ring/basic_lifecycler.go (+24/-4)
pkg/ring/basic_lifecycler_delegates.go (+11/-6)
pkg/ring/basic_lifecycler_delegates_test.go (+18/-5)
pkg/ring/basic_lifecycler_test.go (+53/-16)
pkg/ring/batch.go (+7/-4)
pkg/ring/client/ring_service_discovery.go (+1/-1)
pkg/ring/client/ring_service_discovery_test.go (+1/-1)
pkg/ring/http.go (+32/-21)
pkg/ring/kv/consul/client.go (+27/-6)
pkg/ring/kv/memberlist/kv_init_service.go (+339/-7)
pkg/ring/kv/memberlist/kv_init_service_test.go (+58/-0)
pkg/ring/kv/memberlist/memberlist_client.go (+154/-2)
pkg/ring/kv/memberlist/memberlist_client_test.go (+18/-0)
pkg/ring/kv/metrics.go (+11/-3)
pkg/ring/lifecycler.go (+98/-40)
pkg/ring/lifecycler_test.go (+71/-32)
pkg/ring/merge_test.go (+9/-9)
pkg/ring/model.go (+230/-58)
pkg/ring/model_test.go (+268/-46)
pkg/ring/replication_set.go (+91/-33)
pkg/ring/replication_set_test.go (+201/-0)
pkg/ring/replication_set_tracker.go (+96/-0)
pkg/ring/replication_set_tracker_test.go (+266/-0)
pkg/ring/replication_strategy.go (+44/-28)
pkg/ring/replication_strategy_test.go (+104/-43)
pkg/ring/ring.go (+483/-130)
pkg/ring/ring.pb.go (+85/-28)
pkg/ring/ring.proto (+20/-1)
pkg/ring/ring_test.go (+1849/-159)
pkg/ring/tokens.go (+8/-1)
pkg/ring/tokens_test.go (+20/-0)
pkg/ring/util.go (+75/-3)
pkg/ring/util_test.go (+150/-0)
pkg/ruler/api.go (+67/-25)
pkg/ruler/api_test.go (+151/-27)
pkg/ruler/compat.go (+50/-36)
pkg/ruler/compat_test.go (+78/-0)
pkg/ruler/lifecycle.go (+1/-1)
pkg/ruler/lifecycle_test.go (+1/-1)
pkg/ruler/manager.go (+27/-10)
pkg/ruler/manager_metrics.go (+33/-35)
pkg/ruler/manager_metrics_test.go (+99/-16)
pkg/ruler/manager_test.go (+112/-0)
pkg/ruler/mapper.go (+25/-1)
pkg/ruler/notifier.go (+25/-19)
pkg/ruler/notifier_test.go (+51/-32)
pkg/ruler/ruler.go (+283/-66)
pkg/ruler/ruler_ring.go (+12/-3)
pkg/ruler/ruler_test.go (+403/-9)
pkg/ruler/rules/local/local.go (+37/-19)
pkg/ruler/rules/local/local_test.go (+4/-3)
pkg/ruler/rules/objectclient/rule_store.go (+136/-55)
pkg/ruler/rules/objectclient/rule_store_test.go (+158/-0)
pkg/ruler/rules/store.go (+50/-10)
pkg/ruler/storage.go (+15/-7)
pkg/ruler/store_mock_test.go (+24/-10)
pkg/scheduler/queue/queue.go (+189/-0)
pkg/scheduler/queue/queue_test.go (+99/-0)
pkg/scheduler/queue/user_queues.go (+224/-0)
pkg/scheduler/queue/user_queues_test.go (+291/-0)
pkg/scheduler/scheduler.go (+470/-0)
pkg/scheduler/scheduler_test.go (+485/-0)
pkg/scheduler/schedulerpb/scheduler.pb.go (+1905/-0)
pkg/scheduler/schedulerpb/scheduler.proto (+90/-0)
pkg/storage/bucket/azure/config.go (+3/-3)
pkg/storage/bucket/bucket_util.go (+33/-0)
pkg/storage/bucket/bucket_util_test.go (+28/-0)
pkg/storage/bucket/client.go (+132/-0)
pkg/storage/bucket/client_mock.go (+31/-17)
pkg/storage/bucket/client_test.go (+5/-5)
pkg/storage/bucket/filesystem/config.go (+3/-3)
pkg/storage/bucket/gcs/config.go (+3/-3)
pkg/storage/bucket/s3/bucket_client.go (+9/-0)
pkg/storage/bucket/s3/config.go (+76/-0)
pkg/storage/bucket/swift/bucket_client.go (+46/-0)
pkg/storage/bucket/swift/config.go (+55/-0)
pkg/storage/bucket/user_bucket_client.go (+1/-1)
pkg/storage/tsdb/bucketindex/index.go (+260/-0)
pkg/storage/tsdb/bucketindex/index_test.go (+349/-0)
pkg/storage/tsdb/bucketindex/loader.go (+275/-0)
pkg/storage/tsdb/bucketindex/loader_test.go (+582/-0)
pkg/storage/tsdb/bucketindex/markers.go (+89/-0)
pkg/storage/tsdb/bucketindex/markers_bucket_client.go (+139/-0)
pkg/storage/tsdb/bucketindex/markers_bucket_client_test.go (+154/-0)
pkg/storage/tsdb/bucketindex/markers_test.go (+66/-0)
pkg/storage/tsdb/bucketindex/storage.go (+92/-0)
pkg/storage/tsdb/bucketindex/storage_test.go (+115/-0)
pkg/storage/tsdb/bucketindex/updater.go (+225/-0)
pkg/storage/tsdb/bucketindex/updater_test.go (+206/-0)
pkg/storage/tsdb/caching_bucket.go (+41/-12)
pkg/storage/tsdb/caching_bucket_test.go (+21/-0)
pkg/storage/tsdb/config.go (+60/-54)
pkg/storage/tsdb/config_test.go (+53/-212)
pkg/storage/tsdb/index_cache.go (+1/-1)
pkg/storage/tsdb/memcache_client_config.go (+1/-1)
pkg/storage/tsdb/ref_cache_test.go (+9/-3)
pkg/storage/tsdb/tenant_deletion_mark.go (+76/-0)
pkg/storage/tsdb/tenant_deletion_mark_test.go (+51/-0)
pkg/storage/tsdb/testutil/block_mock.go (+68/-0)
pkg/storage/tsdb/testutil/objstore.go (+26/-0)
pkg/storage/tsdb/users_scanner.go (+37/-12)
pkg/storage/tsdb/users_scanner_test.go (+16/-9)
pkg/storage/tsdb/util.go (+0/-6)
pkg/storegateway/bucket_index_metadata_fetcher.go (+236/-0)
pkg/storegateway/bucket_index_metadata_fetcher_test.go (+323/-0)
pkg/storegateway/bucket_store_metrics.go (+61/-22)
pkg/storegateway/bucket_store_metrics_test.go (+128/-5)
pkg/storegateway/bucket_stores.go (+97/-39)
pkg/storegateway/bucket_stores_test.go (+91/-11)
pkg/storegateway/gateway.go (+23/-16)
pkg/storegateway/gateway_ring.go (+28/-35)
pkg/storegateway/gateway_ring_test.go (+64/-0)
pkg/storegateway/gateway_test.go (+170/-139)
pkg/storegateway/metadata_fetcher_filters.go (+78/-0)
pkg/storegateway/metadata_fetcher_filters_test.go (+106/-0)
pkg/storegateway/metadata_fetcher_metrics.go (+6/-23)
pkg/storegateway/sharding_strategy.go (+3/-4)
pkg/storegateway/sharding_strategy_test.go (+96/-79)
pkg/storegateway/storegatewaypb/gateway.pb.go (+92/-11)
pkg/storegateway/storegatewaypb/gateway.proto (+6/-0)
pkg/tenant/resolver.go (+132/-0)
pkg/tenant/resolver_test.go (+107/-0)
pkg/tenant/tenant.go (+105/-0)
pkg/tenant/tenant_test.go (+42/-0)
pkg/util/concurrency/buffer.go (+25/-0)
pkg/util/concurrency/runner.go (+64/-0)
pkg/util/dns_watcher.go (+82/-0)
pkg/util/errors.go (+3/-1)
pkg/util/extract_forwarded.go (+1/-1)
pkg/util/fakeauth/fake_auth.go (+15/-7)
pkg/util/flagext/stringslicecsv.go (+33/-0)
pkg/util/flagext/stringslicecsv_test.go (+34/-0)
pkg/util/grpcclient/grpcclient.go (+14/-19)
pkg/util/grpcutil/carrier.go (+40/-0)
pkg/util/http.go (+122/-66)
pkg/util/http_test.go (+110/-14)
pkg/util/log.go (+3/-2)
pkg/util/math.go (+8/-0)
pkg/util/metrics_helper.go (+250/-50)
pkg/util/metrics_helper_test.go (+601/-54)
pkg/util/modules/modules.go (+28/-10)
pkg/util/modules/modules_test.go (+80/-6)
pkg/util/process/collector.go (+132/-0)
pkg/util/process/collector_test.go (+55/-0)
pkg/util/push/push.go (+1/-2)
pkg/util/runtimeconfig/manager.go (+10/-12)
pkg/util/runtimeconfig/manager_test.go (+27/-3)
pkg/util/shard.go (+45/-0)
pkg/util/shard_test.go (+83/-0)
pkg/util/spanlogger/spanlogger.go (+35/-9)
pkg/util/spanlogger/spanlogger_test.go (+30/-0)
pkg/util/strings.go (+9/-0)
pkg/util/test/poll.go (+1/-1)
pkg/util/time.go (+11/-0)
pkg/util/validation/limits.go (+132/-15)
pkg/util/validation/limits_test.go (+129/-1)
pkg/util/validation/validate.go (+9/-6)
pkg/util/validation/validate_test.go (+6/-6)
pkg/util/yolo.go (+7/-0)
pkg/util/yolo_test.go (+13/-0)
tools/auth-injector/main.go (+59/-0)
tools/blocksconvert/builder/builder.go (+200/-299)
tools/blocksconvert/builder/builder_test.go (+62/-0)
tools/blocksconvert/builder/fetcher.go (+4/-5)
tools/blocksconvert/builder/heap.go (+30/-0)
tools/blocksconvert/builder/series.go (+224/-0)
tools/blocksconvert/builder/series_iterator.go (+163/-0)
tools/blocksconvert/builder/series_test.go (+127/-0)
tools/blocksconvert/builder/symbols_iterator.go (+172/-0)
tools/blocksconvert/builder/tsdb.go (+218/-68)
tools/blocksconvert/builder/tsdb_test.go (+60/-25)
tools/blocksconvert/cleaner/cleaner.go (+357/-0)
tools/blocksconvert/plan_file.go (+10/-16)
tools/blocksconvert/planprocessor/heartbeat.go (+1/-1)
tools/blocksconvert/planprocessor/service.go (+412/-0)
tools/blocksconvert/scanner/bigtable_index_reader.go (+17/-5)
tools/blocksconvert/scanner/files.go (+2/-2)
tools/blocksconvert/scanner/scanner.go (+144/-24)
tools/blocksconvert/scanner/scanner_test.go (+27/-0)
tools/blocksconvert/scheduler.pb.go (+32/-31)
tools/blocksconvert/scheduler.proto (+2/-1)
tools/blocksconvert/scheduler/plan_status.go (+3/-5)
tools/blocksconvert/scheduler/scheduler.go (+34/-5)
tools/blocksconvert/scheduler/scheduler_test.go (+9/-5)
tools/blocksconvert/shared_config.go (+4/-4)
tools/doc-generator/main.go (+5/-4)
tools/doc-generator/parser.go (+21/-0)
tools/test (+2/-14)
tools/website/web-pre.sh (+4/-4)
vendor/cloud.google.com/go/CHANGES.md (+176/-2)
vendor/cloud.google.com/go/CONTRIBUTING.md (+22/-78)
vendor/cloud.google.com/go/README.md (+2/-3)
vendor/cloud.google.com/go/RELEASING.md (+29/-54)
vendor/cloud.google.com/go/compute/metadata/metadata.go (+2/-1)
vendor/cloud.google.com/go/go.mod (+14/-19)
vendor/cloud.google.com/go/go.sum (+138/-8)
vendor/cloud.google.com/go/internal/.repo-metadata-full.json (+133/-29)
vendor/cloud.google.com/go/internal/version/version.go (+1/-1)
vendor/cloud.google.com/go/longrunning/autogen/doc.go (+8/-2)
vendor/cloud.google.com/go/longrunning/autogen/info.go (+11/-17)
vendor/cloud.google.com/go/longrunning/autogen/operations_client.go (+19/-7)
vendor/cloud.google.com/go/storage/CHANGES.md (+28/-0)
vendor/cloud.google.com/go/storage/bucket.go (+2/-1)
vendor/cloud.google.com/go/storage/copy.go (+10/-0)
vendor/cloud.google.com/go/storage/doc.go (+15/-0)
vendor/cloud.google.com/go/storage/go.mod (+10/-12)
vendor/cloud.google.com/go/storage/go.sum (+134/-4)
vendor/cloud.google.com/go/storage/go110.go (+17/-1)
vendor/cloud.google.com/go/storage/post_policy_v4.go (+377/-0)
vendor/cloud.google.com/go/storage/reader.go (+34/-2)
vendor/cloud.google.com/go/storage/storage.go (+173/-21)
vendor/cloud.google.com/go/storage/writer.go (+22/-14)
vendor/cloud.google.com/go/tools.go (+0/-1)
vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go (+61/-17)
vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go (+20/-1)
vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go (+4/-4)
vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go (+18/-1)
vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go (+1/-0)
vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go (+745/-102)
vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go (+2/-1)
vendor/github.com/aws/aws-sdk-go/aws/session/doc.go (+17/-0)
vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go (+10/-0)
vendor/github.com/aws/aws-sdk-go/aws/session/session.go (+59/-2)
vendor/github.com/aws/aws-sdk-go/aws/version.go (+1/-1)
vendor/github.com/aws/aws-sdk-go/internal/ini/ini_parser.go (+4/-3)
vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/accesspoint_arn.go (+10/-5)
vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/arn.go (+8/-5)
vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/outpost_arn.go (+126/-0)
vendor/github.com/aws/aws-sdk-go/internal/s3shared/endpoint_errors.go (+189/-0)
vendor/github.com/aws/aws-sdk-go/internal/s3shared/resource_request.go (+62/-0)
vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go (+29/-7)
vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go (+3/-3)
vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go (+1576/-163)
vendor/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface/interface.go (+15/-0)
vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go (+24/-3)
vendor/github.com/aws/aws-sdk-go/service/s3/api.go (+5677/-719)
vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go (+4/-2)
vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go (+0/-13)
vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go (+93/-125)
vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go (+177/-0)
vendor/github.com/aws/aws-sdk-go/service/s3/errors.go (+7/-1)
vendor/github.com/aws/aws-sdk-go/service/s3/s3iface/interface.go (+28/-0)
vendor/github.com/aws/aws-sdk-go/service/s3/sse.go (+1/-1)
vendor/github.com/aws/aws-sdk-go/service/sts/api.go (+7/-3)
vendor/github.com/aws/aws-sdk-go/service/sts/doc.go (+5/-81)
vendor/github.com/go-redis/redis/v8/CHANGELOG.md (+14/-2)
vendor/github.com/go-redis/redis/v8/Makefile (+1/-0)
vendor/github.com/go-redis/redis/v8/README.md (+9/-2)
vendor/github.com/go-redis/redis/v8/cluster.go (+36/-33)
vendor/github.com/go-redis/redis/v8/command.go (+375/-148)
vendor/github.com/go-redis/redis/v8/commands.go (+52/-8)
vendor/github.com/go-redis/redis/v8/go.mod (+4/-9)
vendor/github.com/go-redis/redis/v8/go.sum (+6/-43)
vendor/github.com/go-redis/redis/v8/internal/arg.go (+1/-92)
vendor/github.com/go-redis/redis/v8/internal/hashtag/hashtag.go (+1/-1)
vendor/github.com/go-redis/redis/v8/internal/internal.go (+1/-1)
vendor/github.com/go-redis/redis/v8/internal/pool/conn.go (+7/-3)
vendor/github.com/go-redis/redis/v8/internal/proto/reader.go (+8/-3)
vendor/github.com/go-redis/redis/v8/internal/rand/rand.go (+45/-0)
vendor/github.com/go-redis/redis/v8/internal/util.go (+5/-5)
vendor/github.com/go-redis/redis/v8/options.go (+65/-18)
vendor/github.com/go-redis/redis/v8/pubsub.go (+24/-13)
vendor/github.com/go-redis/redis/v8/redis.go (+78/-68)
vendor/github.com/go-redis/redis/v8/renovate.json (+5/-0)
vendor/github.com/go-redis/redis/v8/ring.go (+25/-22)
vendor/github.com/go-redis/redis/v8/sentinel.go (+226/-134)
vendor/github.com/golang/protobuf/jsonpb/encode.go (+8/-3)
vendor/github.com/golang/protobuf/proto/text_decode.go (+1/-1)
vendor/github.com/golang/snappy/AUTHORS (+2/-0)
vendor/github.com/golang/snappy/CONTRIBUTORS (+2/-0)
vendor/github.com/golang/snappy/decode.go (+4/-0)
vendor/github.com/golang/snappy/decode_arm64.s (+503/-0)
vendor/github.com/golang/snappy/decode_asm.go (+15/-0)
vendor/github.com/golang/snappy/decode_other.go (+19/-5)
vendor/github.com/golang/snappy/encode.go (+4/-0)
vendor/github.com/golang/snappy/encode_arm64.s (+729/-0)
vendor/github.com/golang/snappy/encode_asm.go (+30/-0)
vendor/github.com/golang/snappy/encode_other.go (+1/-1)
vendor/github.com/google/go-cmp/cmp/compare.go (+4/-4)
vendor/github.com/google/go-cmp/cmp/options.go (+4/-1)
vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/context.go (+59/-4)
vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go (+20/-3)
vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go (+11/-4)
vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshaler_registry.go (+9/-1)
vendor/github.com/hashicorp/consul/api/acl.go (+11/-1)
vendor/github.com/hashicorp/consul/api/agent.go (+110/-20)
vendor/github.com/hashicorp/consul/api/api.go (+4/-2)
vendor/github.com/hashicorp/consul/api/catalog.go (+44/-0)
vendor/github.com/hashicorp/consul/api/config_entry.go (+2/-0)
vendor/github.com/hashicorp/consul/api/config_entry_discoverychain.go (+3/-0)
vendor/github.com/hashicorp/consul/api/config_entry_gateways.go (+5/-1)
vendor/github.com/hashicorp/consul/api/go.mod (+2/-2)
vendor/github.com/hashicorp/consul/api/go.sum (+13/-9)
vendor/github.com/hashicorp/consul/api/lock.go (+3/-0)
vendor/github.com/hashicorp/consul/api/operator_keyring.go (+3/-0)
vendor/github.com/hashicorp/go-multierror/.travis.yml (+1/-1)
vendor/github.com/hashicorp/go-multierror/README.md (+37/-3)
vendor/github.com/hashicorp/go-multierror/go.mod (+2/-0)
vendor/github.com/hashicorp/go-multierror/go.sum (+0/-2)
vendor/github.com/hashicorp/go-multierror/group.go (+38/-0)
vendor/github.com/hashicorp/go-multierror/multierror.go (+67/-0)
vendor/github.com/jmespath/go-jmespath/.travis.yml (+13/-2)
vendor/github.com/jmespath/go-jmespath/Makefile (+14/-7)
vendor/github.com/jmespath/go-jmespath/go.mod (+1/-1)
vendor/github.com/jmespath/go-jmespath/go.sum (+4/-4)
vendor/github.com/lann/builder/.travis.yml (+3/-2)
vendor/github.com/lann/builder/LICENSE (+2/-3)
vendor/github.com/lann/builder/registry.go (+13/-3)
vendor/github.com/miekg/dns/.travis.yml (+2/-2)
vendor/github.com/miekg/dns/README.md (+4/-6)
vendor/github.com/miekg/dns/client.go (+16/-5)
vendor/github.com/miekg/dns/dnssec.go (+5/-41)
vendor/github.com/miekg/dns/dnssec_keygen.go (+2/-2)
vendor/github.com/miekg/dns/dnssec_keyscan.go (+3/-15)
vendor/github.com/miekg/dns/dnssec_privkey.go (+2/-18)
vendor/github.com/miekg/dns/doc.go (+1/-1)
vendor/github.com/miekg/dns/msg_helpers.go (+67/-0)
vendor/github.com/miekg/dns/msg_truncate.go (+6/-5)
vendor/github.com/miekg/dns/scan.go (+25/-4)
vendor/github.com/miekg/dns/scan_rr.go (+9/-10)
vendor/github.com/miekg/dns/serve_mux.go (+2/-2)
vendor/github.com/miekg/dns/server.go (+87/-23)
vendor/github.com/miekg/dns/sig0.go (+1/-13)
vendor/github.com/miekg/dns/svcb.go (+744/-0)
vendor/github.com/miekg/dns/tsig.go (+53/-29)
vendor/github.com/miekg/dns/types.go (+2/-0)
vendor/github.com/miekg/dns/version.go (+1/-1)
vendor/github.com/miekg/dns/zduplicate.go (+42/-0)
vendor/github.com/miekg/dns/zmsg.go (+82/-0)
vendor/github.com/miekg/dns/ztypes.go (+25/-0)
vendor/github.com/ncw/swift/.travis.yml (+6/-4)
vendor/github.com/ncw/swift/README.md (+2/-0)
vendor/github.com/ncw/swift/largeobjects.go (+1/-1)
vendor/github.com/ncw/swift/swift.go (+33/-10)
vendor/github.com/opentracing-contrib/go-grpc/LICENSE (+1/-2)
vendor/github.com/opentracing-contrib/go-grpc/client.go (+14/-9)
vendor/github.com/opentracing-contrib/go-grpc/go.mod (+12/-0)
vendor/github.com/opentracing-contrib/go-grpc/go.sum (+44/-0)
vendor/github.com/opentracing-contrib/go-grpc/options.go (+6/-1)
vendor/github.com/opentracing-contrib/go-grpc/server.go (+4/-4)
vendor/github.com/prometheus/alertmanager/api/v1/api.go (+1/-1)
vendor/github.com/prometheus/alertmanager/api/v2/api.go (+1/-1)
vendor/github.com/prometheus/alertmanager/asset/assets_vfsdata.go (+27/-5)
vendor/github.com/prometheus/alertmanager/config/config.go (+2/-2)
vendor/github.com/prometheus/alertmanager/config/coordinator.go (+7/-6)
vendor/github.com/prometheus/alertmanager/config/notifiers.go (+29/-12)
vendor/github.com/prometheus/alertmanager/notify/notify.go (+39/-13)
vendor/github.com/prometheus/alertmanager/notify/opsgenie/opsgenie.go (+7/-2)
vendor/github.com/prometheus/alertmanager/notify/pagerduty/pagerduty.go (+22/-10)
vendor/github.com/prometheus/alertmanager/notify/pushover/pushover.go (+1/-1)
vendor/github.com/prometheus/alertmanager/notify/slack/slack.go (+1/-1)
vendor/github.com/prometheus/alertmanager/notify/victorops/victorops.go (+1/-1)
vendor/github.com/prometheus/alertmanager/notify/webhook/webhook.go (+1/-1)
vendor/github.com/prometheus/alertmanager/notify/wechat/wechat.go (+20/-12)
vendor/github.com/prometheus/alertmanager/template/default.tmpl (+1/-1)
vendor/github.com/prometheus/client_golang/api/prometheus/v1/api.go (+51/-17)
vendor/github.com/prometheus/client_golang/prometheus/counter.go (+10/-10)
vendor/github.com/prometheus/client_golang/prometheus/desc.go (+1/-1)
vendor/github.com/prometheus/client_golang/prometheus/gauge.go (+10/-10)
vendor/github.com/prometheus/client_golang/prometheus/go_collector.go (+4/-3)
vendor/github.com/prometheus/client_golang/prometheus/histogram.go (+11/-11)
vendor/github.com/prometheus/client_golang/prometheus/metric.go (+1/-1)
vendor/github.com/prometheus/client_golang/prometheus/summary.go (+13/-13)
vendor/github.com/prometheus/client_golang/prometheus/value.go (+10/-3)
vendor/github.com/prometheus/client_golang/prometheus/vec.go (+93/-21)
vendor/github.com/prometheus/client_golang/prometheus/wrap.go (+3/-1)
vendor/github.com/prometheus/common/config/config.go (+19/-0)
vendor/github.com/prometheus/common/config/http_config.go (+43/-7)
vendor/github.com/prometheus/common/expfmt/text_parse.go (+11/-0)
vendor/github.com/prometheus/common/version/info.go (+2/-0)
vendor/github.com/prometheus/procfs/CODE_OF_CONDUCT.md (+3/-0)
vendor/github.com/prometheus/procfs/cpuinfo.go (+44/-0)
vendor/github.com/prometheus/procfs/cpuinfo_armx.go (+8/-10)
vendor/github.com/prometheus/procfs/cpuinfo_mipsx.go (+19/-0)
vendor/github.com/prometheus/procfs/cpuinfo_others.go (+19/-0)
vendor/github.com/prometheus/procfs/cpuinfo_ppcx.go (+7/-18)
vendor/github.com/prometheus/procfs/cpuinfo_x86.go (+19/-0)
vendor/github.com/prometheus/procfs/fixtures.ttar (+73/-2)
vendor/github.com/prometheus/procfs/kernel_random.go (+1/-1)
vendor/github.com/prometheus/procfs/mdstat.go (+4/-1)
vendor/github.com/prometheus/procfs/proc_status.go (+5/-1)
vendor/github.com/prometheus/prometheus/config/config.go (+120/-149)
vendor/github.com/prometheus/prometheus/discovery/README.md (+85/-55)
vendor/github.com/prometheus/prometheus/discovery/discovery.go (+117/-0)
vendor/github.com/prometheus/prometheus/discovery/dns/dns.go (+15/-5)
vendor/github.com/prometheus/prometheus/discovery/file/file.go (+21/-0)
vendor/github.com/prometheus/prometheus/discovery/manager.go (+18/-125)
vendor/github.com/prometheus/prometheus/discovery/registry.go (+258/-0)
vendor/github.com/prometheus/prometheus/notifier/notifier.go (+3/-3)
vendor/github.com/prometheus/prometheus/pkg/labels/labels.go (+26/-11)
vendor/github.com/prometheus/prometheus/pkg/labels/regexp.go (+3/-3)
vendor/github.com/prometheus/prometheus/pkg/textparse/interface.go (+8/-8)
vendor/github.com/prometheus/prometheus/prompb/README.md (+1/-1)
vendor/github.com/prometheus/prometheus/prompb/remote.pb.go (+98/-35)
vendor/github.com/prometheus/prometheus/prompb/remote.proto (+4/-0)
vendor/github.com/prometheus/prometheus/prompb/types.pb.go (+422/-45)
vendor/github.com/prometheus/prometheus/prompb/types.proto (+20/-0)
vendor/github.com/prometheus/prometheus/promql/engine.go (+44/-40)
vendor/github.com/prometheus/prometheus/promql/functions.go (+59/-59)
vendor/github.com/prometheus/prometheus/promql/parser/generated_parser.y (+4/-4)
vendor/github.com/prometheus/prometheus/promql/parser/generated_parser.y.go (+40/-43)
vendor/github.com/prometheus/prometheus/promql/parser/lex.go (+5/-5)
vendor/github.com/prometheus/prometheus/promql/parser/parse.go (+2/-2)
vendor/github.com/prometheus/prometheus/promql/parser/printer.go (+1/-0)
vendor/github.com/prometheus/prometheus/promql/test.go (+1/-0)
vendor/github.com/prometheus/prometheus/promql/value.go (+1/-2)
vendor/github.com/prometheus/prometheus/rules/alerting.go (+2/-4)
vendor/github.com/prometheus/prometheus/rules/manager.go (+40/-28)
vendor/github.com/prometheus/prometheus/scrape/manager.go (+1/-1)
vendor/github.com/prometheus/prometheus/scrape/scrape.go (+65/-29)
vendor/github.com/prometheus/prometheus/scrape/target.go (+1/-0)
vendor/github.com/prometheus/prometheus/storage/fanout.go (+4/-6)
vendor/github.com/prometheus/prometheus/storage/merge.go (+60/-32)
vendor/github.com/prometheus/prometheus/storage/remote/client.go (+28/-23)
vendor/github.com/prometheus/prometheus/storage/remote/codec.go (+14/-0)
vendor/github.com/prometheus/prometheus/storage/remote/intern.go (+1/-3)
vendor/github.com/prometheus/prometheus/storage/remote/max_timestamp.go (+47/-0)
vendor/github.com/prometheus/prometheus/storage/remote/metadata_watcher.go (+163/-0)
vendor/github.com/prometheus/prometheus/storage/remote/queue_manager.go (+227/-76)
vendor/github.com/prometheus/prometheus/storage/remote/read.go (+1/-0)
vendor/github.com/prometheus/prometheus/storage/remote/storage.go (+10/-5)
vendor/github.com/prometheus/prometheus/storage/remote/write.go (+31/-14)
vendor/github.com/prometheus/prometheus/template/template.go (+3/-4)
vendor/github.com/prometheus/prometheus/tsdb/CHANGELOG.md (+1/-1)
vendor/github.com/prometheus/prometheus/tsdb/README.md (+7/-1)
vendor/github.com/prometheus/prometheus/tsdb/block.go (+13/-19)
vendor/github.com/prometheus/prometheus/tsdb/blockwriter.go (+123/-0)
vendor/github.com/prometheus/prometheus/tsdb/chunkenc/chunk.go (+3/-4)
vendor/github.com/prometheus/prometheus/tsdb/chunks/chunks.go (+16/-28)
vendor/github.com/prometheus/prometheus/tsdb/chunks/head_chunks.go (+90/-48)
vendor/github.com/prometheus/prometheus/tsdb/compact.go (+25/-22)
vendor/github.com/prometheus/prometheus/tsdb/db.go (+139/-108)
vendor/github.com/prometheus/prometheus/tsdb/errors/errors.go (+52/-25)
vendor/github.com/prometheus/prometheus/tsdb/fileutil/mmap.go (+1/-1)
vendor/github.com/prometheus/prometheus/tsdb/fileutil/preallocate_darwin.go (+10/-10)
vendor/github.com/prometheus/prometheus/tsdb/head.go (+96/-101)
vendor/github.com/prometheus/prometheus/tsdb/index/index.go (+41/-19)
vendor/github.com/prometheus/prometheus/tsdb/index/postings.go (+30/-0)
vendor/github.com/prometheus/prometheus/tsdb/querier.go (+59/-36)
vendor/github.com/prometheus/prometheus/tsdb/record/record.go (+6/-5)
vendor/github.com/prometheus/prometheus/tsdb/repair.go (+9/-8)
vendor/github.com/prometheus/prometheus/tsdb/tombstones/tombstones.go (+65/-41)
vendor/github.com/prometheus/prometheus/tsdb/tsdbblockutil.go (+33/-43)
vendor/github.com/prometheus/prometheus/tsdb/wal.go (+1/-0)
vendor/github.com/prometheus/prometheus/tsdb/wal/checkpoint.go (+19/-5)
vendor/github.com/prometheus/prometheus/tsdb/wal/wal.go (+43/-28)
vendor/github.com/prometheus/prometheus/tsdb/wal/watcher.go (+2/-6)
vendor/github.com/prometheus/prometheus/util/testutil/directory.go (+10/-8)
vendor/github.com/prometheus/prometheus/util/testutil/testing.go (+0/-129)
vendor/github.com/prometheus/prometheus/web/api/v1/api.go (+50/-13)
vendor/github.com/shurcooL/vfsgen/generator.go (+1/-1)
vendor/github.com/thanos-io/thanos/pkg/block/block.go (+134/-12)
vendor/github.com/thanos-io/thanos/pkg/block/fetcher.go (+83/-28)
vendor/github.com/thanos-io/thanos/pkg/block/index.go (+141/-16)
vendor/github.com/thanos-io/thanos/pkg/block/indexheader/binary_reader.go (+41/-11)
vendor/github.com/thanos-io/thanos/pkg/block/indexheader/header.go (+2/-2)
vendor/github.com/thanos-io/thanos/pkg/block/indexheader/lazy_binary_reader.go (+273/-0)
vendor/github.com/thanos-io/thanos/pkg/block/indexheader/reader_pool.go (+147/-0)
vendor/github.com/thanos-io/thanos/pkg/block/metadata/markers.go (+119/-0)
vendor/github.com/thanos-io/thanos/pkg/block/metadata/meta.go (+103/-20)
vendor/github.com/thanos-io/thanos/pkg/block/writer.go (+184/-0)
vendor/github.com/thanos-io/thanos/pkg/cacheutil/memcached_client.go (+56/-39)
vendor/github.com/thanos-io/thanos/pkg/compact/compact.go (+147/-108)
vendor/github.com/thanos-io/thanos/pkg/compact/downsample/downsample.go (+4/-3)
vendor/github.com/thanos-io/thanos/pkg/compact/downsample/streamed_block_writer.go (+6/-5)
vendor/github.com/thanos-io/thanos/pkg/compact/planner.go (+303/-0)
vendor/github.com/thanos-io/thanos/pkg/compact/retention.go (+2/-1)
vendor/github.com/thanos-io/thanos/pkg/component/component.go (+4/-0)
vendor/github.com/thanos-io/thanos/pkg/discovery/dns/godns/resolver.go (+25/-0)
vendor/github.com/thanos-io/thanos/pkg/discovery/dns/miekgdns/lookup.go (+3/-1)
vendor/github.com/thanos-io/thanos/pkg/discovery/dns/miekgdns/resolver.go (+4/-0)
vendor/github.com/thanos-io/thanos/pkg/discovery/dns/provider.go (+7/-6)
vendor/github.com/thanos-io/thanos/pkg/discovery/dns/resolver.go (+32/-5)
vendor/github.com/thanos-io/thanos/pkg/errutil/multierror.go.go (+51/-0)
vendor/github.com/thanos-io/thanos/pkg/extprom/testing.go (+16/-5)
vendor/github.com/thanos-io/thanos/pkg/gate/gate.go (+110/-33)
vendor/github.com/thanos-io/thanos/pkg/http/http.go (+1/-1)
vendor/github.com/thanos-io/thanos/pkg/objstore/azure/helpers.go (+20/-0)
vendor/github.com/thanos-io/thanos/pkg/objstore/filesystem/filesystem.go (+2/-2)
vendor/github.com/thanos-io/thanos/pkg/objstore/objstore.go (+13/-9)
vendor/github.com/thanos-io/thanos/pkg/objstore/s3/s3.go (+158/-59)
vendor/github.com/thanos-io/thanos/pkg/objstore/swift/swift.go (+254/-212)
vendor/github.com/thanos-io/thanos/pkg/promclient/promclient.go (+41/-17)
vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/custom.go (+36/-25)
vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.pb.go (+87/-294)
vendor/github.com/thanos-io/thanos/pkg/rules/rulespb/rpc.proto (+10/-14)
vendor/github.com/thanos-io/thanos/pkg/runutil/runutil.go (+4/-3)
vendor/github.com/thanos-io/thanos/pkg/shipper/shipper.go (+4/-2)
vendor/github.com/thanos-io/thanos/pkg/store/bucket.go (+358/-145)
vendor/github.com/thanos-io/thanos/pkg/store/hintspb/custom.go (+12/-0)
vendor/github.com/thanos-io/thanos/pkg/store/hintspb/hints.pb.go (+794/-75)
vendor/github.com/thanos-io/thanos/pkg/store/hintspb/hints.proto (+25/-0)
vendor/github.com/thanos-io/thanos/pkg/store/labelpb/label.go (+330/-0)
vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.pb.go (+714/-0)
vendor/github.com/thanos-io/thanos/pkg/store/labelpb/types.proto (+33/-0)
vendor/github.com/thanos-io/thanos/pkg/store/limiter.go (+17/-0)
vendor/github.com/thanos-io/thanos/pkg/store/local.go (+7/-11)
vendor/github.com/thanos-io/thanos/pkg/store/multitsdb.go (+36/-7)
vendor/github.com/thanos-io/thanos/pkg/store/prometheus.go (+72/-112)
vendor/github.com/thanos-io/thanos/pkg/store/proxy.go (+120/-141)
vendor/github.com/thanos-io/thanos/pkg/store/storepb/custom.go (+93/-129)
vendor/github.com/thanos-io/thanos/pkg/store/storepb/inprocess.go (+97/-0)
vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.pb.go (+59/-475)
vendor/github.com/thanos-io/thanos/pkg/store/storepb/prompb/types.proto (+6/-12)
vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go (+309/-257)
vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.proto (+24/-7)
vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.pb.go (+48/-254)
vendor/github.com/thanos-io/thanos/pkg/store/storepb/types.proto (+3/-7)
vendor/github.com/thanos-io/thanos/pkg/store/tsdb.go (+94/-113)
vendor/github.com/thanos-io/thanos/pkg/testutil/testutil.go (+52/-1)
vendor/github.com/weaveworks/common/httpgrpc/README.md (+1/-1)
vendor/github.com/weaveworks/common/httpgrpc/server/server.go (+11/-1)
vendor/github.com/weaveworks/common/middleware/http_tracing.go (+15/-0)
vendor/github.com/weaveworks/common/middleware/instrument.go (+12/-1)
vendor/github.com/weaveworks/common/server/server.go (+21/-9)
vendor/github.com/weaveworks/common/tracing/tracing.go (+2/-2)
vendor/go.opencensus.io/Makefile (+14/-13)
vendor/go.opencensus.io/plugin/ocgrpc/client.go (+1/-1)
vendor/go.opencensus.io/plugin/ocgrpc/server.go (+2/-1)
vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go (+4/-4)
vendor/go.opencensus.io/plugin/ochttp/propagation/b3/b3.go (+2/-2)
vendor/go.opencensus.io/stats/record.go (+20/-0)
vendor/go.opencensus.io/stats/view/export.go (+2/-15)
vendor/go.opencensus.io/stats/view/view_to_metric.go (+4/-1)
vendor/go.opencensus.io/stats/view/worker.go (+160/-28)
vendor/go.opencensus.io/stats/view/worker_commands.go (+3/-3)
vendor/go.opencensus.io/trace/lrumap.go (+1/-1)
vendor/go.opencensus.io/trace/trace.go (+6/-6)
vendor/go.uber.org/atomic/.codecov.yml (+4/-0)
vendor/go.uber.org/atomic/.travis.yml (+2/-2)
vendor/go.uber.org/atomic/CHANGELOG.md (+12/-0)
vendor/go.uber.org/atomic/Makefile (+47/-4)
vendor/go.uber.org/atomic/bool.go (+81/-0)
vendor/go.uber.org/atomic/bool_ext.go (+53/-0)
vendor/go.uber.org/atomic/doc.go (+23/-0)
vendor/go.uber.org/atomic/duration.go (+82/-0)
vendor/go.uber.org/atomic/duration_ext.go (+40/-0)
vendor/go.uber.org/atomic/error.go (+22/-26)
vendor/go.uber.org/atomic/error_ext.go (+39/-0)
vendor/go.uber.org/atomic/float64.go (+76/-0)
vendor/go.uber.org/atomic/float64_ext.go (+47/-0)
vendor/go.uber.org/atomic/gen.go (+26/-0)
vendor/go.uber.org/atomic/go.mod (+0/-2)
vendor/go.uber.org/atomic/go.sum (+0/-13)
vendor/go.uber.org/atomic/int32.go (+102/-0)
vendor/go.uber.org/atomic/int64.go (+102/-0)
vendor/go.uber.org/atomic/nocmp.go (+35/-0)
vendor/go.uber.org/atomic/string.go (+23/-18)
vendor/go.uber.org/atomic/string_ext.go (+43/-0)
vendor/go.uber.org/atomic/uint32.go (+102/-0)
vendor/go.uber.org/atomic/uint64.go (+102/-0)
vendor/go.uber.org/atomic/value.go (+31/-0)
vendor/go.uber.org/goleak/.travis.yml (+1/-0)
vendor/go.uber.org/goleak/CHANGELOG.md (+7/-0)
vendor/go.uber.org/goleak/README.md (+6/-5)
vendor/go.uber.org/goleak/options.go (+12/-0)
vendor/golang.org/x/net/http/httpproxy/proxy.go (+2/-4)
vendor/golang.org/x/net/http2/server.go (+8/-4)
vendor/golang.org/x/net/http2/transport.go (+31/-5)
vendor/golang.org/x/net/idna/tables12.0.0.go (+1/-1)
vendor/golang.org/x/net/idna/tables13.0.0.go (+4839/-0)
vendor/golang.org/x/net/internal/socket/cmsghdr.go (+1/-1)
vendor/golang.org/x/net/internal/socket/cmsghdr_stub.go (+13/-3)
vendor/golang.org/x/net/internal/socket/cmsghdr_unix.go (+21/-0)
vendor/golang.org/x/net/internal/socket/cmsghdr_zos_s390x.go (+25/-0)
vendor/golang.org/x/net/internal/socket/error_unix.go (+1/-1)
vendor/golang.org/x/net/internal/socket/iovec_64bit.go (+1/-1)
vendor/golang.org/x/net/internal/socket/iovec_stub.go (+1/-1)
vendor/golang.org/x/net/internal/socket/msghdr_stub.go (+1/-1)
vendor/golang.org/x/net/internal/socket/msghdr_zos_s390x.go (+36/-0)
vendor/golang.org/x/net/internal/socket/rawconn_msg.go (+4/-3)
vendor/golang.org/x/net/internal/socket/rawconn_nomsg.go (+1/-1)
vendor/golang.org/x/net/internal/socket/socket.go (+1/-9)
vendor/golang.org/x/net/internal/socket/sys.go (+2/-12)
vendor/golang.org/x/net/internal/socket/sys_const_zos.go (+17/-0)
vendor/golang.org/x/net/internal/socket/sys_linux.go (+0/-5)
vendor/golang.org/x/net/internal/socket/sys_linux_386.go (+0/-2)
vendor/golang.org/x/net/internal/socket/sys_linux_s390x.go (+0/-2)
vendor/golang.org/x/net/internal/socket/sys_posix.go (+1/-1)
vendor/golang.org/x/net/internal/socket/sys_solaris.go (+0/-11)
vendor/golang.org/x/net/internal/socket/sys_stub.go (+2/-16)
vendor/golang.org/x/net/internal/socket/sys_zos_s390x.go (+38/-0)
vendor/golang.org/x/net/internal/socket/sys_zos_s390x.s (+11/-0)
vendor/golang.org/x/net/internal/socket/zsys_aix_ppc64.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_darwin_386.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_darwin_amd64.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_darwin_arm.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_darwin_arm64.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_dragonfly_amd64.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_freebsd_386.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_freebsd_amd64.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_freebsd_arm64.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_linux_386.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_linux_amd64.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_linux_arm.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_linux_arm64.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_linux_mips.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_linux_mips64.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_linux_mips64le.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_linux_mipsle.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_linux_ppc64le.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_linux_riscv64.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_linux_s390x.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_netbsd_386.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_netbsd_amd64.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go (+0/-2)
vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm64.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_openbsd_386.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_openbsd_amd64.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_openbsd_arm64.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_solaris_amd64.go (+2/-3)
vendor/golang.org/x/net/internal/socket/zsys_zos_s390x.go (+32/-0)
vendor/golang.org/x/net/ipv4/control_stub.go (+1/-1)
vendor/golang.org/x/net/ipv4/control_zos.go (+86/-0)
vendor/golang.org/x/net/ipv4/header.go (+2/-2)
vendor/golang.org/x/net/ipv4/payload_cmsg.go (+1/-1)
vendor/golang.org/x/net/ipv4/payload_nocmsg.go (+1/-1)
vendor/golang.org/x/net/ipv4/sockopt_posix.go (+1/-1)
vendor/golang.org/x/net/ipv4/sockopt_stub.go (+1/-1)
vendor/golang.org/x/net/ipv4/sys_stub.go (+1/-1)
vendor/golang.org/x/net/ipv4/sys_zos.go (+55/-0)
vendor/golang.org/x/net/ipv4/zsys_zos_s390x.go (+80/-0)
vendor/golang.org/x/net/ipv6/control_rfc3542_unix.go (+1/-1)
vendor/golang.org/x/net/ipv6/control_stub.go (+1/-1)
vendor/golang.org/x/net/ipv6/control_unix.go (+1/-1)
vendor/golang.org/x/net/ipv6/icmp_stub.go (+1/-1)
vendor/golang.org/x/net/ipv6/icmp_zos.go (+29/-0)
vendor/golang.org/x/net/ipv6/payload_cmsg.go (+1/-1)
vendor/golang.org/x/net/ipv6/payload_nocmsg.go (+1/-1)
vendor/golang.org/x/net/ipv6/sockopt_posix.go (+1/-1)
vendor/golang.org/x/net/ipv6/sockopt_stub.go (+1/-1)
vendor/golang.org/x/net/ipv6/sys_ssmreq.go (+1/-1)
vendor/golang.org/x/net/ipv6/sys_ssmreq_stub.go (+1/-1)
vendor/golang.org/x/net/ipv6/sys_stub.go (+1/-1)
vendor/golang.org/x/net/ipv6/sys_zos.go (+70/-0)
vendor/golang.org/x/net/ipv6/zsys_zos_s390x.go (+106/-0)
vendor/golang.org/x/net/publicsuffix/table.go (+9903/-9834)
vendor/golang.org/x/oauth2/go.mod (+3/-4)
vendor/golang.org/x/oauth2/go.sum (+354/-5)
vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s (+1/-1)
vendor/golang.org/x/sys/cpu/cpu.go (+136/-20)
vendor/golang.org/x/sys/cpu/cpu_aix.go (+1/-3)
vendor/golang.org/x/sys/cpu/cpu_arm.go (+33/-0)
vendor/golang.org/x/sys/cpu/cpu_arm64.go (+49/-21)
vendor/golang.org/x/sys/cpu/cpu_arm64.s (+1/-1)
vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go (+1/-1)
vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go (+1/-1)
vendor/golang.org/x/sys/cpu/cpu_gc_x86.go (+1/-1)
vendor/golang.org/x/sys/cpu/cpu_linux.go (+1/-1)
vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go (+1/-0)
vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go (+0/-2)
vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go (+1/-122)
vendor/golang.org/x/sys/cpu/cpu_mips64x.go (+6/-0)
vendor/golang.org/x/sys/cpu/cpu_mipsx.go (+2/-0)
vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go (+173/-0)
vendor/golang.org/x/sys/cpu/cpu_other_arm.go (+9/-0)
vendor/golang.org/x/sys/cpu/cpu_other_arm64.go (+2/-1)
vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go (+12/-0)
vendor/golang.org/x/sys/cpu/cpu_ppc64x.go (+16/-0)
vendor/golang.org/x/sys/cpu/cpu_riscv64.go (+2/-0)
vendor/golang.org/x/sys/cpu/cpu_s390x.go (+172/-0)
vendor/golang.org/x/sys/cpu/cpu_s390x.s (+1/-1)
vendor/golang.org/x/sys/cpu/cpu_wasm.go (+4/-0)
vendor/golang.org/x/sys/cpu/cpu_x86.go (+79/-3)
vendor/golang.org/x/sys/cpu/cpu_x86.s (+1/-1)
vendor/golang.org/x/sys/cpu/cpu_zos.go (+10/-0)
vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go (+25/-0)
vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go (+1/-1)
vendor/golang.org/x/sys/unix/asm_aix_ppc64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_darwin_386.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_darwin_amd64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_darwin_arm.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_darwin_arm64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_freebsd_386.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_freebsd_arm.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_linux_386.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_linux_amd64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_linux_arm.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_linux_arm64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_linux_mips64x.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_linux_mipsx.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_linux_riscv64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_linux_s390x.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_netbsd_386.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_netbsd_arm.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_openbsd_386.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_openbsd_arm.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s (+1/-1)
vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s (+29/-0)
vendor/golang.org/x/sys/unix/asm_solaris_amd64.s (+1/-1)
vendor/golang.org/x/sys/unix/endian_big.go (+1/-1)
vendor/golang.org/x/sys/unix/endian_little.go (+1/-1)
vendor/golang.org/x/sys/unix/fcntl_darwin.go (+6/-0)
vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go (+2/-2)
vendor/golang.org/x/sys/unix/gccgo.go (+0/-2)
vendor/golang.org/x/sys/unix/gccgo_c.c (+6/-0)
vendor/golang.org/x/sys/unix/ioctl.go (+9/-0)
vendor/golang.org/x/sys/unix/mkall.sh (+9/-6)
vendor/golang.org/x/sys/unix/mkerrors.sh (+17/-2)
vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go (+5/-1)
vendor/golang.org/x/sys/unix/syscall.go (+42/-1)
vendor/golang.org/x/sys/unix/syscall_aix.go (+16/-0)
vendor/golang.org/x/sys/unix/syscall_bsd.go (+17/-2)
vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go (+3/-1)
vendor/golang.org/x/sys/unix/syscall_darwin.go (+69/-72)
vendor/golang.org/x/sys/unix/syscall_darwin_386.go (+2/-9)
vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go (+2/-9)
vendor/golang.org/x/sys/unix/syscall_darwin_arm.go (+1/-7)
vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go (+2/-11)
vendor/golang.org/x/sys/unix/syscall_dragonfly.go (+17/-15)
vendor/golang.org/x/sys/unix/syscall_freebsd.go (+4/-15)
vendor/golang.org/x/sys/unix/syscall_illumos.go (+37/-4)
vendor/golang.org/x/sys/unix/syscall_linux.go (+117/-13)
vendor/golang.org/x/sys/unix/syscall_linux_386.go (+0/-3)
vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go (+1/-1)
vendor/golang.org/x/sys/unix/syscall_linux_arm.go (+0/-5)
vendor/golang.org/x/sys/unix/syscall_linux_gc.go (+1/-1)
vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go (+1/-1)
vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go (+13/-0)
vendor/golang.org/x/sys/unix/syscall_netbsd.go (+4/-15)
vendor/golang.org/x/sys/unix/syscall_openbsd.go (+4/-15)
vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go (+35/-0)
vendor/golang.org/x/sys/unix/syscall_solaris.go (+5/-2)
vendor/golang.org/x/sys/unix/syscall_unix_gc.go (+1/-1)
vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go (+1/-1)
vendor/golang.org/x/sys/unix/zerrors_darwin_386.go (+4/-0)
vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go (+4/-0)
vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go (+4/-0)
vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go (+4/-0)
vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go (+112/-26)
vendor/golang.org/x/sys/unix/zerrors_linux.go (+238/-4)
vendor/golang.org/x/sys/unix/zerrors_linux_386.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_arm.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go (+3/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_mips.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go (+2/-0)
vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go (+1862/-0)
vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go (+21/-1)
vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go (+1/-1)
vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go (+107/-30)
vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s (+12/-6)
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go (+107/-30)
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s (+12/-6)
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go (+92/-15)
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s (+10/-4)
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go (+107/-15)
vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s (+12/-4)
vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go (+26/-16)
vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go (+28/-1)
vendor/golang.org/x/sys/unix/zsyscall_linux.go (+31/-0)
vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go (+1692/-0)
vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go (+279/-0)
vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go (+1/-0)
vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go (+1/-0)
vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go (+1/-0)
vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go (+1/-0)
vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go (+128/-127)
vendor/golang.org/x/sys/unix/zsysnum_linux_386.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go (+2/-0)
vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go (+220/-0)
vendor/golang.org/x/sys/unix/ztypes_darwin_386.go (+24/-8)
vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go (+27/-16)
vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go (+27/-12)
vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go (+27/-16)
vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go (+18/-28)
vendor/golang.org/x/sys/unix/ztypes_linux.go (+851/-269)
vendor/golang.org/x/sys/unix/ztypes_linux_386.go (+20/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_arm.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_mips.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go (+23/-0)
vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go (+565/-0)
vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go (+11/-20)
vendor/golang.org/x/sys/windows/dll_windows.go (+2/-0)
vendor/golang.org/x/sys/windows/memory_windows.go (+13/-7)
vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go (+18/-21)
vendor/golang.org/x/sys/windows/security_windows.go (+2/-1)
vendor/golang.org/x/sys/windows/service.go (+2/-0)
vendor/golang.org/x/sys/windows/setupapierrors_windows.go (+100/-0)
vendor/golang.org/x/sys/windows/syscall.go (+42/-4)
vendor/golang.org/x/sys/windows/syscall_windows.go (+17/-18)
vendor/golang.org/x/sys/windows/types_windows.go (+29/-12)
vendor/golang.org/x/sys/windows/types_windows_386.go (+13/-0)
vendor/golang.org/x/sys/windows/types_windows_amd64.go (+12/-0)
vendor/golang.org/x/sys/windows/types_windows_arm.go (+13/-0)
vendor/golang.org/x/sys/windows/zsyscall_windows.go (+1711/-2672)
vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go (+1/-1)
vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go (+1955/-0)
vendor/golang.org/x/text/unicode/norm/tables12.0.0.go (+1/-1)
vendor/golang.org/x/text/unicode/norm/tables13.0.0.go (+7760/-0)
vendor/golang.org/x/text/width/tables12.0.0.go (+1/-1)
vendor/golang.org/x/text/width/tables13.0.0.go (+1351/-0)
vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go (+1/-1)
vendor/golang.org/x/tools/internal/gocommand/invoke.go (+51/-8)
vendor/golang.org/x/tools/internal/gocommand/version.go (+40/-0)
vendor/golang.org/x/tools/internal/gopathwalk/walk.go (+0/-11)
vendor/golang.org/x/tools/internal/imports/fix.go (+136/-53)
vendor/golang.org/x/tools/internal/imports/mod.go (+33/-12)
vendor/golang.org/x/tools/internal/imports/zstdlib.go (+52/-0)
vendor/google.golang.org/api/cloudresourcemanager/v1/cloudresourcemanager-api.json (+223/-154)
vendor/google.golang.org/api/cloudresourcemanager/v1/cloudresourcemanager-gen.go (+858/-1499)
vendor/google.golang.org/api/internal/creds.go (+26/-0)
vendor/google.golang.org/api/internal/gensupport/media.go (+2/-2)
vendor/google.golang.org/api/internal/impersonate/impersonate.go (+128/-0)
vendor/google.golang.org/api/internal/settings.go (+10/-1)
vendor/google.golang.org/api/option/internaloption/internaloption.go (+29/-2)
vendor/google.golang.org/api/option/option.go (+55/-0)
vendor/google.golang.org/api/storage/v1/storage-api.json (+8/-12)
vendor/google.golang.org/api/storage/v1/storage-gen.go (+67/-67)
vendor/google.golang.org/api/transport/grpc/dial.go (+21/-48)
vendor/google.golang.org/api/transport/grpc/pool.go (+1/-1)
vendor/google.golang.org/api/transport/http/dial.go (+2/-98)
vendor/google.golang.org/api/transport/internal/dca/dca.go (+145/-0)
vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go (+7/-7)
vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go (+10/-10)
vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go (+7/-7)
vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go (+2/-2)
vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go (+15/-15)
vendor/google.golang.org/genproto/googleapis/api/httpbody/httpbody.pb.go (+7/-7)
vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/bigtable_instance_admin.pb.go (+43/-43)
vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/bigtable_table_admin.pb.go (+46/-46)
vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/common.pb.go (+10/-10)
vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/instance.pb.go (+2/-2)
vendor/google.golang.org/genproto/googleapis/bigtable/admin/v2/table.pb.go (+22/-22)
vendor/google.golang.org/genproto/googleapis/bigtable/v2/bigtable.pb.go (+9/-9)
vendor/google.golang.org/genproto/googleapis/bigtable/v2/data.pb.go (+2/-2)
vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go (+2/-2)
vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go (+2/-2)
vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go (+2/-2)
vendor/google.golang.org/genproto/googleapis/longrunning/operations.pb.go (+37/-37)
vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go (+2/-2)
vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go (+7/-7)
vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go (+2/-2)
vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/main.go (+34/-25)
vendor/google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo/well_known_types.go (+1077/-0)
vendor/google.golang.org/protobuf/compiler/protogen/protogen.go (+12/-12)
vendor/google.golang.org/protobuf/encoding/protojson/decode.go (+5/-4)
vendor/google.golang.org/protobuf/encoding/protojson/encode.go (+4/-3)
vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go (+129/-147)
vendor/google.golang.org/protobuf/encoding/prototext/decode.go (+30/-35)
vendor/google.golang.org/protobuf/encoding/prototext/encode.go (+6/-6)
vendor/google.golang.org/protobuf/internal/filedesc/build.go (+8/-8)
vendor/google.golang.org/protobuf/internal/filedesc/desc.go (+3/-2)
vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go (+31/-31)
vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go (+62/-62)
vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go (+1/-5)
vendor/google.golang.org/protobuf/internal/genid/any_gen.go (+34/-0)
vendor/google.golang.org/protobuf/internal/genid/api_gen.go (+106/-0)
vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go (+829/-0)
vendor/google.golang.org/protobuf/internal/genid/doc.go (+11/-0)
vendor/google.golang.org/protobuf/internal/genid/duration_gen.go (+34/-0)
vendor/google.golang.org/protobuf/internal/genid/empty_gen.go (+19/-0)
vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.go (+31/-0)
vendor/google.golang.org/protobuf/internal/genid/goname.go (+25/-0)
vendor/google.golang.org/protobuf/internal/genid/map_entry.go (+16/-0)
vendor/google.golang.org/protobuf/internal/genid/source_context_gen.go (+31/-0)
vendor/google.golang.org/protobuf/internal/genid/struct_gen.go (+116/-0)
vendor/google.golang.org/protobuf/internal/genid/timestamp_gen.go (+34/-0)
vendor/google.golang.org/protobuf/internal/genid/type_gen.go (+184/-0)
vendor/google.golang.org/protobuf/internal/genid/wrappers.go (+13/-0)
vendor/google.golang.org/protobuf/internal/genid/wrappers_gen.go (+175/-0)
vendor/google.golang.org/protobuf/internal/impl/api_export.go (+7/-0)
vendor/google.golang.org/protobuf/internal/impl/codec_map.go (+3/-2)
vendor/google.golang.org/protobuf/internal/impl/message.go (+5/-5)
vendor/google.golang.org/protobuf/internal/impl/validate.go (+3/-2)
vendor/google.golang.org/protobuf/internal/version/version.go (+1/-1)
vendor/google.golang.org/protobuf/proto/decode.go (+3/-2)
vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go (+3/-2)
vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go (+38/-12)
vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go (+207/-0)
vendor/google.golang.org/protobuf/types/known/durationpb/duration.pb.go (+130/-0)
vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go (+217/-0)
vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go (+110/-0)
vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go (+45/-0)
vendor/modules.txt (+71/-368)
website/assets/scss/_styles_project.scss (+35/-0)
website/assets/scss/_variables_project.scss (+0/-12)
website/content/en/_index.html (+1/-1)
website/data/adopters.yml (+19/-4)
website/layouts/partials/navbar.html (+1/-1)
website/layouts/shortcodes/adopters.html (+3/-4)
website/static/logos/buoyant.svg (+1/-0)
website/static/logos/etsy.svg (+1/-0)
Conflict in oci/Dockerfile.ubuntu
Conflict in oci/README.md
Conflict in oci/data/cortex.yaml
Reviewer Review Type Date Requested Status
Bryce Harrington Approve
Lucas Kanashiro Approve
Review via email: mp+398934@code.launchpad.net

Description of the change

This is the update of the cortex OCI image for hirsute.

Because we keep the whole upstream source in the same git repo, this MP will likely be very polluted with a bunch of upstream changes.

Feel free to focus only on changes inside the oci/ directory.

To post a comment you must log in.
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

LGTM, +1.

I tested the build, checked the manifest file, ran unit tests, and spotted nothing to be fixed.

review: Approve
Revision history for this message
Bryce Harrington (bryce) wrote :

Looks good to me too. I only reviewed the Dockerfile, data/, and README.md changes.

(I see this corrects the mixing of && and ; too, so I guess the thing I worried about wasn't quite so theoretical. These changes look like the proper fixes for that.)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.circleci/config.yml b/.circleci/config.yml
2deleted file mode 100644
3index ab6cc93..0000000
4--- a/.circleci/config.yml
5+++ /dev/null
6@@ -1,249 +0,0 @@
7-version: 2.1
8-
9-# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/
10-defaults: &defaults
11- docker:
12- # IMPORTANT: whenever you change the build-image version tag, remember to replace it
13- # across the entire file (there are multiple references).
14- - image: quay.io/cortexproject/build-image:update-golang-1.14.9-eb0c8d4d2
15- working_directory: /go/src/github.com/cortexproject/cortex
16-
17-filters: &filters
18- filters:
19- tags:
20- only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
21-
22-workflows:
23- version: 2
24- test-build-deploy:
25- # You must specify a tag filter for each job that deploy depends on.
26- jobs:
27- - lint:
28- <<: *filters
29- - test:
30- <<: *filters
31- - integration:
32- requires:
33- - build
34- <<: *filters
35- - integration-configs-db:
36- requires:
37- - build
38- <<: *filters
39- - build:
40- <<: *filters
41- - deploy_website:
42- requires:
43- - test
44- - build
45- filters:
46- branches:
47- only: master
48- - deploy:
49- requires:
50- - build
51- - test
52- - lint
53- - integration
54- - integration-configs-db
55- filters:
56- branches:
57- only: master
58- tags:
59- only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
60-
61-commands:
62- install-docker:
63- steps:
64- - run:
65- name: Install Docker client
66- command: |
67- set -x
68- VER="17.03.0-ce"
69- curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
70- tar -xz -C /tmp -f /tmp/docker-$VER.tgz
71- mv /tmp/docker/* /usr/bin
72-
73-jobs:
74- lint:
75- <<: *defaults
76- steps:
77- - checkout
78- - run:
79- name: Lint
80- command: make BUILD_IN_CONTAINER=false lint
81- - run:
82- name: Check vendor directory is consistent.
83- command: make BUILD_IN_CONTAINER=false mod-check
84- - run:
85- name: Check protos are consistent.
86- command: make BUILD_IN_CONTAINER=false check-protos
87- - run:
88- name: Check generated documentation is consistent.
89- command: make BUILD_IN_CONTAINER=false check-doc
90- - run:
91- name: Check white noise.
92- command: make BUILD_IN_CONTAINER=false check-white-noise
93-
94- test:
95- docker:
96- - image: quay.io/cortexproject/build-image:update-golang-1.14.9-eb0c8d4d2
97- - image: cassandra:3.11
98- environment:
99- JVM_OPTS: "-Xms1024M -Xmx1024M"
100- working_directory: /go/src/github.com/cortexproject/cortex
101- steps:
102- - checkout
103- - run:
104- name: Test
105- command: CASSANDRA_TEST_ADDRESSES=localhost:9042 make BUILD_IN_CONTAINER=false test
106-
107- integration-configs-db:
108- machine:
109- image: ubuntu-1604:201903-01
110-
111- working_directory: ~/src/github.com/cortexproject/cortex
112- steps:
113- - checkout
114- - restore_cache:
115- key: v1-cortex-{{ .Branch }}-{{ .Revision }}
116- - run:
117- name: Integration Test
118- command: |
119- touch build-image/.uptodate
120- MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations make BUILD_IMAGE=quay.io/cortexproject/build-image:update-golang-1.14.9-eb0c8d4d2 configs-integration-test
121-
122- integration:
123- machine:
124- image: ubuntu-1604:201903-01
125-
126- # Make sure the working directory is within the GOPATH, otherwise
127- # "go test" will not download module dependencies.
128- working_directory: ~/.go_workspace/src/github.com/cortexproject/cortex
129- steps:
130- - run:
131- name: Upgrade golang
132- command: |
133- cd /tmp && \
134- wget https://dl.google.com/go/go1.14.9.linux-amd64.tar.gz && \
135- tar -zxvf go1.14.9.linux-amd64.tar.gz && \
136- sudo rm -fr /usr/local/go && \
137- sudo mv /tmp/go /usr/local/go && \
138- cd -
139- - checkout
140- - restore_cache:
141- key: v1-cortex-{{ .Branch }}-{{ .Revision }}
142- - run:
143- name: Load Images
144- command: ln -s /tmp/images ./docker-images; make BUILD_IN_CONTAINER=false load-images
145- - run:
146- name: Preload Docker Images
147- # We download docker images used by integration tests so that all images are available
148- # locally and the download time doesn't account in the test execution time, which is subject
149- # to a timeout.
150- command: |
151- docker pull minio/minio:RELEASE.2019-12-30T05-45-39Z
152- docker pull amazon/dynamodb-local:1.11.477
153- docker pull consul:0.9
154- docker pull gcr.io/etcd-development/etcd:v3.4.7
155- docker pull quay.io/cortexproject/cortex:v0.6.0
156- docker pull quay.io/cortexproject/cortex:v0.7.0
157- docker pull quay.io/cortexproject/cortex:v1.0.0
158- docker pull quay.io/cortexproject/cortex:v1.1.0
159- docker pull shopify/bigtable-emulator:0.1.0
160- docker pull rinscy/cassandra:3.11.0
161- docker pull memcached:1.6.1
162- docker pull bouncestorage/swift-aio:55ba4331
163- - run:
164- name: Integration Tests
165- command: |
166- export CORTEX_IMAGE_PREFIX="${IMAGE_PREFIX:-quay.io/cortexproject/}"
167- export CORTEX_IMAGE="${CORTEX_IMAGE_PREFIX}cortex:${CIRCLE_TAG:-$(./tools/image-tag)}"
168- export CORTEX_CHECKOUT_DIR="/home/circleci/.go_workspace/src/github.com/cortexproject/cortex"
169- echo "Running integration tests with image: $CORTEX_IMAGE"
170- go test -tags=requires_docker -timeout 1200s -v -count=1 ./integration/...
171- no_output_timeout: 20m
172-
173- build:
174- <<: *defaults
175- steps:
176- - checkout
177- - setup_remote_docker
178- - install-docker
179-
180- - run:
181- name: Build
182- command: |
183- touch build-image/.uptodate
184- make BUILD_IN_CONTAINER=false
185- - run:
186- name: Build Website
187- command: |
188- touch build-image/.uptodate
189- make BUILD_IN_CONTAINER=false web-build
190-
191- - persist_to_workspace:
192- root: .
193- paths:
194- - website/public/
195-
196- - store_artifacts:
197- path: pkg/querier/frontend/frontend.pb.go
198- - store_artifacts:
199- path: pkg/chunk/storage/caching_index_client.pb.go
200- - store_artifacts:
201- path: pkg/ring/ring.pb.go
202- - store_artifacts:
203- path: pkg/ingester/client/cortex.pb.go
204- - store_artifacts:
205- path: pkg/ruler/rules/rules.pb.go
206-
207- - run:
208- name: Save Images
209- command: |
210- mkdir /tmp/images
211- ln -s /tmp/images ./docker-images
212- make BUILD_IN_CONTAINER=false save-images
213-
214- - save_cache:
215- key: v1-cortex-{{ .Branch }}-{{ .Revision }}
216- paths:
217- - /tmp/images/
218-
219- deploy_website:
220- <<: *defaults
221- steps:
222- - add_ssh_keys:
223- fingerprints:
224- - "72:f2:e3:39:18:1f:95:17:90:b3:37:5e:49:ed:7e:a3"
225- - checkout
226- - attach_workspace:
227- at: .
228- - run:
229- name: deploy-website
230- command: make BUILD_IN_CONTAINER=false web-deploy
231-
232- deploy:
233- <<: *defaults
234- steps:
235- - checkout
236- - setup_remote_docker
237- - install-docker
238-
239- - restore_cache:
240- key: v1-cortex-{{ .Branch }}-{{ .Revision }}
241-
242- - run:
243- name: Load Images
244- command: ln -s /tmp/images ./docker-images; make BUILD_IN_CONTAINER=false load-images
245-
246- - run:
247- name: Deploy
248- command: |
249- if [ -n "$DOCKER_REGISTRY_PASSWORD" ]; then
250- docker login -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD"
251- fi
252- if [ -n "$QUAY_PASSWORD" ]; then
253- docker login -u "$QUAY_USER" -p "$QUAY_PASSWORD" quay.io;
254- fi
255- IMAGE_TAG=$CIRCLE_TAG ./push-images $NOQUAY
256diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
257new file mode 100644
258index 0000000..0e1b477
259--- /dev/null
260+++ b/.github/ISSUE_TEMPLATE/bug_report.md
261@@ -0,0 +1,30 @@
262+---
263+name: Bug report
264+about: Create a report to help us improve
265+title: ''
266+labels: ''
267+assignees: ''
268+
269+---
270+
271+**Describe the bug**
272+A clear and concise description of what the bug is.
273+
274+**To Reproduce**
275+Steps to reproduce the behavior:
276+1. Start Cortex (SHA or version)
277+2. Perform Operations(Read/Write/Others)
278+
279+**Expected behavior**
280+A clear and concise description of what you expected to happen.
281+
282+**Environment:**
283+ - Infrastructure: [e.g., Kubernetes, bare-metal, laptop]
284+ - Deployment tool: [e.g., helm, jsonnet]
285+
286+**Storage Engine**
287+- [ ] Blocks
288+- [ ] Chunks
289+
290+**Additional Context**
291+<!-- Additional relevant info which can help us debug this issue easily like Logs, Configuration etc. -->
292diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
293new file mode 100644
294index 0000000..bbcbbe7
295--- /dev/null
296+++ b/.github/ISSUE_TEMPLATE/feature_request.md
297@@ -0,0 +1,20 @@
298+---
299+name: Feature request
300+about: Suggest an idea for this project
301+title: ''
302+labels: ''
303+assignees: ''
304+
305+---
306+
307+**Is your feature request related to a problem? Please describe.**
308+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
309+
310+**Describe the solution you'd like**
311+A clear and concise description of what you want to happen.
312+
313+**Describe alternatives you've considered**
314+A clear and concise description of any alternative solutions or features you've considered.
315+
316+**Additional context**
317+Add any other context or screenshots about the feature request here.
318diff --git a/.github/stale.yml b/.github/stale.yml
319index fc5f2b2..a6c9689 100644
320--- a/.github/stale.yml
321+++ b/.github/stale.yml
322@@ -1,5 +1,5 @@
323 # Days without any activity until an issue is labeled as stale
324-daysUntilStale: 60
325+daysUntilStale: 90
326
327 # Days after having the stale label that the issue will be closed
328 daysUntilClose: 15
329diff --git a/.github/workflows-doc.md b/.github/workflows-doc.md
330new file mode 100644
331index 0000000..d38fa97
332--- /dev/null
333+++ b/.github/workflows-doc.md
334@@ -0,0 +1,82 @@
335+# GitHub Actions CI/CD
336+
337+The purpose of this workflow is to run all continuous integration (CI) and continuous deployment (CD) jobs when needed while respecting their internal dependencies. The continuous integration jobs serve to ensure new code passes linting, unit tests and integration tests before reaching the master branch. The continuous deployment jobs serve to deploy the latest version of the code to cortex and the website when merged with master.
338+
339+## Contributing
340+
341+If you wish to add a new CI or CD job, add it to the existing current test-build-deploy workflow and make sure it does not prevent any of the other jobs from passing. If you wish to change any of the build or testing images, update it in all sections are containers are often reused. If you wish to add an entirely new workflow, create a new yml file with separate triggers and filters. In all cases, clearly document any changes made to the workflows, images and dependencies below.
342+
343+## Test, Build and Deploy
344+
345+test-build-deploy.yml specifies a workflow that runs all Cortex continuous integration and continuous deployment jobs. The workflow is triggered on every pull request and commit to master, however the CD jobs only run when changes are merged onto master . The workflow combines both CI and CD jobs, because the CD jobs are dependent on artifacts produced the CI jobs.
346+
347+
348+## Specific Jobs
349+
350+| Job | Description | Type |
351+|------------------------|-------------------------------------------------------------------------------------------------------------------------------|------|
352+| lint | Runs linting and ensures vendor directory, protos and generated documentation are consistent. | CI |
353+| test | Runs units tests on Cassandra testing framework. | CI |
354+| integration-configs-db | Integration tests for database configurations. | CI |
355+| integration | Runs integration tests after upgrading golang, pulling necessary docker images and downloading necessary module dependencies. | CI |
356+| build | Builds and saves an up-to-date Cortex image and website. | CI |
357+| deploy_website | Deploys the latest version of Cortex website to gh-pages branch. Triggered within workflow. | CD |
358+| deploy | Deploys the latest Cortex image. | CD |
359+
360+## Job Dependency Graph
361+
362+Internal dependencies between jobs illustrated below. Jobs run concurrently where possible but do not start until all jobs they depend on have completed successfully.
363+
364+
365+![cortex_test-build-deploy](https://user-images.githubusercontent.com/20804975/95492784-9b7feb80-0969-11eb-9934-f44a4b1da498.png)
366+
367+### Key Details
368+
369+**Naming Convention**
370+
371+Each step in a job has a clear name that encapsulates the purpose of the command. The convention we are using is each word in the name should be capitalized except articles and prepositions. This creates consistent labeling when looking at the progress of the current workflow on GitHub.
372+
373+```yaml
374+- name: Checkout Repo
375+# commands
376+- name: Get Dependencies
377+# commands
378+```
379+
380+**Symbolic Link to Expected Workspace**
381+
382+A significant number of commands in the Makefile are hardcoded with an assumed file structure of the CI container. To ensure paths specified in previous commands don’t break, a symlink was created from the hardcoded “expected” working directory `/go/src/github.com/cortexproject/cortex` to the actual working directory `$GITHUB_WORKSPACE`.
383+
384+```yaml
385+- name: Sym link expected path to github workspace
386+ run: |
387+ mkdir -p /go/src/github.com/cortexproject/cortex
388+ ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
389+```
390+
391+**Sharing Artifacts Between Jobs**
392+
393+As of October 2020, GitHub Actions do not persist between different jobs in the same workflow. Each job is run on a fresh virtual environment (https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/introduction-to-github-actions#runners). As such, we need to upload and download artifacts to share data between jobs.
394+
395+| Artifact | Stored In | Used By | Purpose of Storing Artifact |
396+|-------------------------------|-----------|---------------------------------------------|-----------------------------|
397+| website public | build | deploy_website | share data between jobs |
398+| Docker Images | build | deploy, integration, integrations-config-db | share data between jobs |
399+
400+*Note:* Docker Images are zipped before uploading as a workaround. The images contain characters that are illegal in the upload-artifact action.
401+```yaml
402+- name: Compressing Images
403+ run: tar -zcvf images.tar.gz /tmp/images
404+ - name: Cache Images
405+ uses: actions/upload-artifact@v2
406+ with:
407+ name: Docker Images
408+ path: ./images.tar.gz
409+```
410+**Tags**
411+
412+As of Oct 2020, GitHub [does not support](https://github.community/t/using-regex-for-filtering/16427/2) regex for tag filtering. The regex /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/ was approximated using the available GitHub [filter patterns](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet)
413+```yaml
414+tags:
415+ - v[0-9]+.[0-9]+.[0-9]+**
416+```
417\ No newline at end of file
418diff --git a/.github/workflows/scripts/install-docker.sh b/.github/workflows/scripts/install-docker.sh
419new file mode 100755
420index 0000000..fa1bf70
421--- /dev/null
422+++ b/.github/workflows/scripts/install-docker.sh
423@@ -0,0 +1,7 @@
424+#!/bin/bash
425+
426+set -x
427+VER="18.06.3-ce"
428+curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
429+tar -xz -C /tmp -f /tmp/docker-$VER.tgz
430+mv /tmp/docker/* /usr/bin
431diff --git a/.github/workflows/test-build-deploy.yml b/.github/workflows/test-build-deploy.yml
432new file mode 100644
433index 0000000..b9e395a
434--- /dev/null
435+++ b/.github/workflows/test-build-deploy.yml
436@@ -0,0 +1,253 @@
437+name: ci
438+on:
439+ push:
440+ branches: [master]
441+ tags:
442+ - v[0-9]+.[0-9]+.[0-9]+** # Tag filters not as strict due to different regex system on Github Actions
443+ pull_request:
444+
445+jobs:
446+ lint:
447+ runs-on: ubuntu-latest
448+ container:
449+ image: quay.io/cortexproject/build-image:upgrade-build-image-debian-491e60715-WIP
450+ steps:
451+ - name: Checkout Repo
452+ uses: actions/checkout@v2
453+ # Commands in the Makefile are hardcoded with an assumed file structure of the CI container
454+ # Symlink ensures paths specified in previous commands don’t break
455+ - name: Sym Link Expected Path to Workspace
456+ run: |
457+ mkdir -p /go/src/github.com/cortexproject/cortex
458+ ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
459+ - name: Lint
460+ run: make BUILD_IN_CONTAINER=false lint
461+ - name: Check Vendor Directory
462+ run: make BUILD_IN_CONTAINER=false mod-check
463+ - name: Check Protos
464+ run: make BUILD_IN_CONTAINER=false check-protos
465+ - name: Check Generated Documentation
466+ run: make BUILD_IN_CONTAINER=false check-doc
467+ - name: Check White Noise.
468+ run: make BUILD_IN_CONTAINER=false check-white-noise
469+
470+ test:
471+ runs-on: ubuntu-latest
472+ container:
473+ image: quay.io/cortexproject/build-image:upgrade-build-image-debian-491e60715-WIP
474+ services:
475+ cassandra:
476+ image: cassandra:3.11
477+ env:
478+ JVM_OPTS: "-Xms1024M -Xmx1024M"
479+ ports:
480+ - 9042:9042
481+ steps:
482+ - name: Checkout Repo
483+ uses: actions/checkout@v2
484+ - name: Sym Link Expected Path to Workspace
485+ run: |
486+ mkdir -p /go/src/github.com/cortexproject/cortex
487+ ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
488+ - name: Run Tests
489+ run: CASSANDRA_TEST_ADDRESSES=cassandra:9042 make BUILD_IN_CONTAINER=false test
490+
491+ build:
492+ runs-on: ubuntu-latest
493+ container:
494+ image: quay.io/cortexproject/build-image:upgrade-build-image-debian-491e60715-WIP
495+ steps:
496+ - name: Checkout Repo
497+ uses: actions/checkout@v2
498+ - name: Install Docker Client
499+ run: ./.github/workflows/scripts/install-docker.sh
500+ - name: Sym Link Expected Path to Workspace
501+ run: |
502+ mkdir -p /go/src/github.com/cortexproject/cortex
503+ ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
504+ - name: Build Image
505+ run: |
506+ touch build-image/.uptodate
507+ make BUILD_IN_CONTAINER=false
508+ - name: Build Website
509+ run: |
510+ touch build-image/.uptodate
511+ make BUILD_IN_CONTAINER=false web-build
512+ - name: Upload Website Artifact
513+ uses: actions/upload-artifact@v2
514+ with:
515+ name: website public
516+ path: website/public/
517+ - name: Save Images
518+ run: |
519+ mkdir /tmp/images
520+ ln -s /tmp/images ./docker-images
521+ make BUILD_IN_CONTAINER=false save-images
522+ - name: Create Docker Images Archive
523+ run: tar -cvf images.tar /tmp/images
524+ - name: Upload Docker Images Artifact
525+ uses: actions/upload-artifact@v2
526+ with:
527+ name: Docker Images
528+ path: ./images.tar
529+
530+ integration:
531+ needs: build
532+ runs-on: ubuntu-16.04
533+ steps:
534+ - name: Upgrade golang
535+ run: |
536+ cd /tmp
537+ wget https://dl.google.com/go/go1.14.9.linux-amd64.tar.gz
538+ tar -zxvf go1.14.9.linux-amd64.tar.gz
539+ sudo rm -fr /usr/local/go
540+ sudo mv /tmp/go /usr/local/go
541+ cd -
542+ - name: Checkout Repo
543+ uses: actions/checkout@v2
544+ - name: Install Docker Client
545+ run: sudo ./.github/workflows/scripts/install-docker.sh
546+ - name: Sym Link Expected Path to Workspace
547+ run: |
548+ sudo mkdir -p /go/src/github.com/cortexproject/cortex
549+ sudo ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
550+ - name: Download Docker Images Artifacts
551+ uses: actions/download-artifact@v2
552+ with:
553+ name: Docker Images
554+ - name: Extract Docker Images Archive
555+ run: tar -xvf images.tar -C /
556+ - name: Load Docker Images
557+ run: |
558+ ln -s /tmp/images ./docker-images
559+ make BUILD_IN_CONTAINER=false load-images
560+ - name: Preload Images
561+ # We download docker images used by integration tests so that all images are available
562+ # locally and the download time doesn't account in the test execution time, which is subject
563+ # to a timeout
564+ run: |
565+ docker pull minio/minio:RELEASE.2019-12-30T05-45-39Z
566+ docker pull amazon/dynamodb-local:1.11.477
567+ docker pull consul:1.8.4
568+ docker pull gcr.io/etcd-development/etcd:v3.4.7
569+ docker pull quay.io/cortexproject/cortex:v1.0.0
570+ docker pull quay.io/cortexproject/cortex:v1.1.0
571+ docker pull quay.io/cortexproject/cortex:v1.2.0
572+ docker pull quay.io/cortexproject/cortex:v1.3.0
573+ docker pull quay.io/cortexproject/cortex:v1.4.0
574+ docker pull quay.io/cortexproject/cortex:v1.5.0
575+ docker pull quay.io/cortexproject/cortex:v1.6.0
576+ docker pull shopify/bigtable-emulator:0.1.0
577+ docker pull rinscy/cassandra:3.11.0
578+ docker pull memcached:1.6.1
579+ docker pull bouncestorage/swift-aio:55ba4331
580+ - name: Integration Tests
581+ run: |
582+ export CORTEX_IMAGE_PREFIX="${IMAGE_PREFIX:-quay.io/cortexproject/}"
583+ export IMAGE_TAG=$(make image-tag)
584+ export CORTEX_IMAGE="${CORTEX_IMAGE_PREFIX}cortex:$IMAGE_TAG"
585+ export CORTEX_CHECKOUT_DIR="/go/src/github.com/cortexproject/cortex"
586+ echo "Running integration tests with image: $CORTEX_IMAGE"
587+ go test -tags=requires_docker -timeout 2400s -v -count=1 ./integration/...
588+ env:
589+ IMAGE_PREFIX: ${{ secrets.IMAGE_PREFIX }}
590+
591+ integration-configs-db:
592+ needs: build
593+ runs-on: ubuntu-16.04
594+ steps:
595+ - name: Checkout Repo
596+ uses: actions/checkout@v2
597+ - name: Install Docker Client
598+ run: sudo ./.github/workflows/scripts/install-docker.sh
599+ - name: Download Docker Images Artifact
600+ uses: actions/download-artifact@v2
601+ with:
602+ name: Docker Images
603+ - name: Extract Docker Images Archive
604+ run: tar -xvf images.tar -C /
605+ - name: Run Integration Configs Tests
606+ # Github Actions does not support TTY in their default runners yet
607+ run: |
608+ touch build-image/.uptodate
609+ MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations
610+ make BUILD_IMAGE=quay.io/cortexproject/build-image:upgrade-build-image-debian-491e60715-WIP TTY='' configs-integration-test
611+
612+ deploy_website:
613+ needs: [build, test]
614+ if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
615+ runs-on: ubuntu-latest
616+ container:
617+ image: quay.io/cortexproject/build-image:upgrade-build-image-debian-491e60715-WIP
618+ steps:
619+ - name: Checkout Repo
620+ uses: actions/checkout@v2
621+ with:
622+ # web-deploy script expects repo to be cloned with ssh for some commands to work
623+ ssh-key: ${{ secrets.WEBSITE_DEPLOY_SSH_PRIVATE_KEY }}
624+ - name: Sym Link Expected Path to Workspace
625+ run: |
626+ mkdir -p /go/src/github.com/cortexproject/cortex
627+ ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
628+ - name: Download Website Artifact
629+ uses: actions/download-artifact@v2
630+ with:
631+ name: website public
632+ path: website/public
633+ - name: Setup SSH Keys and known_hosts for Github Authentication to Deploy Website
634+ run: |
635+ mkdir -p ~/.ssh
636+ ssh-keyscan github.com >> ~/.ssh/known_hosts
637+ ssh-agent -a $SSH_AUTH_SOCK > /dev/null
638+ ssh-add - <<< "${{ secrets.WEBSITE_DEPLOY_SSH_PRIVATE_KEY }}"
639+ env:
640+ SSH_AUTH_SOCK: /tmp/ssh_agent.sock
641+ shell: bash
642+ - name: Deploy Website
643+ # SSH is used to authentricate with Github because web-deploy script uses git to checkout and push to gh-pages
644+ run: make BUILD_IN_CONTAINER=false web-deploy
645+ env:
646+ SSH_AUTH_SOCK: /tmp/ssh_agent.sock
647+ GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no"
648+
649+ deploy:
650+ needs: [build, test, lint, integration, integration-configs-db]
651+ if: (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')) && github.repository == 'cortexproject/cortex'
652+ runs-on: ubuntu-latest
653+ container:
654+ image: quay.io/cortexproject/build-image:upgrade-build-image-debian-491e60715-WIP
655+ steps:
656+ - name: Checkout Repo
657+ uses: actions/checkout@v2
658+ - name: Install Docker Client
659+ run: ./.github/workflows/scripts/install-docker.sh
660+ - name: Sym link Expected Path to Workspace
661+ run: |
662+ mkdir -p /go/src/github.com/cortexproject/cortex
663+ ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
664+ - name: Download Docker Images Artifact
665+ uses: actions/download-artifact@v2
666+ with:
667+ name: Docker Images
668+ - name: Extract Docker Images Archive
669+ run: tar -xvf images.tar -C /
670+ - name: Load Images
671+ run: |
672+ ln -s /tmp/images ./docker-images
673+ make BUILD_IN_CONTAINER=false load-images
674+ - name: Deploy
675+ run: |
676+ if [ -n "$DOCKER_REGISTRY_PASSWORD" ]; then
677+ docker login -u "$DOCKER_REGISTRY_USER" -p "$DOCKER_REGISTRY_PASSWORD"
678+ fi
679+ if [ -n "$QUAY_REGISTRY_PASSWORD" ]; then
680+ docker login -u "$QUAY_REGISTRY_USER" -p "$QUAY_REGISTRY_PASSWORD" quay.io;
681+ fi
682+ export IMAGE_TAG=$(make image-tag)
683+ ./push-images $NOQUAY
684+ env:
685+ DOCKER_REGISTRY_USER: ${{secrets.DOCKER_REGISTRY_USER}}
686+ DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
687+ QUAY_REGISTRY_USER: ${{secrets.QUAY_REGISTRY_USER}}
688+ QUAY_REGISTRY_PASSWORD: ${{secrets.QUAY_REGISTRY_PASSWORD}}
689+ NOQUAY: ${{secrets.NOQUAY}}
690diff --git a/.gitignore b/.gitignore
691index edbb044..90c3541 100644
692--- a/.gitignore
693+++ b/.gitignore
694@@ -12,3 +12,16 @@ website/content/en/docs
695 e2e_integration_test*
696 active-query-tracker
697 dist/
698+
699+# Binaries built from ./cmd
700+/blocksconvert
701+/cortex
702+/query-tee
703+/test-exporter
704+
705+# This is custom Makefile modification, if it exists.
706+Makefile.local
707+
708+.idea
709+compose
710+compose-simple
711\ No newline at end of file
712diff --git a/ADOPTERS.md b/ADOPTERS.md
713index 002ca35..6b6c951 100644
714--- a/ADOPTERS.md
715+++ b/ADOPTERS.md
716@@ -2,12 +2,17 @@
717
718 This is the list of organisations that are using Cortex in **production environments** to power their metrics and monitoring systems. Please send PRs to add or remove organisations.
719
720+* [Amazon Web Services (AWS)](https://aws.amazon.com/prometheus)
721 * [Aspen Mesh](https://aspenmesh.io/)
722+* [Buoyant](https://buoyant.io/)
723 * [DigitalOcean](https://www.digitalocean.com/)
724 * [Electronic Arts](https://www.ea.com/)
725+* [Etsy](https://www.etsy.com/)
726+* [EverQuote](https://everquote.com/)
727 * [GoJek](https://www.gojek.io/)
728 * [GrafanaLabs](https://grafana.com/)
729 * [MayaData](https://mayadata.io/)
730+* [Opstrace](https://opstrace.com/)
731 * [Platform9](https://platform9.com/)
732 * [REWE Digital](https://rewe-digital.com/)
733 * [SysEleven](https://www.syseleven.de/)
734diff --git a/CHANGELOG.md b/CHANGELOG.md
735index 6b8a1c3..fc8dc25 100644
736--- a/CHANGELOG.md
737+++ b/CHANGELOG.md
738@@ -2,10 +2,282 @@
739
740 ## master / unreleased
741
742+## 1.7.0
743+
744+Note the blocks storage compactor runs a migration task at startup in this version, which can take many minutes and use a lot of RAM.
745+[Turn this off after first run](https://cortexmetrics.io/docs/blocks-storage/production-tips/#ensure-deletion-marks-migration-is-disabled-after-first-run).
746+
747+* [CHANGE] FramedSnappy encoding support has been removed from Push and Remote Read APIs. This means Prometheus 1.6 support has been removed and the oldest Prometheus version supported in the remote write is 1.7. #3682
748+* [CHANGE] Ruler: removed the flag `-ruler.evaluation-delay-duration-deprecated` which was deprecated in 1.4.0. Please use the `ruler_evaluation_delay_duration` per-tenant limit instead. #3694
749+* [CHANGE] Removed the flags `-<prefix>.grpc-use-gzip-compression` which were deprecated in 1.3.0: #3694
750+ * `-query-scheduler.grpc-client-config.grpc-use-gzip-compression`: use `-query-scheduler.grpc-client-config.grpc-compression` instead
751+ * `-frontend.grpc-client-config.grpc-use-gzip-compression`: use `-frontend.grpc-client-config.grpc-compression` instead
752+ * `-ruler.client.grpc-use-gzip-compression`: use `-ruler.client.grpc-compression` instead
753+ * `-bigtable.grpc-use-gzip-compression`: use `-bigtable.grpc-compression` instead
754+ * `-ingester.client.grpc-use-gzip-compression`: use `-ingester.client.grpc-compression` instead
755+ * `-querier.frontend-client.grpc-use-gzip-compression`: use `-querier.frontend-client.grpc-compression` instead
756+* [CHANGE] Querier: it's not required to set `-frontend.query-stats-enabled=true` in the querier anymore to enable query statistics logging in the query-frontend. The flag is now required to be configured only in the query-frontend and it will be propagated to the queriers. #3595 #3695
757+* [CHANGE] Blocks storage: compactor is now required when running a Cortex cluster with the blocks storage, because it also keeps the bucket index updated. #3583
758+* [CHANGE] Blocks storage: block deletion marks are now stored in a per-tenant global markers/ location too, other than within the block location. The compactor, at startup, will copy deletion marks from the block location to the global location. This migration is required only once, so you can safely disable it via `-compactor.block-deletion-marks-migration-enabled=false` once new compactor has successfully started once in your cluster. #3583
759+* [CHANGE] OpenStack Swift: the default value for the `-ruler.storage.swift.container-name` and `-swift.container-name` config options has changed from `cortex` to empty string. If you were relying on the default value, you should set it back to `cortex`. #3660
760+* [CHANGE] HA Tracker: configured replica label is now verified against label value length limit (`-validation.max-length-label-value`). #3668
761+* [CHANGE] Distributor: `extend_writes` field in YAML configuration has moved from `lifecycler` (inside `ingester_config`) to `distributor_config`. This doesn't affect command line option `-distributor.extend-writes`, which stays the same. #3719
762+* [CHANGE] Alertmanager: Deprecated `-cluster.` CLI flags in favor of their `-alertmanager.cluster.` equivalent. The deprecated flags (and their respective YAML config options) are: #3677
763+ * `-cluster.listen-address` in favor of `-alertmanager.cluster.listen-address`
764+ * `-cluster.advertise-address` in favor of `-alertmanager.cluster.advertise-address`
765+ * `-cluster.peer` in favor of `-alertmanager.cluster.peers`
766+ * `-cluster.peer-timeout` in favor of `-alertmanager.cluster.peer-timeout`
767+* [CHANGE] Blocks storage: the default value of `-blocks-storage.bucket-store.sync-interval` has been changed from `5m` to `15m`. #3724
768+* [FEATURE] Querier: Queries can be federated across multiple tenants. The tenants IDs involved need to be specified separated by a `|` character in the `X-Scope-OrgID` request header. This is an experimental feature, which can be enabled by setting `-tenant-federation.enabled=true` on all Cortex services. #3250
769+* [FEATURE] Alertmanager: introduced the experimental option `-alertmanager.sharding-enabled` to shard tenants across multiple Alertmanager instances. This feature is still under heavy development and its usage is discouraged. The following new metrics are exported by the Alertmanager: #3664
770+ * `cortex_alertmanager_ring_check_errors_total`
771+ * `cortex_alertmanager_sync_configs_total`
772+ * `cortex_alertmanager_sync_configs_failed_total`
773+ * `cortex_alertmanager_tenants_discovered`
774+ * `cortex_alertmanager_tenants_owned`
775+* [ENHANCEMENT] Allow specifying JAEGER_ENDPOINT instead of sampling server or local agent port. #3682
776+* [ENHANCEMENT] Blocks storage: introduced a per-tenant bucket index, periodically updated by the compactor, used to avoid full bucket scanning done by queriers, store-gateways and rulers. The bucket index is updated by the compactor during blocks cleanup, on every `-compactor.cleanup-interval`. #3553 #3555 #3561 #3583 #3625 #3711 #3715
777+* [ENHANCEMENT] Blocks storage: introduced an option `-blocks-storage.bucket-store.bucket-index.enabled` to enable the usage of the bucket index in the querier, store-gateway and ruler. When enabled, the querier, store-gateway and ruler will use the bucket index to find a tenant's blocks instead of running the periodic bucket scan. The following new metrics are exported by the querier and ruler: #3614 #3625
778+ * `cortex_bucket_index_loads_total`
779+ * `cortex_bucket_index_load_failures_total`
780+ * `cortex_bucket_index_load_duration_seconds`
781+ * `cortex_bucket_index_loaded`
782+* [ENHANCEMENT] Compactor: exported the following metrics. #3583 #3625
783+ * `cortex_bucket_blocks_count`: Total number of blocks per tenant in the bucket. Includes blocks marked for deletion, but not partial blocks.
784+ * `cortex_bucket_blocks_marked_for_deletion_count`: Total number of blocks per tenant marked for deletion in the bucket.
785+ * `cortex_bucket_blocks_partials_count`: Total number of partial blocks.
786+ * `cortex_bucket_index_last_successful_update_timestamp_seconds`: Timestamp of the last successful update of a tenant's bucket index.
787+* [ENHANCEMENT] Ruler: Add `cortex_prometheus_last_evaluation_samples` to expose the number of samples generated by a rule group per tenant. #3582
788+* [ENHANCEMENT] Memberlist: add status page (/memberlist) with available details about memberlist-based KV store and memberlist cluster. It's also possible to view KV values in Go struct or JSON format, or download for inspection. #3575
789+* [ENHANCEMENT] Memberlist: client can now keep a size-bounded buffer with sent and received messages and display them in the admin UI (/memberlist) for troubleshooting. #3581 #3602
790+* [ENHANCEMENT] Blocks storage: added block index attributes caching support to metadata cache. The TTL can be configured via `-blocks-storage.bucket-store.metadata-cache.block-index-attributes-ttl`. #3629
791+* [ENHANCEMENT] Alertmanager: Add support for Azure blob storage. #3634
792+* [ENHANCEMENT] Compactor: tenants marked for deletion will now be fully cleaned up after some delay since deletion of last block. Cleanup includes removal of remaining marker files (including tenant deletion mark file) and files under `debug/metas`. #3613
793+* [ENHANCEMENT] Compactor: retry compaction of a single tenant on failure instead of re-running compaction for all tenants. #3627
794+* [ENHANCEMENT] Querier: Implement result caching for tenant query federation. #3640
795+* [ENHANCEMENT] API: Add a `mode` query parameter for the config endpoint: #3645
796+ * `/config?mode=diff`: Shows the YAML configuration with all values that differ from the defaults.
797+ * `/config?mode=defaults`: Shows the YAML configuration with all the default values.
798+* [ENHANCEMENT] OpenStack Swift: added the following config options to OpenStack Swift backend client: #3660
799+ - Chunks storage: `-swift.auth-version`, `-swift.max-retries`, `-swift.connect-timeout`, `-swift.request-timeout`.
800+ - Blocks storage: ` -blocks-storage.swift.auth-version`, ` -blocks-storage.swift.max-retries`, ` -blocks-storage.swift.connect-timeout`, ` -blocks-storage.swift.request-timeout`.
801+ - Ruler: `-ruler.storage.swift.auth-version`, `-ruler.storage.swift.max-retries`, `-ruler.storage.swift.connect-timeout`, `-ruler.storage.swift.request-timeout`.
802+* [ENHANCEMENT] Disabled in-memory shuffle-sharding subring cache in the store-gateway, ruler and compactor. This should reduce the memory utilisation in these services when shuffle-sharding is enabled, without introducing a significantly increase CPU utilisation. #3601
803+* [ENHANCEMENT] Shuffle sharding: optimised subring generation used by shuffle sharding. #3601
804+* [ENHANCEMENT] New /runtime_config endpoint that returns the defined runtime configuration in YAML format. The returned configuration includes overrides. #3639
805+* [ENHANCEMENT] Query-frontend: included the parameter name failed to validate in HTTP 400 message. #3703
806+* [ENHANCEMENT] Fail to startup Cortex if provided runtime config is invalid. #3707
807+* [ENHANCEMENT] Alertmanager: Add flags to customize the cluster configuration: #3667
808+ * `-alertmanager.cluster.gossip-interval`: The interval between sending gossip messages. By lowering this value (more frequent) gossip messages are propagated across cluster more quickly at the expense of increased bandwidth usage.
809+ * `-alertmanager.cluster.push-pull-interval`: The interval between gossip state syncs. Setting this interval lower (more frequent) will increase convergence speeds across larger clusters at the expense of increased bandwidth usage.
810+* [ENHANCEMENT] Distributor: change the error message returned when a received series has too many label values. The new message format has the series at the end and this plays better with Prometheus logs truncation. #3718
811+ - From: `sample for '<series>' has <value> label names; limit <value>`
812+ - To: `series has too many labels (actual: <value>, limit: <value>) series: '<series>'`
813+* [ENHANCEMENT] Improve bucket index loader to handle edge case where new tenant has not had blocks uploaded to storage yet. #3717
814+* [BUGFIX] Allow `-querier.max-query-lookback` use `y|w|d` suffix like deprecated `-store.max-look-back-period`. #3598
815+* [BUGFIX] Memberlist: Entry in the ring should now not appear again after using "Forget" feature (unless it's still heartbeating). #3603
816+* [BUGFIX] Ingester: do not close idle TSDBs while blocks shipping is in progress. #3630 #3632
817+* [BUGFIX] Ingester: correctly update `cortex_ingester_memory_users` and `cortex_ingester_active_series` when a tenant's idle TSDB is closed, when running Cortex with the blocks storage. #3646
818+* [BUGFIX] Querier: fix default value incorrectly overriding `-querier.frontend-address` in single-binary mode. #3650
819+* [BUGFIX] Compactor: delete `deletion-mark.json` at last when deleting a block in order to not leave partial blocks without deletion mark in the bucket if the compactor is interrupted while deleting a block. #3660
820+* [BUGFIX] Blocks storage: do not cleanup a partially uploaded block when `meta.json` upload fails. Despite failure to upload `meta.json`, this file may in some cases still appear in the bucket later. By skipping early cleanup, we avoid having corrupted blocks in the storage. #3660
821+* [BUGFIX] Alertmanager: disable access to `/alertmanager/metrics` (which exposes all Cortex metrics), `/alertmanager/-/reload` and `/alertmanager/debug/*`, which were available to any authenticated user with enabled AlertManager. #3678
822+* [BUGFIX] Query-Frontend: avoid creating many small sub-queries by discarding cache extents under 5 minutes #3653
823+* [BUGFIX] Ruler: Ensure the stale markers generated for evaluated rules respect the configured `-ruler.evaluation-delay-duration`. This will avoid issues with samples with NaN be persisted with timestamps set ahead of the next rule evaluation. #3687
824+* [BUGFIX] Alertmanager: don't serve HTTP requests until Alertmanager has fully started. Serving HTTP requests earlier may result in loss of configuration for the user. #3679
825+* [BUGFIX] Do not log "failed to load config" if runtime config file is empty. #3706
826+* [BUGFIX] Do not allow to use a runtime config file containing multiple YAML documents. #3706
827+* [BUGFIX] HA Tracker: don't track as error in the `cortex_kv_request_duration_seconds` metric a CAS operation intentionally aborted. #3745
828+
829+## 1.6.0
830+
831+* [CHANGE] Query Frontend: deprecate `-querier.compress-http-responses` in favour of `-api.response-compression-enabled`. #3544
832+* [CHANGE] Querier: deprecated `-store.max-look-back-period`. You should use `-querier.max-query-lookback` instead. #3452
833+* [CHANGE] Blocks storage: increased `-blocks-storage.bucket-store.chunks-cache.attributes-ttl` default from `24h` to `168h` (1 week). #3528
834+* [CHANGE] Blocks storage: the config option `-blocks-storage.bucket-store.index-cache.postings-compression-enabled` has been deprecated and postings compression is always enabled. #3538
835+* [CHANGE] Ruler: gRPC message size default limits on the Ruler-client side have changed: #3523
836+ - limit for outgoing gRPC messages has changed from 2147483647 to 16777216 bytes
837+ - limit for incoming gRPC messages has changed from 4194304 to 104857600 bytes
838+* [FEATURE] Distributor/Ingester: Provide ability to not overflow writes in the presence of a leaving or unhealthy ingester. This allows for more efficient ingester rolling restarts. #3305
839+* [FEATURE] Query-frontend: introduced query statistics logged in the query-frontend when enabled via `-frontend.query-stats-enabled=true`. When enabled, the metric `cortex_query_seconds_total` is tracked, counting the sum of the wall time spent across all queriers while running queries (on a per-tenant basis). The metrics `cortex_request_duration_seconds` and `cortex_query_seconds_total` are different: the first one tracks the request duration (eg. HTTP request from the client), while the latter tracks the sum of the wall time on all queriers involved executing the query. #3539
840+* [ENHANCEMENT] API: Add GZIP HTTP compression to the API responses. Compression can be enabled via `-api.response-compression-enabled`. #3536
841+* [ENHANCEMENT] Added zone-awareness support on queries. When zone-awareness is enabled, queries will still succeed if all ingesters in a single zone will fail. #3414
842+* [ENHANCEMENT] Blocks storage ingester: exported more TSDB-related metrics. #3412
843+ - `cortex_ingester_tsdb_wal_corruptions_total`
844+ - `cortex_ingester_tsdb_head_truncations_failed_total`
845+ - `cortex_ingester_tsdb_head_truncations_total`
846+ - `cortex_ingester_tsdb_head_gc_duration_seconds`
847+* [ENHANCEMENT] Enforced keepalive on all gRPC clients used for inter-service communication. #3431
848+* [ENHANCEMENT] Added `cortex_alertmanager_config_hash` metric to expose hash of Alertmanager Config loaded per user. #3388
849+* [ENHANCEMENT] Query-Frontend / Query-Scheduler: New component called "Query-Scheduler" has been introduced. Query-Scheduler is simply a queue of requests, moved outside of Query-Frontend. This allows Query-Frontend to be scaled separately from number of queues. To make Query-Frontend and Querier use Query-Scheduler, they need to be started with `-frontend.scheduler-address` and `-querier.scheduler-address` options respectively. #3374 #3471
850+* [ENHANCEMENT] Query-frontend / Querier / Ruler: added `-querier.max-query-lookback` to limit how long back data (series and metadata) can be queried. This setting can be overridden on a per-tenant basis and is enforced in the query-frontend, querier and ruler. #3452 #3458
851+* [ENHANCEMENT] Querier: added `-querier.query-store-for-labels-enabled` to query store for label names, label values and series APIs. Only works with blocks storage engine. #3461 #3520
852+* [ENHANCEMENT] Ingester: exposed `-blocks-storage.tsdb.wal-segment-size-bytes` config option to customise the TSDB WAL segment max size. #3476
853+* [ENHANCEMENT] Compactor: concurrently run blocks cleaner for multiple tenants. Concurrency can be configured via `-compactor.cleanup-concurrency`. #3483
854+* [ENHANCEMENT] Compactor: shuffle tenants before running compaction. #3483
855+* [ENHANCEMENT] Compactor: wait for a stable ring at startup, when sharding is enabled. #3484
856+* [ENHANCEMENT] Store-gateway: added `-blocks-storage.bucket-store.index-header-lazy-loading-enabled` to enable index-header lazy loading (experimental). When enabled, index-headers will be mmap-ed only once required by a query and will be automatically released after `-blocks-storage.bucket-store.index-header-lazy-loading-idle-timeout` time of inactivity. #3498
857+* [ENHANCEMENT] Alertmanager: added metrics `cortex_alertmanager_notification_requests_total` and `cortex_alertmanager_notification_requests_failed_total`. #3518
858+* [ENHANCEMENT] Ingester: added `-blocks-storage.tsdb.head-chunks-write-buffer-size-bytes` to fine-tune the TSDB head chunks write buffer size when running Cortex blocks storage. #3518
859+* [ENHANCEMENT] /metrics now supports OpenMetrics output. HTTP and gRPC servers metrics can now include exemplars. #3524
860+* [ENHANCEMENT] Expose gRPC keepalive policy options by gRPC server. #3524
861+* [ENHANCEMENT] Blocks storage: enabled caching of `meta.json` attributes, configurable via `-blocks-storage.bucket-store.metadata-cache.metafile-attributes-ttl`. #3528
862+* [ENHANCEMENT] Compactor: added a config validation check to fail fast if the compactor has been configured invalid block range periods (each period is expected to be a multiple of the previous one). #3534
863+* [ENHANCEMENT] Blocks storage: concurrently fetch deletion marks from object storage. #3538
864+* [ENHANCEMENT] Blocks storage ingester: ingester can now close idle TSDB and delete local data. #3491 #3552
865+* [ENHANCEMENT] Blocks storage: add option to use V2 signatures for S3 authentication. #3540
866+* [ENHANCEMENT] Exported process metrics to monitor the number of memory map areas allocated. #3537
867+ * - `process_memory_map_areas`
868+ * - `process_memory_map_areas_limit`
869+* [ENHANCEMENT] Ruler: Expose gRPC client options. #3523
870+* [ENHANCEMENT] Compactor: added metrics to track on-going compaction. #3535
871+ * `cortex_compactor_tenants_discovered`
872+ * `cortex_compactor_tenants_skipped`
873+ * `cortex_compactor_tenants_processing_succeeded`
874+ * `cortex_compactor_tenants_processing_failed`
875+* [ENHANCEMENT] Added new experimental API endpoints: `POST /purger/delete_tenant` and `GET /purger/delete_tenant_status` for deleting all tenant data. Only works with blocks storage. Compactor removes blocks that belong to user marked for deletion. #3549 #3558
876+* [ENHANCEMENT] Chunks storage: add option to use V2 signatures for S3 authentication. #3560
877+* [ENHANCEMENT] HA Tracker: Added new limit `ha_max_clusters` to set the max number of clusters tracked for single user. This limit is disabled by default. #3668
878+* [BUGFIX] Query-Frontend: `cortex_query_seconds_total` now return seconds not nanoseconds. #3589
879+* [BUGFIX] Blocks storage ingester: fixed some cases leading to a TSDB WAL corruption after a partial write to disk. #3423
880+* [BUGFIX] Blocks storage: Fix the race between ingestion and `/flush` call resulting in overlapping blocks. #3422
881+* [BUGFIX] Querier: fixed `-querier.max-query-into-future` which wasn't correctly enforced on range queries. #3452
882+* [BUGFIX] Fixed float64 precision stability when aggregating metrics before exposing them. This could have lead to false counters resets when querying some metrics exposed by Cortex. #3506
883+* [BUGFIX] Querier: the meta.json sync concurrency done when running Cortex with the blocks storage is now controlled by `-blocks-storage.bucket-store.meta-sync-concurrency` instead of the incorrect `-blocks-storage.bucket-store.block-sync-concurrency` (default values are the same). #3531
884+* [BUGFIX] Querier: fixed initialization order of querier module when using blocks storage. It now (again) waits until blocks have been synchronized. #3551
885+
886+## Blocksconvert
887+
888+* [ENHANCEMENT] Scheduler: ability to ignore users based on regexp, using `-scheduler.ignore-users-regex` flag. #3477
889+* [ENHANCEMENT] Builder: Parallelize reading chunks in the final stage of building block. #3470
890+* [ENHANCEMENT] Builder: remove duplicate label names from chunk. #3547
891+
892+## 1.5.0 / 2020-11-09
893+
894+### Cortex
895+
896+* [CHANGE] Blocks storage: update the default HTTP configuration values for the S3 client to the upstream Thanos default values. #3244
897+ - `-blocks-storage.s3.http.idle-conn-timeout` is set 90 seconds.
898+ - `-blocks-storage.s3.http.response-header-timeout` is set to 2 minutes.
899+* [CHANGE] Improved shuffle sharding support in the write path. This work introduced some config changes: #3090
900+ * Introduced `-distributor.sharding-strategy` CLI flag (and its respective `sharding_strategy` YAML config option) to explicitly specify which sharding strategy should be used in the write path
901+ * `-experimental.distributor.user-subring-size` flag renamed to `-distributor.ingestion-tenant-shard-size`
902+ * `user_subring_size` limit YAML config option renamed to `ingestion_tenant_shard_size`
903+* [CHANGE] Dropped "blank Alertmanager configuration; using fallback" message from Info to Debug level. #3205
904+* [CHANGE] Zone-awareness replication for time-series now should be explicitly enabled in the distributor via the `-distributor.zone-awareness-enabled` CLI flag (or its respective YAML config option). Before, zone-aware replication was implicitly enabled if a zone was set on ingesters. #3200
905+* [CHANGE] Removed the deprecated CLI flag `-config-yaml`. You should use `-schema-config-file` instead. #3225
906+* [CHANGE] Enforced the HTTP method required by some API endpoints which did (incorrectly) allow any method before that. #3228
907+ - `GET /`
908+ - `GET /config`
909+ - `GET /debug/fgprof`
910+ - `GET /distributor/all_user_stats`
911+ - `GET /distributor/ha_tracker`
912+ - `GET /all_user_stats`
913+ - `GET /ha-tracker`
914+ - `GET /api/v1/user_stats`
915+ - `GET /api/v1/chunks`
916+ - `GET <legacy-http-prefix>/user_stats`
917+ - `GET <legacy-http-prefix>/chunks`
918+ - `GET /services`
919+ - `GET /multitenant_alertmanager/status`
920+ - `GET /status` (alertmanager microservice)
921+ - `GET|POST /ingester/ring`
922+ - `GET|POST /ring`
923+ - `GET|POST /store-gateway/ring`
924+ - `GET|POST /compactor/ring`
925+ - `GET|POST /ingester/flush`
926+ - `GET|POST /ingester/shutdown`
927+ - `GET|POST /flush`
928+ - `GET|POST /shutdown`
929+ - `GET|POST /ruler/ring`
930+ - `POST /api/v1/push`
931+ - `POST <legacy-http-prefix>/push`
932+ - `POST /push`
933+ - `POST /ingester/push`
934+* [CHANGE] Renamed CLI flags to configure the network interface names from which automatically detect the instance IP. #3295
935+ - `-compactor.ring.instance-interface` renamed to `-compactor.ring.instance-interface-names`
936+ - `-store-gateway.sharding-ring.instance-interface` renamed to `-store-gateway.sharding-ring.instance-interface-names`
937+ - `-distributor.ring.instance-interface` renamed to `-distributor.ring.instance-interface-names`
938+ - `-ruler.ring.instance-interface` renamed to `-ruler.ring.instance-interface-names`
939+* [CHANGE] Renamed `-<prefix>.redis.enable-tls` CLI flag to `-<prefix>.redis.tls-enabled`, and its respective YAML config option from `enable_tls` to `tls_enabled`. #3298
940+* [CHANGE] Increased default `-<prefix>.redis.timeout` from `100ms` to `500ms`. #3301
941+* [CHANGE] `cortex_alertmanager_config_invalid` has been removed in favor of `cortex_alertmanager_config_last_reload_successful`. #3289
942+* [CHANGE] Query-frontend: POST requests whose body size exceeds 10MiB will be rejected. The max body size can be customised via `-frontend.max-body-size`. #3276
943+* [FEATURE] Shuffle sharding: added support for shuffle-sharding queriers in the query-frontend. When configured (`-frontend.max-queriers-per-tenant` globally, or using per-tenant limit `max_queriers_per_tenant`), each tenants's requests will be handled by different set of queriers. #3113 #3257
944+* [FEATURE] Shuffle sharding: added support for shuffle-sharding ingesters on the read path. When ingesters shuffle-sharding is enabled and `-querier.shuffle-sharding-ingesters-lookback-period` is set, queriers will fetch in-memory series from the minimum set of required ingesters, selecting only ingesters which may have received series since 'now - lookback period'. #3252
945+* [FEATURE] Query-frontend: added `compression` config to support results cache with compression. #3217
946+* [FEATURE] Add OpenStack Swift support to blocks storage. #3303
947+* [FEATURE] Added support for applying Prometheus relabel configs on series received by the distributor. A `metric_relabel_configs` field has been added to the per-tenant limits configuration. #3329
948+* [FEATURE] Support for Cassandra client SSL certificates. #3384
949+* [ENHANCEMENT] Ruler: Introduces two new limits `-ruler.max-rules-per-rule-group` and `-ruler.max-rule-groups-per-tenant` to control the number of rules per rule group and the total number of rule groups for a given user. They are disabled by default. #3366
950+* [ENHANCEMENT] Allow to specify multiple comma-separated Cortex services to `-target` CLI option (or its respective YAML config option). For example, `-target=all,compactor` can be used to start Cortex single-binary with compactor as well. #3275
951+* [ENHANCEMENT] Expose additional HTTP configs for the S3 backend client. New flag are listed below: #3244
952+ - `-blocks-storage.s3.http.idle-conn-timeout`
953+ - `-blocks-storage.s3.http.response-header-timeout`
954+ - `-blocks-storage.s3.http.insecure-skip-verify`
955+* [ENHANCEMENT] Added `cortex_query_frontend_connected_clients` metric to show the number of workers currently connected to the frontend. #3207
956+* [ENHANCEMENT] Shuffle sharding: improved shuffle sharding in the write path. Shuffle sharding now should be explicitly enabled via `-distributor.sharding-strategy` CLI flag (or its respective YAML config option) and guarantees stability, consistency, shuffling and balanced zone-awareness properties. #3090 #3214
957+* [ENHANCEMENT] Ingester: added new metric `cortex_ingester_active_series` to track active series more accurately. Also added options to control whether active series tracking is enabled (`-ingester.active-series-metrics-enabled`, defaults to false), and how often this metric is updated (`-ingester.active-series-metrics-update-period`) and max idle time for series to be considered inactive (`-ingester.active-series-metrics-idle-timeout`). #3153
958+* [ENHANCEMENT] Store-gateway: added zone-aware replication support to blocks replication in the store-gateway. #3200
959+* [ENHANCEMENT] Store-gateway: exported new metrics. #3231
960+ - `cortex_bucket_store_cached_series_fetch_duration_seconds`
961+ - `cortex_bucket_store_cached_postings_fetch_duration_seconds`
962+ - `cortex_bucket_stores_gate_queries_max`
963+* [ENHANCEMENT] Added `-version` flag to Cortex. #3233
964+* [ENHANCEMENT] Hash ring: added instance registered timestamp to the ring. #3248
965+* [ENHANCEMENT] Reduce tail latency by smoothing out spikes in rate of chunk flush operations. #3191
966+* [ENHANCEMENT] User Cortex as User Agent in http requests issued by Configs DB client. #3264
967+* [ENHANCEMENT] Experimental Ruler API: Fetch rule groups from object storage in parallel. #3218
968+* [ENHANCEMENT] Chunks GCS object storage client uses the `fields` selector to limit the payload size when listing objects in the bucket. #3218 #3292
969+* [ENHANCEMENT] Added shuffle sharding support to ruler. Added new metric `cortex_ruler_sync_rules_total`. #3235
970+* [ENHANCEMENT] Return an explicit error when the store-gateway is explicitly requested without a blocks storage engine. #3287
971+* [ENHANCEMENT] Ruler: only load rules that belong to the ruler. Improves rules synching performances when ruler sharding is enabled. #3269
972+* [ENHANCEMENT] Added `-<prefix>.redis.tls-insecure-skip-verify` flag. #3298
973+* [ENHANCEMENT] Added `cortex_alertmanager_config_last_reload_successful_seconds` metric to show timestamp of last successful AM config reload. #3289
974+* [ENHANCEMENT] Blocks storage: reduced number of bucket listing operations to list block content (applies to newly created blocks only). #3363
975+* [ENHANCEMENT] Ruler: Include the tenant ID on the notifier logs. #3372
976+* [ENHANCEMENT] Blocks storage Compactor: Added `-compactor.enabled-tenants` and `-compactor.disabled-tenants` to explicitly enable or disable compaction of specific tenants. #3385
977+* [ENHANCEMENT] Blocks storage ingester: Creating checkpoint only once even when there are multiple Head compactions in a single `Compact()` call. #3373
978+* [BUGFIX] Blocks storage ingester: Read repair memory-mapped chunks file which can end up being empty on abrupt shutdowns combined with faulty disks. #3373
979+* [BUGFIX] Blocks storage ingester: Close TSDB resources on failed startup preventing ingester OOMing. #3373
980+* [BUGFIX] No-longer-needed ingester operations for queries triggered by queriers and rulers are now canceled. #3178
981+* [BUGFIX] Ruler: directories in the configured `rules-path` will be removed on startup and shutdown in order to ensure they don't persist between runs. #3195
982+* [BUGFIX] Handle hash-collisions in the query path. #3192
983+* [BUGFIX] Check for postgres rows errors. #3197
984+* [BUGFIX] Ruler Experimental API: Don't allow rule groups without names or empty rule groups. #3210
985+* [BUGFIX] Experimental Alertmanager API: Do not allow empty Alertmanager configurations or bad template filenames to be submitted through the configuration API. #3185
986+* [BUGFIX] Reduce failures to update heartbeat when using Consul. #3259
987+* [BUGFIX] When using ruler sharding, moving all user rule groups from ruler to a different one and then back could end up with some user groups not being evaluated at all. #3235
988+* [BUGFIX] Fixed shuffle sharding consistency when zone-awareness is enabled and the shard size is increased or instances in a new zone are added. #3299
989+* [BUGFIX] Use a valid grpc header when logging IP addresses. #3307
990+* [BUGFIX] Fixed the metric `cortex_prometheus_rule_group_duration_seconds` in the Ruler, it wouldn't report any values. #3310
991+* [BUGFIX] Fixed gRPC connections leaking in rulers when rulers sharding is enabled and APIs called. #3314
992+* [BUGFIX] Fixed shuffle sharding consistency when zone-awareness is enabled and the shard size is increased or instances in a new zone are added. #3299
993+* [BUGFIX] Fixed Gossip memberlist members joining when addresses are configured using DNS-based service discovery. #3360
994+* [BUGFIX] Ingester: fail to start an ingester running the blocks storage, if unable to load any existing TSDB at startup. #3354
995+* [BUGFIX] Blocks storage: Avoid deletion of blocks in the ingester which are not shipped to the storage yet. #3346
996+* [BUGFIX] Fix common prefixes returned by List method of S3 client. #3358
997+* [BUGFIX] Honor configured timeout in Azure and GCS object clients. #3285
998+* [BUGFIX] Blocks storage: Avoid creating blocks larger than configured block range period on forced compaction and when TSDB is idle. #3344
999+* [BUGFIX] Shuffle sharding: fixed max global series per user/metric limit when shuffle sharding and `-distributor.shard-by-all-labels=true` are both enabled in distributor. When using these global limits you should now set `-distributor.sharding-strategy` and `-distributor.zone-awareness-enabled` to ingesters too. #3369
1000+* [BUGFIX] Slow query logging: when using downstream server request parameters were not logged. #3276
1001+* [BUGFIX] Fixed tenant detection in the ruler and alertmanager API when running without auth. #3343
1002+
1003+### Blocksconvert
1004+
1005+* [ENHANCEMENT] Blocksconvert – Builder: download plan file locally before processing it. #3209
1006+* [ENHANCEMENT] Blocksconvert – Cleaner: added new tool for deleting chunks data. #3283
1007+* [ENHANCEMENT] Blocksconvert – Scanner: support for scanning specific date-range only. #3222
1008+* [ENHANCEMENT] Blocksconvert – Scanner: metrics for tracking progress. #3222
1009+* [ENHANCEMENT] Blocksconvert – Builder: retry block upload before giving up. #3245
1010+* [ENHANCEMENT] Blocksconvert – Scanner: upload plans concurrently. #3340
1011+* [BUGFIX] Blocksconvert: fix chunks ordering in the block. Chunks in different order than series work just fine in TSDB blocks at the moment, but it's not consistent with what Prometheus does and future Prometheus and Cortex optimizations may rely on this ordering. #3371
1012+
1013 ## 1.4.0 / 2020-10-02
1014
1015+* [CHANGE] TLS configuration for gRPC, HTTP and etcd clients is now marked as experimental. These features are not yet fully baked, and we expect possible small breaking changes in Cortex 1.5. #3198
1016 * [CHANGE] Cassandra backend support is now GA (stable). #3180
1017-* [CHANGE] Blocks storage is now GA (stable). The `-experimental` prefix has been removed from all CLI flags related to the blocks storage (no YAML config changes). #3180
1018+* [CHANGE] Blocks storage is now GA (stable). The `-experimental` prefix has been removed from all CLI flags related to the blocks storage (no YAML config changes). #3180 #3201
1019 - `-experimental.blocks-storage.*` flags renamed to `-blocks-storage.*`
1020 - `-experimental.store-gateway.*` flags renamed to `-store-gateway.*`
1021 - `-experimental.querier.store-gateway-client.*` flags renamed to `-querier.store-gateway-client.*`
1022@@ -46,6 +318,7 @@
1023 * `cortex_bucket_stores_tenants_discovered`
1024 * `cortex_bucket_stores_tenants_synced`
1025 * [FEATURE] Experimental blocksconvert: introduce an experimental tool `blocksconvert` to migrate long-term storage chunks to blocks. #3092 #3122 #3127 #3162
1026+* [ENHANCEMENT] Improve the Alertmanager logging when serving requests from its API / UI. #3397
1027 * [ENHANCEMENT] Add support for azure storage in China, German and US Government environments. #2988
1028 * [ENHANCEMENT] Query-tee: added a small tolerance to floating point sample values comparison. #2994
1029 * [ENHANCEMENT] Query-tee: add support for doing a passthrough of requests to preferred backend for unregistered routes #3018
1030diff --git a/MAINTAINERS b/MAINTAINERS
1031index dd22681..af224c7 100644
1032--- a/MAINTAINERS
1033+++ b/MAINTAINERS
1034@@ -1,5 +1,5 @@
1035 Bryan Boreham, Weaveworks <bryan@weave.works> (@bboreham)
1036-Chris Marchbanks, Splunk <csmarchbanks@gmail.com> (@csmarchbanks)
1037+Chris Marchbanks, Grafana Labs <csmarchbanks@gmail.com> (@csmarchbanks)
1038 Goutham Veeramachaneni, Grafana Labs <gouthamve@gmail.com> (@gouthamve)
1039 Jacob Lisi, Grafana Labs <jacob.t.lisi@gmail.com> (@jtlisi)
1040 Ken Haines, Microsoft <khaines@microsoft.com> (@khaines)
1041diff --git a/Makefile b/Makefile
1042index 36183b2..f872e19 100644
1043--- a/Makefile
1044+++ b/Makefile
1045@@ -1,3 +1,7 @@
1046+# Local settings (optional). See Makefile.local.example for an example.
1047+# WARNING: do not commit to a repository!
1048+-include Makefile.local
1049+
1050 .PHONY: all test clean images protos exes dist doc clean-doc check-doc
1051 .DEFAULT_GOAL := all
1052
1053@@ -8,12 +12,22 @@ GOPROXY_VALUE=$(shell go env GOPROXY)
1054 # Boiler plate for building Docker containers.
1055 # All this must go at top of file I'm afraid.
1056 IMAGE_PREFIX ?= quay.io/cortexproject/
1057-# Use CIRCLE_TAG if present for releases.
1058-IMAGE_TAG ?= $(if $(CIRCLE_TAG),$(CIRCLE_TAG),$(shell ./tools/image-tag))
1059+
1060+# For a tag push GITHUB_REF will look like refs/tags/<tag_name>,
1061+# If finding refs/tags/ does not equal emptystring then use
1062+# the tag we are at as the image tag.
1063+ifneq (,$(findstring refs/tags/, $(GITHUB_REF)))
1064+ GIT_TAG := $(shell git tag --points-at HEAD)
1065+endif
1066+IMAGE_TAG ?= $(if $(GIT_TAG),$(GIT_TAG),$(shell ./tools/image-tag))
1067 GIT_REVISION := $(shell git rev-parse --short HEAD)
1068 GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
1069 UPTODATE := .uptodate
1070
1071+.PHONY: image-tag
1072+image-tag:
1073+ @echo $(IMAGE_TAG)
1074+
1075 # Support gsed on OSX (installed via brew), falling back to sed. On Linux
1076 # systems gsed won't be installed, so will use sed as expected.
1077 SED ?= $(shell which gsed 2>/dev/null || which sed)
1078@@ -60,13 +74,17 @@ $(foreach exe, $(EXES), $(eval $(call dep_exe, $(exe))))
1079 pkg/ingester/client/cortex.pb.go: pkg/ingester/client/cortex.proto
1080 pkg/ingester/wal.pb.go: pkg/ingester/wal.proto
1081 pkg/ring/ring.pb.go: pkg/ring/ring.proto
1082-pkg/querier/frontend/frontend.pb.go: pkg/querier/frontend/frontend.proto
1083+pkg/frontend/v1/frontendv1pb/frontend.pb.go: pkg/frontend/v1/frontendv1pb/frontend.proto
1084+pkg/frontend/v2/frontendv2pb/frontend.pb.go: pkg/frontend/v2/frontendv2pb/frontend.proto
1085 pkg/querier/queryrange/queryrange.pb.go: pkg/querier/queryrange/queryrange.proto
1086+pkg/querier/stats/stats.pb.go: pkg/querier/stats/stats.proto
1087 pkg/chunk/storage/caching_index_client.pb.go: pkg/chunk/storage/caching_index_client.proto
1088 pkg/distributor/ha_tracker.pb.go: pkg/distributor/ha_tracker.proto
1089 pkg/ruler/rules/rules.pb.go: pkg/ruler/rules/rules.proto
1090 pkg/ruler/ruler.pb.go: pkg/ruler/rules/rules.proto
1091 pkg/ring/kv/memberlist/kv.pb.go: pkg/ring/kv/memberlist/kv.proto
1092+pkg/scheduler/schedulerpb/scheduler.pb.go: pkg/scheduler/schedulerpb/scheduler.proto
1093+pkg/storegateway/storegatewaypb/gateway.pb.go: pkg/storegateway/storegatewaypb/gateway.proto
1094 pkg/chunk/grpc/grpc.pb.go: pkg/chunk/grpc/grpc.proto
1095 tools/blocksconvert/scheduler.pb.go: tools/blocksconvert/scheduler.proto
1096
1097@@ -81,10 +99,6 @@ build-image/$(UPTODATE): build-image/*
1098 SUDO := $(shell docker info >/dev/null 2>&1 || echo "sudo -E")
1099 BUILD_IN_CONTAINER := true
1100 BUILD_IMAGE ?= $(IMAGE_PREFIX)build-image
1101-# RM is parameterized to allow CircleCI to run builds, as it
1102-# currently disallows `docker run --rm`. This value is overridden
1103-# in circle.yml
1104-RM := --rm
1105 # TTY is parameterized to allow Google Cloud Builder to run builds,
1106 # as it currently disallows TTY devices. This value needs to be overridden
1107 # in any custom cloudbuild.yaml files
1108@@ -93,16 +107,16 @@ GO_FLAGS := -ldflags "-X main.Branch=$(GIT_BRANCH) -X main.Revision=$(GIT_REVISI
1109
1110 ifeq ($(BUILD_IN_CONTAINER),true)
1111
1112-GOVOLUMES= -v $(shell pwd)/.cache:/go/cache:delegated \
1113- -v $(shell pwd)/.pkg:/go/pkg:delegated \
1114- -v $(shell pwd):/go/src/github.com/cortexproject/cortex:delegated
1115+GOVOLUMES= -v $(shell pwd)/.cache:/go/cache:delegated,z \
1116+ -v $(shell pwd)/.pkg:/go/pkg:delegated,z \
1117+ -v $(shell pwd):/go/src/github.com/cortexproject/cortex:delegated,z
1118
1119 exes $(EXES) protos $(PROTO_GOS) lint test shell mod-check check-protos web-build web-pre web-deploy doc: build-image/$(UPTODATE)
1120 @mkdir -p $(shell pwd)/.pkg
1121 @mkdir -p $(shell pwd)/.cache
1122 @echo
1123 @echo ">>>> Entering build container: $@"
1124- @$(SUDO) time docker run $(RM) $(TTY) -i $(GOVOLUMES) $(BUILD_IMAGE) $@;
1125+ @$(SUDO) time docker run --rm $(TTY) -i $(GOVOLUMES) $(BUILD_IMAGE) $@;
1126
1127 configs-integration-test: build-image/$(UPTODATE)
1128 @mkdir -p $(shell pwd)/.pkg
1129@@ -110,14 +124,14 @@ configs-integration-test: build-image/$(UPTODATE)
1130 @DB_CONTAINER="$$(docker run -d -e 'POSTGRES_DB=configs_test' postgres:9.6.16)"; \
1131 echo ; \
1132 echo ">>>> Entering build container: $@"; \
1133- $(SUDO) docker run $(RM) $(TTY) -i $(GOVOLUMES) \
1134- -v $(shell pwd)/cmd/cortex/migrations:/migrations \
1135+ $(SUDO) docker run --rm $(TTY) -i $(GOVOLUMES) \
1136+ -v $(shell pwd)/cmd/cortex/migrations:/migrations:z \
1137 --workdir /go/src/github.com/cortexproject/cortex \
1138 --link "$$DB_CONTAINER":configs-db.cortex.local \
1139 -e DB_ADDR=configs-db.cortex.local \
1140 $(BUILD_IMAGE) $@; \
1141 status=$$?; \
1142- test -n "$(CIRCLECI)" || docker rm -f "$$DB_CONTAINER"; \
1143+ docker rm -f "$$DB_CONTAINER"; \
1144 exit $$status
1145
1146 else
1147@@ -141,12 +155,34 @@ lint:
1148 golangci-lint run
1149
1150 # Ensure no blacklisted package is imported.
1151- faillint -paths "github.com/bmizerany/assert=github.com/stretchr/testify/assert,\
1152+ GOFLAGS="-tags=requires_docker" faillint -paths "github.com/bmizerany/assert=github.com/stretchr/testify/assert,\
1153 golang.org/x/net/context=context,\
1154- sync/atomic=go.uber.org/atomic" ./pkg/... ./cmd/... ./tools/... ./integration/...
1155+ sync/atomic=go.uber.org/atomic,\
1156+ github.com/prometheus/client_golang/prometheus.{MultiError}=github.com/prometheus/prometheus/tsdb/errors.{NewMulti},\
1157+ github.com/weaveworks/common/user.{ExtractOrgID}=github.com/cortexproject/cortex/pkg/tenant.{TenantID,TenantIDs},\
1158+ github.com/weaveworks/common/user.{ExtractOrgIDFromHTTPRequest}=github.com/cortexproject/cortex/pkg/tenant.{ExtractTenantIDFromHTTPRequest}" ./pkg/... ./cmd/... ./tools/... ./integration/...
1159+
1160+ # Ensure clean pkg structure.
1161+ faillint -paths "\
1162+ github.com/cortexproject/cortex/pkg/scheduler,\
1163+ github.com/cortexproject/cortex/pkg/frontend,\
1164+ github.com/cortexproject/cortex/pkg/frontend/transport,\
1165+ github.com/cortexproject/cortex/pkg/frontend/v1,\
1166+ github.com/cortexproject/cortex/pkg/frontend/v2" \
1167+ ./pkg/querier/...
1168+ faillint -paths "github.com/cortexproject/cortex/pkg/querier/..." ./pkg/scheduler/...
1169+ faillint -paths "github.com/cortexproject/cortex/pkg/storage/tsdb/..." ./pkg/storage/bucket/...
1170+
1171+ # Ensure the query path is supporting multiple tenants
1172+ faillint -paths "\
1173+ github.com/cortexproject/cortex/pkg/tenant.{TenantID}=github.com/cortexproject/cortex/pkg/tenant.{TenantIDs}" \
1174+ ./pkg/scheduler/... \
1175+ ./pkg/frontend/... \
1176+ ./pkg/querier/tenantfederation/... \
1177+ ./pkg/querier/queryrange/...
1178
1179 # Validate Kubernetes spec files. Requires:
1180- # https://kubeval.instrumenta.dev
1181+ # https://kubeval.instrumenta.dev
1182 kubeval ./k8s/*
1183
1184 test:
1185@@ -230,7 +266,7 @@ check-white-noise: clean-white-noise
1186 @git diff --exit-code --quiet -- '*.md' || (echo "Please remove trailing whitespaces running 'make clean-white-noise'" && false)
1187
1188 web-serve:
1189- cd website && hugo --config config.toml -v server
1190+ cd website && hugo --config config.toml --minify -v server
1191
1192 # Generate binaries for a Cortex release
1193 dist dist/cortex-linux-amd64 dist/cortex-darwin-amd64 dist/query-tee-linux-amd64 dist/query-tee-darwin-amd64 dist/cortex-linux-amd64-sha-256 dist/cortex-darwin-amd64-sha-256 dist/query-tee-linux-amd64-sha-256 dist/query-tee-darwin-amd64-sha-256:
1194@@ -263,8 +299,8 @@ packages: dist/cortex-linux-amd64 packaging/fpm/$(UPTODATE)
1195 @mkdir -p $(shell pwd)/.pkg
1196 @mkdir -p $(shell pwd)/.cache
1197 @echo ">>>> Entering build container: $@"
1198- @$(SUDO) time docker run $(RM) $(TTY) \
1199- -v $(shell pwd):/src/github.com/cortexproject/cortex:delegated \
1200+ @$(SUDO) time docker run --rm $(TTY) \
1201+ -v $(shell pwd):/src/github.com/cortexproject/cortex:delegated,z \
1202 -i $(PACKAGE_IMAGE) $@;
1203
1204 else
1205diff --git a/Makefile.local.example b/Makefile.local.example
1206new file mode 100644
1207index 0000000..7faa0bb
1208--- /dev/null
1209+++ b/Makefile.local.example
1210@@ -0,0 +1,10 @@
1211+# Example of extending Makefile with Makefile.local.
1212+
1213+BUILD_IMAGE ?= quay.io/cortexproject/build-image
1214+IMAGE_PREFIX ?= custom-prefix/
1215+
1216+blocksconvert-push: cmd/blocksconvert/.uptodate
1217+ docker push $(IMAGE_PREFIX)blocksconvert:$(IMAGE_TAG)
1218+
1219+cortex-push: cmd/cortex/.uptodate
1220+ docker push $(IMAGE_PREFIX)cortex:$(IMAGE_TAG)
1221diff --git a/README.md b/README.md
1222index 8c2a360..e6f1db1 100644
1223--- a/README.md
1224+++ b/README.md
1225@@ -1,10 +1,9 @@
1226 <p align="center"><img src="images/logo.png" alt="Cortex Logo"></p>
1227
1228-[![Circle CI](https://circleci.com/gh/cortexproject/cortex/tree/master.svg?style=shield)](https://circleci.com/gh/cortexproject/cortex/tree/master)
1229+[![CI](https://github.com/cortexproject/cortex/workflows/ci/badge.svg)](https://github.com/cortexproject/cortex/actions)
1230 [![GoDoc](https://godoc.org/github.com/cortexproject/cortex?status.svg)](https://godoc.org/github.com/cortexproject/cortex)
1231 <a href="https://goreportcard.com/report/github.com/cortexproject/cortex"><img src="https://goreportcard.com/badge/github.com/cortexproject/cortex" alt="Go Report Card" /></a>
1232 <a href="https://cloud-native.slack.com/messages/cortex/"><img src="https://img.shields.io/badge/join%20slack-%23cortex-brightgreen.svg" alt="Slack" /></a>
1233-[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/cortexproject/cortex)](https://www.tickgit.com/browse?repo=github.com/cortexproject/cortex)
1234
1235 # Cortex: horizontally scalable, highly available, multi-tenant, long term storage for Prometheus.
1236
1237@@ -26,17 +25,34 @@ Read the [getting started guide](https://cortexmetrics.io/docs/getting-started)
1238 project. Before deploying Cortex with a permanent storage backend you
1239 should read:
1240 1. [An overview of Cortex's architecture](https://cortexmetrics.io/docs/architecture/)
1241-1. [A guide to running Cortex](https://cortexmetrics.io/docs/production/)
1242+1. [A guide to running Cortex](https://cortexmetrics.io/docs/guides/running-chunks-storage-in-production/)
1243 1. [Information regarding configuring Cortex](https://cortexmetrics.io/docs/configuration/arguments/)
1244-1. [Steps to run Cortex with Cassandra](https://cortexmetrics.io/docs/production/cassandra)
1245+1. [Steps to run Cortex with Cassandra](https://cortexmetrics.io/docs/guides/running-chunks-storage-with-cassandra/)
1246
1247 For a guide to contributing to Cortex, see the [contributor guidelines](https://cortexmetrics.io/docs/contributing/).
1248
1249 ## Further reading
1250
1251-To learn more about Cortex, consult the following documents & talks:
1252+To learn more about Cortex, consult the following talks and articles.
1253+
1254+### Recent talks and articles
1255+
1256+- Dec 2020 blog post "[How AWS and Grafana Labs are scaling Cortex for the cloud](https://aws.amazon.com/blogs/opensource/how-aws-and-grafana-labs-are-scaling-cortex-for-the-cloud/)
1257+- Oct 2020 blog post "[How to switch Cortex from chunks to blocks storage (and why you won’t look back)](https://grafana.com/blog/2020/10/19/how-to-switch-cortex-from-chunks-to-blocks-storage-and-why-you-wont-look-back/)"
1258+- Oct 2020 blog post "[Now GA: Cortex blocks storage for running Prometheus at scale with reduced operational complexity](https://grafana.com/blog/2020/10/06/now-ga-cortex-blocks-storage-for-running-prometheus-at-scale-with-reduced-operational-complexity/)"
1259+- Sep 2020 blog post "[A Tale of Tail Latencies](https://www.weave.works/blog/a-tale-of-tail-latencies)"
1260+- Sep 2020 KubeCon talk "Scaling Prometheus: How We Got Some Thanos Into Cortex" ([video](https://www.youtube.com/watch?v=Z5OJzRogAS4), [slides](https://static.sched.com/hosted_files/kccnceu20/ec/2020-08%20-%20KubeCon%20EU%20-%20Cortex%20blocks%20storage.pdf))
1261+- Aug 2020 blog post "[Scaling Prometheus: How we’re pushing Cortex blocks storage to its limit and beyond](https://grafana.com/blog/2020/08/12/scaling-prometheus-how-were-pushing-cortex-blocks-storage-to-its-limit-and-beyond/)"
1262+- Jul 2020 blog post "[How blocks storage in Cortex reduces operational complexity for running Prometheus at massive scale](https://grafana.com/blog/2020/07/29/how-blocks-storage-in-cortex-reduces-operational-complexity-for-running-prometheus-at-massive-scale/)"
1263+- Jul 2020 PromCon talk "Sharing is Caring: Leveraging Open Source to Improve Cortex & Thanos" ([video](https://www.youtube.com/watch?v=2oTLouUvsac), [slides](https://docs.google.com/presentation/d/1OuKYD7-k9Grb7unppYycdmVGWN0Bo0UwdJRySOoPdpg/edit))
1264+- Mar 2020 blog post "[Cortex: Zone Aware Replication](https://kenhaines.net/cortex-zone-aware-replication/)"
1265+- Mar 2020 blog post "[How we're using gossip to improve Cortex and Loki availability](https://grafana.com/blog/2020/03/25/how-were-using-gossip-to-improve-cortex-and-loki-availability/)"
1266+- Jan 2020 blog post "[The Future of Cortex: Into the Next Decade][future-of-cortex-blog]"
1267+
1268+[future-of-cortex-blog]: https://grafana.com/blog/2020/01/21/the-future-of-cortex-into-the-next-decade/
1269+
1270+### Previous talks and articles
1271
1272-- Jan 2020 Blog Post "[The Future of Cortex: Into the Next Decade][future-of-cortex-blog]"
1273 - Nov 2019 KubeCon talks "[Cortex 101: Horizontally Scalable Long Term Storage for Prometheus][kubecon-cortex-101]" ([video][kubecon-cortex-101-video], [slides][kubecon-cortex-101-slides]), "[Configuring Cortex for Max
1274 Performance][kubecon-cortex-201]" ([video][kubecon-cortex-201-video], [slides][kubecon-cortex-201-slides], [write up][kubecon-cortex-201-writeup]) and "[Blazin’ Fast PromQL][kubecon-blazin]" ([slides][kubecon-blazin-slides], [video][kubecon-blazin-video], [write up][kubecon-blazin-writeup])
1275 - Nov 2019 PromCon talk "[Two Households, Both Alike in Dignity: Cortex and Thanos][promcon-two-households]" ([video][promcon-two-households-video], [slides][promcon-two-households-slides], [write up][promcon-two-households-writeup])
1276@@ -56,7 +72,6 @@ Performance][kubecon-cortex-201]" ([video][kubecon-cortex-201-video], [slides][k
1277 - Aug 2016 PromCon talk; "Project Frankenstein: Multitenant, Scale-Out Prometheus": ([video][promcon-2016-video], [slides][promcon-2016-slides])
1278 - Jun 2016 design document; "[Project Frankenstein: A Multi Tenant, Scale Out Prometheus](http://goo.gl/prdUYV)"
1279
1280-[future-of-cortex-blog]: https://grafana.com/blog/2020/01/21/the-future-of-cortex-into-the-next-decade/
1281 [kubecon-cortex-101]: https://kccncna19.sched.com/event/UaiH/cortex-101-horizontally-scalable-long-term-storage-for-prometheus-chris-marchbanks-splunk
1282 [kubecon-cortex-101-video]: https://www.youtube.com/watch?v=f8GmbH0U_kI
1283 [kubecon-cortex-101-slides]: https://static.sched.com/hosted_files/kccncna19/92/cortex_101.pdf
1284@@ -142,3 +157,7 @@ in the [Weave Cloud documentation](https://www.weave.works/docs/cloud/latest/ove
1285 To use Cortex as part of Grafana Cloud, sign up for [Grafana Cloud](https://grafana.com/cloud)
1286 by clicking "Log In" in the top right and then "Sign Up Now". Cortex is included
1287 as part of the Starter and Basic Hosted Grafana plans.
1288+
1289+### Amazon Managed Service for Prometheus (AMP)
1290+
1291+[Amazon Managed Service for Prometheus (AMP)](https://aws.amazon.com/prometheus/) is a Prometheus-compatible monitoring service that makes it easy to monitor containerized applications at scale. It is a highly available, secure, and managed monitoring for your containers. Get started [here](https://console.aws.amazon.com/prometheus/home). To learn more about the AMP, reference our [documentation](https://docs.aws.amazon.com/prometheus/latest/userguide/what-is-Amazon-Managed-Service-Prometheus.html) and [Getting Started with AMP blog](https://aws.amazon.com/blogs/mt/getting-started-amazon-managed-service-for-prometheus/).
1292diff --git a/RELEASE.md b/RELEASE.md
1293index 07da8cb..a5767c3 100644
1294--- a/RELEASE.md
1295+++ b/RELEASE.md
1296@@ -20,7 +20,11 @@ Our goal is to provide a new minor release every 6 weeks. This is a new process
1297 | v1.2.0 | 2020-06-24 | Bryan Boreham |
1298 | v1.3.0 | 2020-08-03 | Marco Pracucci (@pracucci) |
1299 | v1.4.0 | 2020-09-14 | Marco Pracucci (@pracucci) |
1300-| v1.5.0 | 2020-10-26 | |
1301+| v1.5.0 | 2020-10-26 | Chris Marchbanks (@csmarchbanks) |
1302+| v1.6.0 | 2020-12-07 | Jacob Lisi (@jtlisi) |
1303+| v1.7.0 | 2021-01-18 | Ken Haines (@khaines) |
1304+| v1.8.0 | 2021-03-01 | Peter Ĺ tibranĂ˝ (@pstibrany) |
1305+| v1.9.0 | 2021-04-12 | Goutham Veeramachaneni (@gouthamve) |
1306
1307 ## Release shepherd responsibilities
1308
1309@@ -83,7 +87,7 @@ To publish a release candidate:
1310 1. Do not change the release branch directly; make a PR to the release-X.Y branch with VERSION and any CHANGELOG changes.
1311 1. Ensure the `VERSION` file has the `-rc.X` suffix (`X` starting from `0`)
1312 1. `git tag` the new release (see [How to tag a release](#how-to-tag-a-release))
1313-1. Wait until CI pipeline succeeded (once a tag is created, the release process through CircleCI will be triggered for this tag)
1314+1. Wait until CI pipeline succeeded (once a tag is created, the release process through GitHub actions will be triggered for this tag)
1315 1. Create a pre-release in GitHub
1316 - Write the release notes (including a copy-paste of the changelog)
1317 - Build binaries with `make dist` and attach them to the release
1318@@ -99,7 +103,7 @@ To publish a stable release:
1319 - Kubernetes manifests located at `k8s/`
1320 - Documentation located at `docs/`
1321 1. `git tag` the new release (see [How to tag a release](#how-to-tag-a-release))
1322-1. Wait until CI pipeline succeeded (once a tag is created, the release process through CircleCI will be triggered for this tag)
1323+1. Wait until CI pipeline succeeded (once a tag is created, the release process through GitHub actions will be triggered for this tag)
1324 1. Create a release in GitHub
1325 - Write the release notes (including a copy-paste of the changelog)
1326 - Build binaries with `make dist` and attach them to the release
1327diff --git a/SECURITY.md b/SECURITY.md
1328index a856e43..6f7b3ac 100644
1329--- a/SECURITY.md
1330+++ b/SECURITY.md
1331@@ -5,3 +5,82 @@ As with any complex system, it is certain that bugs will be found, some of them
1332 ## Public Disclosure Timing
1333
1334 The public disclosure date is agreed between the Cortex Team and the bug submitter. We prefer to fully disclose the bug as soon as possible, but only after a mitigation or fix is available. We will ask for delay if the bug or the fix is not yet fully understood or the solution is not tested to our standards yet. While there is no fixed timeframe for fix & disclosure, we will try our best to be quick and do not expect to need the usual 90 days most companies ask or. For a vulnerability with a straightforward mitigation, we expect report date to disclosure date to be on the order of 7 days.
1335+
1336+---------------------------
1337+
1338+## Private Vendors List
1339+
1340+We also have a list for vendors who provide Cortex to their users.
1341+This list is not intended for individuals to find out about security issues.
1342+
1343+### Embargo Policy
1344+
1345+The information members receive on cortex-vendors-announce@googlegroups.com
1346+must not be made public, shared, nor even hinted at anywhere
1347+beyond the need-to-know within your specific team except with the list's
1348+explicit approval. This holds true until the public disclosure date/time that was
1349+agreed upon by the list. Members of the list and others may not use the information
1350+ for anything other than getting the issue fixed for your respective vendor’s users.
1351+
1352+Before any information from the list is shared with respective members of your
1353+team required to fix said issue, they must agree to the same terms and only
1354+find out information on a need-to-know basis.
1355+
1356+In the unfortunate event you share the information beyond what is allowed by
1357+this policy, you _must_ urgently inform the cortex-team@googlegroups.com
1358+mailing list of exactly what information
1359+leaked and to whom. A retrospective will take place after the leak so
1360+we can assess how to not make the same mistake in the future.
1361+
1362+If you continue to leak information and break the policy outlined here, you
1363+will be removed from the list.
1364+
1365+### Contributing Back
1366+
1367+This is a team effort. As a member of the list you must carry some water. This
1368+could be in the form of the following:
1369+
1370+**Technical**
1371+
1372+- Review and/or test the proposed patches and point out potential issues with
1373+ them (such as incomplete fixes for the originally reported issues, additional
1374+ issues you might notice, and newly introduced bugs), and inform the list of the
1375+ work done even if no issues were encountered.
1376+
1377+**Administrative**
1378+
1379+- Help draft emails to the public disclosure mailing list.
1380+- Help with release notes.
1381+
1382+### Membership
1383+
1384+Group membership is managed by the Cortex maintainers using Google Groups.
1385+
1386+### Membership Criteria
1387+
1388+To be eligible for the cortex-vendors-announce@googlegroups.com mailing list, your
1389+company should:
1390+
1391+0. Have an actively monitored security email alias for our project.
1392+1. Have a public hosted version/distribution of Cortex.
1393+2. Have a user base not limited to your own organization.
1394+3. Not be a downstream or rebuild of another vendor.
1395+4. Be a participant and active contributor in the community.
1396+5. Accept the [Embargo Policy](#embargo-policy) that is outlined above.
1397+6. Be willing to [contribute back](#contributing-back) as outlined above.
1398+
1399+**Removal**: If your vendor stops meeting one or more of these criteria
1400+after joining the list then you will be unsubscribed.
1401+
1402+### Request to Join
1403+
1404+Please open an issue to the repo with the details to prove that you're eligible based on
1405+the above criteria. The team will review the application and will reach out to you in case
1406+of any clarifications. Once the application is accepted you'll be added to the mailing-list
1407+and also to the list below.
1408+
1409+### Members of the list
1410+
1411+Members of the list are listed below:
1412+- Cortex Maintainers
1413+- AWS Security Announce (email private)
1414diff --git a/VERSION b/VERSION
1415index 88c5fb8..bd8bf88 100644
1416--- a/VERSION
1417+++ b/VERSION
1418@@ -1 +1 @@
1419-1.4.0
1420+1.7.0
1421diff --git a/build-image/Dockerfile b/build-image/Dockerfile
1422index fcd001d..054d080 100644
1423--- a/build-image/Dockerfile
1424+++ b/build-image/Dockerfile
1425@@ -1,10 +1,10 @@
1426-FROM golang:1.14.9-stretch
1427+FROM golang:1.14.9-buster
1428 ARG goproxyValue
1429 ENV GOPROXY=${goproxyValue}
1430 RUN apt-get update && apt-get install -y curl python-requests python-yaml file jq unzip protobuf-compiler libprotobuf-dev && \
1431 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1432 RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
1433-RUN apt-get install -y nodejs npm && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1434+RUN apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1435
1436 # Install website builder dependencies. Whenever you change these version, please also change website/package.json
1437 # and viceversa.
1438diff --git a/cmd/blocksconvert/main.go b/cmd/blocksconvert/main.go
1439index 500f6e8..0bbb8e0 100644
1440--- a/cmd/blocksconvert/main.go
1441+++ b/cmd/blocksconvert/main.go
1442@@ -17,6 +17,7 @@ import (
1443 "github.com/cortexproject/cortex/pkg/util/services"
1444 "github.com/cortexproject/cortex/tools/blocksconvert"
1445 "github.com/cortexproject/cortex/tools/blocksconvert/builder"
1446+ "github.com/cortexproject/cortex/tools/blocksconvert/cleaner"
1447 "github.com/cortexproject/cortex/tools/blocksconvert/scanner"
1448 "github.com/cortexproject/cortex/tools/blocksconvert/scheduler"
1449 )
1450@@ -29,6 +30,7 @@ type Config struct {
1451 ScannerConfig scanner.Config
1452 BuilderConfig builder.Config
1453 SchedulerConfig scheduler.Config
1454+ CleanerConfig cleaner.Config
1455 }
1456
1457 func main() {
1458@@ -38,6 +40,7 @@ func main() {
1459 cfg.ScannerConfig.RegisterFlags(flag.CommandLine)
1460 cfg.BuilderConfig.RegisterFlags(flag.CommandLine)
1461 cfg.SchedulerConfig.RegisterFlags(flag.CommandLine)
1462+ cfg.CleanerConfig.RegisterFlags(flag.CommandLine)
1463 cfg.ServerConfig.RegisterFlags(flag.CommandLine)
1464 flag.Parse()
1465
1466@@ -62,6 +65,8 @@ func main() {
1467 targetService, err = builder.NewBuilder(cfg.BuilderConfig, cfg.SharedConfig, util.Logger, registry)
1468 case "scheduler":
1469 targetService, err = scheduler.NewScheduler(cfg.SchedulerConfig, cfg.SharedConfig, util.Logger, registry, serv.HTTP, serv.GRPC)
1470+ case "cleaner":
1471+ targetService, err = cleaner.NewCleaner(cfg.CleanerConfig, cfg.SharedConfig, util.Logger, registry)
1472 default:
1473 err = fmt.Errorf("unknown target")
1474 }
1475diff --git a/cmd/cortex/main.go b/cmd/cortex/main.go
1476index 8340e83..8955696 100644
1477--- a/cmd/cortex/main.go
1478+++ b/cmd/cortex/main.go
1479@@ -61,6 +61,8 @@ func main() {
1480 eventSampleRate int
1481 ballastBytes int
1482 mutexProfileFraction int
1483+ printVersion bool
1484+ printModules bool
1485 )
1486
1487 configFile, expandENV := parseConfigFileParameter(os.Args[1:])
1488@@ -86,6 +88,8 @@ func main() {
1489 flag.IntVar(&eventSampleRate, "event.sample-rate", 0, "How often to sample observability events (0 = never).")
1490 flag.IntVar(&ballastBytes, "mem-ballast-size-bytes", 0, "Size of memory ballast to allocate.")
1491 flag.IntVar(&mutexProfileFraction, "debug.mutex-profile-fraction", 0, "Fraction at which mutex profile vents will be reported, 0 to disable")
1492+ flag.BoolVar(&printVersion, "version", false, "Print Cortex version and exit.")
1493+ flag.BoolVar(&printModules, "modules", false, "List available values that can be used as target.")
1494
1495 usage := flag.CommandLine.Usage
1496 flag.CommandLine.Usage = func() { /* don't do anything by default, we will print usage ourselves, but only when requested. */ }
1497@@ -106,6 +110,11 @@ func main() {
1498 }
1499 }
1500
1501+ if printVersion {
1502+ fmt.Fprintln(os.Stdout, version.Print("Cortex"))
1503+ return
1504+ }
1505+
1506 // Validate the config once both the config file has been loaded
1507 // and CLI flags parsed.
1508 err = cfg.Validate(util.Logger)
1509@@ -118,7 +127,7 @@ func main() {
1510
1511 // Continue on if -modules flag is given. Code handling the
1512 // -modules flag will not start cortex.
1513- if testMode && !cfg.ListModules {
1514+ if testMode && !printModules {
1515 DumpYaml(&cfg)
1516 return
1517 }
1518@@ -137,8 +146,13 @@ func main() {
1519 // In testing mode skip JAEGER setup to avoid panic due to
1520 // "duplicate metrics collector registration attempted"
1521 if !testMode {
1522+ name := "cortex"
1523+ if len(cfg.Target) == 1 {
1524+ name += "-" + cfg.Target[0]
1525+ }
1526+
1527 // Setting the environment variable JAEGER_AGENT_HOST enables tracing.
1528- if trace, err := tracing.NewFromEnv("cortex-" + cfg.Target); err != nil {
1529+ if trace, err := tracing.NewFromEnv(name); err != nil {
1530 level.Error(util.Logger).Log("msg", "Failed to setup tracing", "err", err.Error())
1531 } else {
1532 defer trace.Close()
1533@@ -151,7 +165,7 @@ func main() {
1534 t, err := cortex.New(cfg)
1535 util.CheckFatal("initializing cortex", err)
1536
1537- if t.Cfg.ListModules {
1538+ if printModules {
1539 allDeps := t.ModuleManager.DependenciesForModule(cortex.All)
1540
1541 for _, m := range t.ModuleManager.UserVisibleModuleNames() {
1542@@ -167,12 +181,7 @@ func main() {
1543
1544 fmt.Fprintln(os.Stdout)
1545 fmt.Fprintln(os.Stdout, "Modules marked with * are included in target All.")
1546-
1547- // in test mode we cannot call os.Exit, it will stop to whole test process.
1548- if testMode {
1549- return
1550- }
1551- os.Exit(2)
1552+ return
1553 }
1554
1555 level.Info(util.Logger).Log("msg", "Starting Cortex", "version", version.Info())
1556diff --git a/cmd/cortex/main_test.go b/cmd/cortex/main_test.go
1557index e053f83..d5c5a14 100644
1558--- a/cmd/cortex/main_test.go
1559+++ b/cmd/cortex/main_test.go
1560@@ -80,6 +80,11 @@ func TestFlagParsing(t *testing.T) {
1561 stderrMessage: "the Querier configuration in YAML has been specified as an empty YAML node",
1562 },
1563
1564+ "version": {
1565+ arguments: []string{"-version"},
1566+ stdoutMessage: "Cortex, version",
1567+ },
1568+
1569 // we cannot test the happy path, as cortex would then fully start
1570 } {
1571 t.Run(name, func(t *testing.T) {
1572diff --git a/development/tsdb-blocks-storage-s3-gossip/.data-ingester-1/.gitignore b/development/tsdb-blocks-storage-s3-gossip/.data-ingester-1/.gitignore
1573new file mode 100644
1574index 0000000..d6b7ef3
1575--- /dev/null
1576+++ b/development/tsdb-blocks-storage-s3-gossip/.data-ingester-1/.gitignore
1577@@ -0,0 +1,2 @@
1578+*
1579+!.gitignore
1580diff --git a/development/tsdb-blocks-storage-s3-gossip/.data-ingester-2/.gitignore b/development/tsdb-blocks-storage-s3-gossip/.data-ingester-2/.gitignore
1581new file mode 100644
1582index 0000000..d6b7ef3
1583--- /dev/null
1584+++ b/development/tsdb-blocks-storage-s3-gossip/.data-ingester-2/.gitignore
1585@@ -0,0 +1,2 @@
1586+*
1587+!.gitignore
1588diff --git a/development/tsdb-blocks-storage-s3-gossip/.data-minio/.gitignore b/development/tsdb-blocks-storage-s3-gossip/.data-minio/.gitignore
1589new file mode 100644
1590index 0000000..521c201
1591--- /dev/null
1592+++ b/development/tsdb-blocks-storage-s3-gossip/.data-minio/.gitignore
1593@@ -0,0 +1,5 @@
1594+*
1595+!.gitignore
1596+!cortex-tsdb
1597+!cortex-alertmanager
1598+!cortex-ruler
1599diff --git a/development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-alertmanager/.gitignore b/development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-alertmanager/.gitignore
1600new file mode 100644
1601index 0000000..d6b7ef3
1602--- /dev/null
1603+++ b/development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-alertmanager/.gitignore
1604@@ -0,0 +1,2 @@
1605+*
1606+!.gitignore
1607diff --git a/development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-ruler/.gitignore b/development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-ruler/.gitignore
1608new file mode 100644
1609index 0000000..d6b7ef3
1610--- /dev/null
1611+++ b/development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-ruler/.gitignore
1612@@ -0,0 +1,2 @@
1613+*
1614+!.gitignore
1615diff --git a/development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-tsdb/.gitignore b/development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-tsdb/.gitignore
1616new file mode 100644
1617index 0000000..d6b7ef3
1618--- /dev/null
1619+++ b/development/tsdb-blocks-storage-s3-gossip/.data-minio/cortex-tsdb/.gitignore
1620@@ -0,0 +1,2 @@
1621+*
1622+!.gitignore
1623diff --git a/development/tsdb-blocks-storage-s3-gossip/.dockerignore b/development/tsdb-blocks-storage-s3-gossip/.dockerignore
1624new file mode 100644
1625index 0000000..085f68e
1626--- /dev/null
1627+++ b/development/tsdb-blocks-storage-s3-gossip/.dockerignore
1628@@ -0,0 +1,4 @@
1629+.data-configstore
1630+.data-ingester-1
1631+.data-ingester-2
1632+.data-minio
1633diff --git a/development/tsdb-blocks-storage-s3-gossip/.gitignore b/development/tsdb-blocks-storage-s3-gossip/.gitignore
1634new file mode 100644
1635index 0000000..ec09251
1636--- /dev/null
1637+++ b/development/tsdb-blocks-storage-s3-gossip/.gitignore
1638@@ -0,0 +1 @@
1639+cortex
1640\ No newline at end of file
1641diff --git a/development/tsdb-blocks-storage-s3-gossip/compose-down.sh b/development/tsdb-blocks-storage-s3-gossip/compose-down.sh
1642new file mode 100755
1643index 0000000..39f3730
1644--- /dev/null
1645+++ b/development/tsdb-blocks-storage-s3-gossip/compose-down.sh
1646@@ -0,0 +1,5 @@
1647+#!/bin/bash
1648+
1649+SCRIPT_DIR=$(cd `dirname $0` && pwd)
1650+
1651+docker-compose -f ${SCRIPT_DIR}/docker-compose.yml down
1652diff --git a/development/tsdb-blocks-storage-s3-gossip/compose-up.sh b/development/tsdb-blocks-storage-s3-gossip/compose-up.sh
1653new file mode 100755
1654index 0000000..7baee60
1655--- /dev/null
1656+++ b/development/tsdb-blocks-storage-s3-gossip/compose-up.sh
1657@@ -0,0 +1,10 @@
1658+#!/bin/bash
1659+
1660+set -e
1661+
1662+SCRIPT_DIR=$(cd `dirname $0` && pwd)
1663+
1664+# -gcflags "all=-N -l" disables optimizations that allow for better run with combination with Delve debugger.
1665+CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -gcflags "all=-N -l" -o ${SCRIPT_DIR}/cortex ${SCRIPT_DIR}/../../cmd/cortex
1666+docker-compose -f ${SCRIPT_DIR}/docker-compose.yml build distributor
1667+docker-compose -f ${SCRIPT_DIR}/docker-compose.yml up $@
1668diff --git a/development/tsdb-blocks-storage-s3-gossip/config/cortex.yaml b/development/tsdb-blocks-storage-s3-gossip/config/cortex.yaml
1669new file mode 100644
1670index 0000000..157082a
1671--- /dev/null
1672+++ b/development/tsdb-blocks-storage-s3-gossip/config/cortex.yaml
1673@@ -0,0 +1,143 @@
1674+auth_enabled: false
1675+
1676+distributor:
1677+ shard_by_all_labels: true
1678+ pool:
1679+ health_check_ingesters: true
1680+
1681+ingester_client:
1682+ grpc_client_config:
1683+ # Configure the client to allow messages up to 100MB.
1684+ max_recv_msg_size: 104857600
1685+ max_send_msg_size: 104857600
1686+ grpc_compression: gzip
1687+
1688+ingester:
1689+ lifecycler:
1690+ # We want to start immediately.
1691+ join_after: 0
1692+ final_sleep: 0s
1693+ num_tokens: 512
1694+
1695+ ring:
1696+ kvstore:
1697+ store: memberlist
1698+ replication_factor: 1
1699+
1700+memberlist:
1701+ message_history_buffer_bytes: 1048576
1702+ join_members:
1703+ - distributor:10001
1704+ - ingester-1:10002
1705+ - ingester-2:10003
1706+ - querier:10004
1707+ - compactor:10006
1708+ - store-gateway-1:10008
1709+ - store-gateway-2:10009
1710+ - ruler-1:10021
1711+ - ruler-2:10022
1712+ - querier-with-scheduler:10013
1713+ abort_if_cluster_join_fails: false
1714+
1715+querier:
1716+ query_ingesters_within: 3h
1717+
1718+ # Used when the blocks sharding is disabled.
1719+ store_gateway_addresses: store-gateway-1:9008,store-gateway-2:9009
1720+
1721+blocks_storage:
1722+ backend: s3
1723+
1724+ tsdb:
1725+ dir: /tmp/cortex-tsdb-ingester
1726+ ship_interval: 1m
1727+ block_ranges_period: [ 2h ]
1728+ retention_period: 3h
1729+
1730+ bucket_store:
1731+ sync_dir: /tmp/cortex-tsdb-querier
1732+ consistency_delay: 5s
1733+
1734+ index_cache:
1735+ backend: memcached
1736+ memcached:
1737+ addresses: dns+memcached:11211
1738+
1739+ chunks_cache:
1740+ backend: memcached
1741+ memcached:
1742+ addresses: dns+memcached:11211
1743+
1744+ metadata_cache:
1745+ backend: memcached
1746+ memcached:
1747+ addresses: dns+memcached:11211
1748+
1749+ s3:
1750+ endpoint: minio:9000
1751+ bucket_name: cortex-tsdb
1752+ access_key_id: cortex
1753+ secret_access_key: supersecret
1754+ insecure: true
1755+
1756+ruler:
1757+ enable_api: true
1758+ storage:
1759+ type: s3
1760+ s3:
1761+ bucketnames: cortex-ruler
1762+ s3forcepathstyle: true
1763+ s3: http://cortex:supersecret@minio.:9000
1764+ enable_sharding: true
1765+ ring:
1766+ heartbeat_period: 5s
1767+ heartbeat_timeout: 15s
1768+ kvstore:
1769+ store: memberlist
1770+
1771+alertmanager:
1772+ enable_api: true
1773+ storage:
1774+ type: s3
1775+ s3:
1776+ bucketnames: cortex-alertmanager
1777+ s3forcepathstyle: true
1778+ s3: http://cortex:supersecret@minio.:9000
1779+
1780+storage:
1781+ engine: blocks
1782+
1783+compactor:
1784+ compaction_interval: 30s
1785+ data_dir: /tmp/cortex-compactor
1786+ consistency_delay: 1m
1787+ sharding_enabled: true
1788+ sharding_ring:
1789+ kvstore:
1790+ store: memberlist
1791+
1792+store_gateway:
1793+ sharding_enabled: true
1794+ sharding_ring:
1795+ replication_factor: 1
1796+ heartbeat_period: 5s
1797+ heartbeat_timeout: 15s
1798+ kvstore:
1799+ store: memberlist
1800+
1801+frontend_worker:
1802+ frontend_address: "query-frontend:9007"
1803+ match_max_concurrent: true
1804+
1805+ # By setting scheduler_address, querier worker would use scheduler instead of frontend.
1806+ # scheduler_address: "query-scheduler:9012"
1807+
1808+query_range:
1809+ split_queries_by_interval: 24h
1810+
1811+limits:
1812+ # Limit max query time range to 31d
1813+ max_query_length: 744h
1814+
1815+runtime_config:
1816+ file: ./config/runtime.yaml
1817diff --git a/development/tsdb-blocks-storage-s3-gossip/config/grafana-agent.yaml b/development/tsdb-blocks-storage-s3-gossip/config/grafana-agent.yaml
1818new file mode 100644
1819index 0000000..164b409
1820--- /dev/null
1821+++ b/development/tsdb-blocks-storage-s3-gossip/config/grafana-agent.yaml
1822@@ -0,0 +1,64 @@
1823+server:
1824+ log_level: debug
1825+ http_listen_port: 9091
1826+
1827+prometheus:
1828+ global:
1829+ scrape_interval: 5s
1830+ external_labels:
1831+ scraped_by: grafana-agent
1832+ configs:
1833+ - name: local
1834+ host_filter: false
1835+ scrape_configs:
1836+ - job_name: tsdb-blocks-storage-s3/distributor
1837+ static_configs:
1838+ - targets: ['distributor:8001']
1839+ labels:
1840+ cluster: 'docker-compose'
1841+ namespace: 'tsdb-blocks-storage-s3'
1842+ - job_name: tsdb-blocks-storage-s3/ingester
1843+ static_configs:
1844+ - targets: ['ingester-1:8002', 'ingester-2:8003']
1845+ labels:
1846+ cluster: 'docker-compose'
1847+ namespace: 'tsdb-blocks-storage-s3'
1848+ - job_name: tsdb-blocks-storage-s3/querier
1849+ static_configs:
1850+ - targets: ['querier:8004', 'querier-with-scheduler:8013']
1851+ labels:
1852+ cluster: 'docker-compose'
1853+ namespace: 'tsdb-blocks-storage-s3'
1854+ - job_name: tsdb-blocks-storage-s3/ruler
1855+ static_configs:
1856+ - targets: ['ruler-1:8021', 'ruler-2:8022']
1857+ labels:
1858+ cluster: 'docker-compose'
1859+ namespace: 'tsdb-blocks-storage-s3'
1860+ - job_name: tsdb-blocks-storage-s3/compactor
1861+ static_configs:
1862+ - targets: ['compactor:8006']
1863+ labels:
1864+ cluster: 'docker-compose'
1865+ namespace: 'tsdb-blocks-storage-s3'
1866+ - job_name: tsdb-blocks-storage-s3/query-frontend
1867+ static_configs:
1868+ - targets: ['query-frontend:8007', 'query-frontend-with-scheduler:8012']
1869+ labels:
1870+ cluster: 'docker-compose'
1871+ namespace: 'tsdb-blocks-storage-s3'
1872+ - job_name: tsdb-blocks-storage-s3/store-gateway
1873+ static_configs:
1874+ - targets: ['store-gateway-1:8008', 'store-gateway-2:8009']
1875+ labels:
1876+ cluster: 'docker-compose'
1877+ namespace: 'tsdb-blocks-storage-s3'
1878+ - job_name: tsdb-blocks-storage-s3/query-scheduler
1879+ static_configs:
1880+ - targets: ['query-scheduler:8011']
1881+ labels:
1882+ cluster: 'docker-compose'
1883+ namespace: 'tsdb-blocks-storage-s3'
1884+
1885+ remote_write:
1886+ - url: http://distributor:8001/api/prom/push
1887diff --git a/development/tsdb-blocks-storage-s3-gossip/config/prometheus.yaml b/development/tsdb-blocks-storage-s3-gossip/config/prometheus.yaml
1888new file mode 100644
1889index 0000000..be12319
1890--- /dev/null
1891+++ b/development/tsdb-blocks-storage-s3-gossip/config/prometheus.yaml
1892@@ -0,0 +1,57 @@
1893+global:
1894+ scrape_interval: 5s
1895+ external_labels:
1896+ scraped_by: prometheus
1897+
1898+scrape_configs:
1899+ - job_name: tsdb-blocks-storage-s3/distributor
1900+ static_configs:
1901+ - targets: ['distributor:8001']
1902+ labels:
1903+ cluster: 'docker-compose'
1904+ namespace: 'tsdb-blocks-storage-s3'
1905+ - job_name: tsdb-blocks-storage-s3/ingester
1906+ static_configs:
1907+ - targets: ['ingester-1:8002', 'ingester-2:8003']
1908+ labels:
1909+ cluster: 'docker-compose'
1910+ namespace: 'tsdb-blocks-storage-s3'
1911+ - job_name: tsdb-blocks-storage-s3/querier
1912+ static_configs:
1913+ - targets: ['querier:8004', 'query-frontend-with-scheduler:8013']
1914+ labels:
1915+ cluster: 'docker-compose'
1916+ namespace: 'tsdb-blocks-storage-s3'
1917+ - job_name: tsdb-blocks-storage-s3/ruler
1918+ static_configs:
1919+ - targets: ['ruler-1:8021', 'ruler-2:8022']
1920+ labels:
1921+ cluster: 'docker-compose'
1922+ namespace: 'tsdb-blocks-storage-s3'
1923+ - job_name: tsdb-blocks-storage-s3/compactor
1924+ static_configs:
1925+ - targets: ['compactor:8006']
1926+ labels:
1927+ cluster: 'docker-compose'
1928+ namespace: 'tsdb-blocks-storage-s3'
1929+ - job_name: tsdb-blocks-storage-s3/query-frontend
1930+ static_configs:
1931+ - targets: ['query-frontend:8007', 'query-frontend-with-scheduler:8012']
1932+ labels:
1933+ cluster: 'docker-compose'
1934+ namespace: 'tsdb-blocks-storage-s3'
1935+ - job_name: tsdb-blocks-storage-s3/store-gateway
1936+ static_configs:
1937+ - targets: ['store-gateway-1:8008', 'store-gateway-2:8009']
1938+ labels:
1939+ cluster: 'docker-compose'
1940+ namespace: 'tsdb-blocks-storage-s3'
1941+ - job_name: tsdb-blocks-storage-s3/query-scheduler
1942+ static_configs:
1943+ - targets: ['query-scheduler:8011']
1944+ labels:
1945+ cluster: 'docker-compose'
1946+ namespace: 'tsdb-blocks-storage-s3'
1947+
1948+remote_write:
1949+ - url: http://distributor:8001/api/prom/push
1950diff --git a/development/tsdb-blocks-storage-s3-gossip/config/runtime.yaml b/development/tsdb-blocks-storage-s3-gossip/config/runtime.yaml
1951new file mode 100644
1952index 0000000..475c274
1953--- /dev/null
1954+++ b/development/tsdb-blocks-storage-s3-gossip/config/runtime.yaml
1955@@ -0,0 +1 @@
1956+# This file is left empty. It can be configured with overrides or other runtime config.
1957diff --git a/development/tsdb-blocks-storage-s3-gossip/dev.dockerfile b/development/tsdb-blocks-storage-s3-gossip/dev.dockerfile
1958new file mode 100644
1959index 0000000..ddeebf6
1960--- /dev/null
1961+++ b/development/tsdb-blocks-storage-s3-gossip/dev.dockerfile
1962@@ -0,0 +1,10 @@
1963+FROM golang:1.14
1964+ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
1965+RUN go get github.com/go-delve/delve/cmd/dlv
1966+
1967+FROM alpine:3.12
1968+
1969+RUN mkdir /cortex
1970+WORKDIR /cortex
1971+ADD ./cortex ./
1972+COPY --from=0 /go/bin/dlv ./
1973diff --git a/development/tsdb-blocks-storage-s3-gossip/docker-compose.yml b/development/tsdb-blocks-storage-s3-gossip/docker-compose.yml
1974new file mode 100644
1975index 0000000..73b5dfd
1976--- /dev/null
1977+++ b/development/tsdb-blocks-storage-s3-gossip/docker-compose.yml
1978@@ -0,0 +1,338 @@
1979+version: '3.4'
1980+services:
1981+
1982+ consul:
1983+ image: consul
1984+ command: [ "agent", "-dev" ,"-client=0.0.0.0", "-log-level=info" ]
1985+ ports:
1986+ - 8500:8500
1987+
1988+ minio:
1989+ image: minio/minio
1990+ command: [ "server", "/data" ]
1991+ environment:
1992+ - MINIO_ACCESS_KEY=cortex
1993+ - MINIO_SECRET_KEY=supersecret
1994+ ports:
1995+ - 9000:9000
1996+ volumes:
1997+ - .data-minio:/data:delegated
1998+
1999+ memcached:
2000+ image: memcached:1.6
2001+
2002+ prometheus:
2003+ image: prom/prometheus:v2.16.0
2004+ command: ["--config.file=/etc/prometheus/prometheus.yaml"]
2005+ volumes:
2006+ - ./config:/etc/prometheus
2007+ ports:
2008+ - 9090:9090
2009+
2010+ jaeger:
2011+ image: jaegertracing/all-in-one
2012+ ports:
2013+ - 16686:16686
2014+ - "14268"
2015+
2016+ # Scrape the metrics also with the Grafana agent (useful to test metadata ingestion
2017+ # until metadata remote write is not supported by Prometheus).
2018+ grafana-agent:
2019+ image: grafana/agent:v0.2.0
2020+ command: ["-config.file=/etc/agent-config/grafana-agent.yaml", "-prometheus.wal-directory=/tmp"]
2021+ volumes:
2022+ - ./config:/etc/agent-config
2023+ ports:
2024+ - 9091:9091
2025+
2026+ distributor:
2027+ build:
2028+ context: .
2029+ dockerfile: dev.dockerfile
2030+ image: cortex
2031+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18001 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=distributor -server.http-listen-port=8001 -server.grpc-listen-port=9001 -memberlist.nodename=distributor -memberlist.bind-port=10001 -log.level=debug"]
2032+ depends_on:
2033+ - consul
2034+ - minio
2035+ environment:
2036+ - JAEGER_AGENT_HOST=jaeger
2037+ - JAEGER_AGENT_PORT=6831
2038+ - JAEGER_TAGS=app=distributor
2039+ - JAEGER_SAMPLER_TYPE=const
2040+ - JAEGER_SAMPLER_PARAM=1
2041+ ports:
2042+ - 8001:8001
2043+ - 18001:18001
2044+ volumes:
2045+ - ./config:/cortex/config
2046+
2047+ ingester-1:
2048+ build:
2049+ context: .
2050+ dockerfile: dev.dockerfile
2051+ image: cortex
2052+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18002 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=ingester -server.http-listen-port=8002 -server.grpc-listen-port=9002 -memberlist.nodename=ingester-1 -memberlist.bind-port=10002"]
2053+ depends_on:
2054+ - consul
2055+ - minio
2056+ environment:
2057+ - JAEGER_AGENT_HOST=jaeger
2058+ - JAEGER_AGENT_PORT=6831
2059+ - JAEGER_TAGS=app=ingester-1
2060+ - JAEGER_SAMPLER_TYPE=const
2061+ - JAEGER_SAMPLER_PARAM=1
2062+ ports:
2063+ - 8002:8002
2064+ - 18002:18002
2065+ volumes:
2066+ - ./config:/cortex/config
2067+ - .data-ingester-1:/tmp/cortex-tsdb-ingester:delegated
2068+
2069+ ingester-2:
2070+ build:
2071+ context: .
2072+ dockerfile: dev.dockerfile
2073+ image: cortex
2074+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18003 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=ingester -server.http-listen-port=8003 -server.grpc-listen-port=9003 -memberlist.nodename=ingester-2 -memberlist.bind-port=10003"]
2075+ depends_on:
2076+ - consul
2077+ - minio
2078+ environment:
2079+ - JAEGER_AGENT_HOST=jaeger
2080+ - JAEGER_AGENT_PORT=6831
2081+ - JAEGER_TAGS=app=ingester-2
2082+ - JAEGER_SAMPLER_TYPE=const
2083+ - JAEGER_SAMPLER_PARAM=1
2084+ ports:
2085+ - 8003:8003
2086+ - 18003:18003
2087+ volumes:
2088+ - ./config:/cortex/config
2089+ - .data-ingester-2:/tmp/cortex-tsdb-ingester:delegated
2090+
2091+ querier:
2092+ build:
2093+ context: .
2094+ dockerfile: dev.dockerfile
2095+ image: cortex
2096+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18004 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=querier -server.http-listen-port=8004 -server.grpc-listen-port=9004 -memberlist.nodename=querier -memberlist.bind-port=10004"]
2097+ depends_on:
2098+ - consul
2099+ - minio
2100+ environment:
2101+ - JAEGER_AGENT_HOST=jaeger
2102+ - JAEGER_AGENT_PORT=6831
2103+ - JAEGER_TAGS=app=querier
2104+ - JAEGER_SAMPLER_TYPE=const
2105+ - JAEGER_SAMPLER_PARAM=1
2106+ ports:
2107+ - 8004:8004
2108+ - 18004:18004
2109+ volumes:
2110+ - ./config:/cortex/config
2111+
2112+ store-gateway-1:
2113+ build:
2114+ context: .
2115+ dockerfile: dev.dockerfile
2116+ image: cortex
2117+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18008 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=store-gateway -server.http-listen-port=8008 -server.grpc-listen-port=9008 -memberlist.nodename=store-gateway-1 -memberlist.bind-port=10008"]
2118+ depends_on:
2119+ - consul
2120+ - minio
2121+ environment:
2122+ - JAEGER_AGENT_HOST=jaeger
2123+ - JAEGER_AGENT_PORT=6831
2124+ - JAEGER_TAGS=app=store-gateway-1
2125+ - JAEGER_SAMPLER_TYPE=const
2126+ - JAEGER_SAMPLER_PARAM=1
2127+ ports:
2128+ - 8008:8008
2129+ - 18008:18008
2130+ volumes:
2131+ - ./config:/cortex/config
2132+
2133+ store-gateway-2:
2134+ build:
2135+ context: .
2136+ dockerfile: dev.dockerfile
2137+ image: cortex
2138+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18009 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=store-gateway -server.http-listen-port=8009 -server.grpc-listen-port=9009 -memberlist.nodename=store-gateway-2 -memberlist.bind-port=10009"]
2139+ depends_on:
2140+ - consul
2141+ - minio
2142+ environment:
2143+ - JAEGER_AGENT_HOST=jaeger
2144+ - JAEGER_AGENT_PORT=6831
2145+ - JAEGER_TAGS=app=store-gateway-2
2146+ - JAEGER_SAMPLER_TYPE=const
2147+ - JAEGER_SAMPLER_PARAM=1
2148+ ports:
2149+ - 8009:8009
2150+ - 18009:18009
2151+ volumes:
2152+ - ./config:/cortex/config
2153+
2154+ compactor:
2155+ build:
2156+ context: .
2157+ dockerfile: dev.dockerfile
2158+ image: cortex
2159+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18006 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=compactor -server.http-listen-port=8006 -server.grpc-listen-port=9006 -memberlist.nodename=compactor -memberlist.bind-port=10006"]
2160+ depends_on:
2161+ - consul
2162+ - minio
2163+ environment:
2164+ - JAEGER_AGENT_HOST=jaeger
2165+ - JAEGER_AGENT_PORT=6831
2166+ - JAEGER_TAGS=app=compactor
2167+ - JAEGER_SAMPLER_TYPE=const
2168+ - JAEGER_SAMPLER_PARAM=1
2169+ ports:
2170+ - 8006:8006
2171+ - 18006:18006
2172+ volumes:
2173+ - ./config:/cortex/config
2174+
2175+ query-frontend:
2176+ build:
2177+ context: .
2178+ dockerfile: dev.dockerfile
2179+ image: cortex
2180+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18007 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=query-frontend -server.http-listen-port=8007 -server.grpc-listen-port=9007 -store.max-query-length=8760h"]
2181+ depends_on:
2182+ - consul
2183+ - minio
2184+ environment:
2185+ - JAEGER_AGENT_HOST=jaeger
2186+ - JAEGER_AGENT_PORT=6831
2187+ - JAEGER_TAGS=app=query-frontend
2188+ - JAEGER_SAMPLER_TYPE=const
2189+ - JAEGER_SAMPLER_PARAM=1
2190+ ports:
2191+ - 8007:8007
2192+ - 18007:18007
2193+ volumes:
2194+ - ./config:/cortex/config
2195+
2196+ alertmanager:
2197+ build:
2198+ context: .
2199+ dockerfile: dev.dockerfile
2200+ image: cortex
2201+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18010 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=alertmanager -server.http-listen-port=8010 -server.grpc-listen-port=9010 -alertmanager.web.external-url=localhost:8010"]
2202+ depends_on:
2203+ - consul
2204+ - minio
2205+ ports:
2206+ - 8010:8010
2207+ - 18010:18010
2208+ volumes:
2209+ - ./config:/cortex/config
2210+
2211+ ruler-1:
2212+ build:
2213+ context: .
2214+ dockerfile: dev.dockerfile
2215+ image: cortex
2216+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18021 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=ruler -server.http-listen-port=8021 -server.grpc-listen-port=9021 -memberlist.nodename=ruler-1 -memberlist.bind-port=10021"]
2217+ depends_on:
2218+ - consul
2219+ - minio
2220+ environment:
2221+ - JAEGER_AGENT_HOST=jaeger
2222+ - JAEGER_AGENT_PORT=6831
2223+ - JAEGER_TAGS=app=ruler-1
2224+ - JAEGER_SAMPLER_TYPE=const
2225+ - JAEGER_SAMPLER_PARAM=1
2226+ ports:
2227+ - 8021:8021
2228+ - 18021:18021
2229+ volumes:
2230+ - ./config:/cortex/config
2231+
2232+ ruler-2:
2233+ build:
2234+ context: .
2235+ dockerfile: dev.dockerfile
2236+ image: cortex
2237+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18022 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=ruler -server.http-listen-port=8022 -server.grpc-listen-port=9022 -memberlist.nodename=ruler-2 -memberlist.bind-port=10022"]
2238+ depends_on:
2239+ - consul
2240+ - minio
2241+ environment:
2242+ - JAEGER_AGENT_HOST=jaeger
2243+ - JAEGER_AGENT_PORT=6831
2244+ - JAEGER_TAGS=app=ruler-2
2245+ - JAEGER_SAMPLER_TYPE=const
2246+ - JAEGER_SAMPLER_PARAM=1
2247+ ports:
2248+ - 8022:8022
2249+ - 18022:18022
2250+ volumes:
2251+ - ./config:/cortex/config
2252+
2253+ query-scheduler:
2254+ build:
2255+ context: .
2256+ dockerfile: dev.dockerfile
2257+ image: cortex
2258+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18011 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=query-scheduler -server.http-listen-port=8011 -server.grpc-listen-port=9011 -store.max-query-length=8760h -log.level=debug"]
2259+ depends_on:
2260+ - consul
2261+ - minio
2262+ environment:
2263+ - JAEGER_AGENT_HOST=jaeger
2264+ - JAEGER_AGENT_PORT=6831
2265+ - JAEGER_TAGS=app=query-scheduler
2266+ - JAEGER_SAMPLER_TYPE=const
2267+ - JAEGER_SAMPLER_PARAM=1
2268+ ports:
2269+ - 8011:8011
2270+ - 18011:18011
2271+ volumes:
2272+ - ./config:/cortex/config
2273+
2274+ # This frontend uses query-scheduler, activated by `-frontend.scheduler-address` option.
2275+ query-frontend-with-scheduler:
2276+ build:
2277+ context: .
2278+ dockerfile: dev.dockerfile
2279+ image: cortex
2280+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18012 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=query-frontend -server.http-listen-port=8012 -server.grpc-listen-port=9012 -store.max-query-length=8760h -frontend.scheduler-address=query-scheduler:9011 -log.level=debug"]
2281+ depends_on:
2282+ - consul
2283+ - minio
2284+ environment:
2285+ - JAEGER_AGENT_HOST=jaeger
2286+ - JAEGER_AGENT_PORT=6831
2287+ - JAEGER_TAGS=app=query-frontend2
2288+ - JAEGER_SAMPLER_TYPE=const
2289+ - JAEGER_SAMPLER_PARAM=1
2290+ ports:
2291+ - 8012:8012
2292+ - 18012:18012
2293+ volumes:
2294+ - ./config:/cortex/config
2295+
2296+ # This querier is connecting to query-scheduler, instead of query-frontend. This is achieved by setting -querier.scheduler-address="..."
2297+ querier-with-scheduler:
2298+ build:
2299+ context: .
2300+ dockerfile: dev.dockerfile
2301+ image: cortex
2302+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18013 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=querier -server.http-listen-port=8013 -server.grpc-listen-port=9013 -querier.scheduler-address=query-scheduler:9011 -querier.frontend-address= -log.level=debug -memberlist.nodename=querier-with-scheduler -memberlist.bind-port=10013"]
2303+ depends_on:
2304+ - consul
2305+ - minio
2306+ environment:
2307+ - JAEGER_AGENT_HOST=jaeger
2308+ - JAEGER_AGENT_PORT=6831
2309+ - JAEGER_TAGS=app=querier-scheduler
2310+ - JAEGER_SAMPLER_TYPE=const
2311+ - JAEGER_SAMPLER_PARAM=1
2312+ ports:
2313+ - 8013:8013
2314+ - 18013:18013
2315+ volumes:
2316+ - ./config:/cortex/config
2317diff --git a/development/tsdb-blocks-storage-s3-single-binary/config/cortex.yaml b/development/tsdb-blocks-storage-s3-single-binary/config/cortex.yaml
2318index a9e1970..bbe4cc4 100644
2319--- a/development/tsdb-blocks-storage-s3-single-binary/config/cortex.yaml
2320+++ b/development/tsdb-blocks-storage-s3-single-binary/config/cortex.yaml
2321@@ -75,3 +75,6 @@ ruler:
2322 store: consul
2323 consul:
2324 host: consul:8500
2325+
2326+runtime_config:
2327+ file: ./config/runtime.yaml
2328diff --git a/development/tsdb-blocks-storage-s3-single-binary/config/runtime.yaml b/development/tsdb-blocks-storage-s3-single-binary/config/runtime.yaml
2329new file mode 100644
2330index 0000000..475c274
2331--- /dev/null
2332+++ b/development/tsdb-blocks-storage-s3-single-binary/config/runtime.yaml
2333@@ -0,0 +1 @@
2334+# This file is left empty. It can be configured with overrides or other runtime config.
2335diff --git a/development/tsdb-blocks-storage-s3/.data-configstore/api/prom/configs/rules b/development/tsdb-blocks-storage-s3/.data-configstore/api/prom/configs/rules
2336deleted file mode 100644
2337index fa6bcd3..0000000
2338--- a/development/tsdb-blocks-storage-s3/.data-configstore/api/prom/configs/rules
2339+++ /dev/null
2340@@ -1,14 +0,0 @@
2341-{
2342- "since": 2,
2343- "configs": {
2344- "fake": {
2345- "id": 1,
2346- "config": {
2347- "rule_format_version": "2",
2348- "rules_files": {
2349- "test": "groups:\n - name: group-1\n rules:\n - record: avalanche_metric_mmmmm_0_0:count\n expr: count(avalanche_metric_mmmmm_0_0)\n - name: group-2\n rules:\n - record: avalanche_metric_mmmmm_0:count\n expr: |\n count(avalanche_metric_mmmmm_0_0) +\n count(avalanche_metric_mmmmm_0_1)\n - alert: alert-1\n expr: |\n count(avalanche_metric_mmmmm_0_0) > 1000\n - alert: alert-2\n expr: count(avalanche_metric_mmmmm_0_0) > 100\n for: 5m\n labels:\n label1: value1\n label2: value2\n annotations:\n annotation1: value1\n annotation2: value2\n"
2350- }
2351- }
2352- }
2353- }
2354-}
2355diff --git a/development/tsdb-blocks-storage-s3/.data-configstore/api/prom/configs/rules.yaml b/development/tsdb-blocks-storage-s3/.data-configstore/api/prom/configs/rules.yaml
2356deleted file mode 100644
2357index 3fd54ff..0000000
2358--- a/development/tsdb-blocks-storage-s3/.data-configstore/api/prom/configs/rules.yaml
2359+++ /dev/null
2360@@ -1,23 +0,0 @@
2361-groups:
2362- - name: group-1
2363- rules:
2364- - record: avalanche_metric_mmmmm_0_0:count
2365- expr: count(avalanche_metric_mmmmm_0_0)
2366- - name: group-2
2367- rules:
2368- - record: avalanche_metric_mmmmm_0:count
2369- expr: |
2370- count(avalanche_metric_mmmmm_0_0) +
2371- count(avalanche_metric_mmmmm_0_1)
2372- - alert: alert-1
2373- expr: |
2374- count(avalanche_metric_mmmmm_0_0) > 1000
2375- - alert: alert-2
2376- expr: count(avalanche_metric_mmmmm_0_0) > 100
2377- for: 5m
2378- labels:
2379- label1: value1
2380- label2: value2
2381- annotations:
2382- annotation1: value1
2383- annotation2: value2
2384diff --git a/development/tsdb-blocks-storage-s3/.data-minio/.gitignore b/development/tsdb-blocks-storage-s3/.data-minio/.gitignore
2385index f8872cf..521c201 100644
2386--- a/development/tsdb-blocks-storage-s3/.data-minio/.gitignore
2387+++ b/development/tsdb-blocks-storage-s3/.data-minio/.gitignore
2388@@ -2,3 +2,4 @@
2389 !.gitignore
2390 !cortex-tsdb
2391 !cortex-alertmanager
2392+!cortex-ruler
2393diff --git a/development/tsdb-blocks-storage-s3/.data-minio/cortex-ruler/.gitignore b/development/tsdb-blocks-storage-s3/.data-minio/cortex-ruler/.gitignore
2394new file mode 100644
2395index 0000000..d6b7ef3
2396--- /dev/null
2397+++ b/development/tsdb-blocks-storage-s3/.data-minio/cortex-ruler/.gitignore
2398@@ -0,0 +1,2 @@
2399+*
2400+!.gitignore
2401diff --git a/development/tsdb-blocks-storage-s3/config/cortex.yaml b/development/tsdb-blocks-storage-s3/config/cortex.yaml
2402index 3a57de2..bf5e147 100644
2403--- a/development/tsdb-blocks-storage-s3/config/cortex.yaml
2404+++ b/development/tsdb-blocks-storage-s3/config/cortex.yaml
2405@@ -70,9 +70,19 @@ blocks_storage:
2406 ruler:
2407 enable_api: true
2408 storage:
2409- type: configdb
2410- configdb:
2411- configs_api_url: http://configstore:80/
2412+ type: s3
2413+ s3:
2414+ bucketnames: cortex-ruler
2415+ s3forcepathstyle: true
2416+ s3: http://cortex:supersecret@minio.:9000
2417+ enable_sharding: true
2418+ ring:
2419+ heartbeat_period: 5s
2420+ heartbeat_timeout: 15s
2421+ kvstore:
2422+ store: consul
2423+ consul:
2424+ host: consul:8500
2425
2426 alertmanager:
2427 enable_api: true
2428@@ -91,6 +101,8 @@ compactor:
2429 data_dir: /tmp/cortex-compactor
2430 consistency_delay: 1m
2431 sharding_enabled: true
2432+ cleanup_interval: 1m
2433+ tenant_cleanup_delay: 1m
2434 sharding_ring:
2435 kvstore:
2436 store: consul
2437@@ -108,8 +120,15 @@ store_gateway:
2438 consul:
2439 host: consul:8500
2440
2441+frontend:
2442+ query_stats_enabled: true
2443+
2444 frontend_worker:
2445 frontend_address: "query-frontend:9007"
2446+ match_max_concurrent: true
2447+
2448+ # By setting scheduler_address, querier worker would use scheduler instead of frontend.
2449+ # scheduler_address: "query-scheduler:9012"
2450
2451 query_range:
2452 split_queries_by_interval: 24h
2453@@ -117,3 +136,6 @@ query_range:
2454 limits:
2455 # Limit max query time range to 31d
2456 max_query_length: 744h
2457+
2458+runtime_config:
2459+ file: ./config/runtime.yaml
2460diff --git a/development/tsdb-blocks-storage-s3/config/grafana-agent.yaml b/development/tsdb-blocks-storage-s3/config/grafana-agent.yaml
2461index 9b62fdf..164b409 100644
2462--- a/development/tsdb-blocks-storage-s3/config/grafana-agent.yaml
2463+++ b/development/tsdb-blocks-storage-s3/config/grafana-agent.yaml
2464@@ -25,13 +25,13 @@ prometheus:
2465 namespace: 'tsdb-blocks-storage-s3'
2466 - job_name: tsdb-blocks-storage-s3/querier
2467 static_configs:
2468- - targets: ['querier:8004']
2469+ - targets: ['querier:8004', 'querier-with-scheduler:8013']
2470 labels:
2471 cluster: 'docker-compose'
2472 namespace: 'tsdb-blocks-storage-s3'
2473 - job_name: tsdb-blocks-storage-s3/ruler
2474 static_configs:
2475- - targets: ['ruler:8005']
2476+ - targets: ['ruler-1:8021', 'ruler-2:8022']
2477 labels:
2478 cluster: 'docker-compose'
2479 namespace: 'tsdb-blocks-storage-s3'
2480@@ -43,7 +43,7 @@ prometheus:
2481 namespace: 'tsdb-blocks-storage-s3'
2482 - job_name: tsdb-blocks-storage-s3/query-frontend
2483 static_configs:
2484- - targets: ['query-frontend:8007']
2485+ - targets: ['query-frontend:8007', 'query-frontend-with-scheduler:8012']
2486 labels:
2487 cluster: 'docker-compose'
2488 namespace: 'tsdb-blocks-storage-s3'
2489@@ -53,6 +53,12 @@ prometheus:
2490 labels:
2491 cluster: 'docker-compose'
2492 namespace: 'tsdb-blocks-storage-s3'
2493+ - job_name: tsdb-blocks-storage-s3/query-scheduler
2494+ static_configs:
2495+ - targets: ['query-scheduler:8011']
2496+ labels:
2497+ cluster: 'docker-compose'
2498+ namespace: 'tsdb-blocks-storage-s3'
2499
2500 remote_write:
2501 - url: http://distributor:8001/api/prom/push
2502diff --git a/development/tsdb-blocks-storage-s3/config/prometheus.yaml b/development/tsdb-blocks-storage-s3/config/prometheus.yaml
2503index ffd1c68..be12319 100644
2504--- a/development/tsdb-blocks-storage-s3/config/prometheus.yaml
2505+++ b/development/tsdb-blocks-storage-s3/config/prometheus.yaml
2506@@ -18,13 +18,13 @@ scrape_configs:
2507 namespace: 'tsdb-blocks-storage-s3'
2508 - job_name: tsdb-blocks-storage-s3/querier
2509 static_configs:
2510- - targets: ['querier:8004']
2511+ - targets: ['querier:8004', 'query-frontend-with-scheduler:8013']
2512 labels:
2513 cluster: 'docker-compose'
2514 namespace: 'tsdb-blocks-storage-s3'
2515 - job_name: tsdb-blocks-storage-s3/ruler
2516 static_configs:
2517- - targets: ['ruler:8005']
2518+ - targets: ['ruler-1:8021', 'ruler-2:8022']
2519 labels:
2520 cluster: 'docker-compose'
2521 namespace: 'tsdb-blocks-storage-s3'
2522@@ -36,7 +36,7 @@ scrape_configs:
2523 namespace: 'tsdb-blocks-storage-s3'
2524 - job_name: tsdb-blocks-storage-s3/query-frontend
2525 static_configs:
2526- - targets: ['query-frontend:8007']
2527+ - targets: ['query-frontend:8007', 'query-frontend-with-scheduler:8012']
2528 labels:
2529 cluster: 'docker-compose'
2530 namespace: 'tsdb-blocks-storage-s3'
2531@@ -46,6 +46,12 @@ scrape_configs:
2532 labels:
2533 cluster: 'docker-compose'
2534 namespace: 'tsdb-blocks-storage-s3'
2535+ - job_name: tsdb-blocks-storage-s3/query-scheduler
2536+ static_configs:
2537+ - targets: ['query-scheduler:8011']
2538+ labels:
2539+ cluster: 'docker-compose'
2540+ namespace: 'tsdb-blocks-storage-s3'
2541
2542 remote_write:
2543 - url: http://distributor:8001/api/prom/push
2544diff --git a/development/tsdb-blocks-storage-s3/config/runtime.yaml b/development/tsdb-blocks-storage-s3/config/runtime.yaml
2545new file mode 100644
2546index 0000000..475c274
2547--- /dev/null
2548+++ b/development/tsdb-blocks-storage-s3/config/runtime.yaml
2549@@ -0,0 +1 @@
2550+# This file is left empty. It can be configured with overrides or other runtime config.
2551diff --git a/development/tsdb-blocks-storage-s3/docker-compose.yml b/development/tsdb-blocks-storage-s3/docker-compose.yml
2552index 9575fc4..87a4924 100644
2553--- a/development/tsdb-blocks-storage-s3/docker-compose.yml
2554+++ b/development/tsdb-blocks-storage-s3/docker-compose.yml
2555@@ -21,11 +21,6 @@ services:
2556 memcached:
2557 image: memcached:1.6
2558
2559- configstore:
2560- image: nginx
2561- volumes:
2562- - .data-configstore:/usr/share/nginx/html/private:ro
2563-
2564 prometheus:
2565 image: prom/prometheus:v2.16.0
2566 command: ["--config.file=/etc/prometheus/prometheus.yaml"]
2567@@ -178,80 +173,187 @@ services:
2568 volumes:
2569 - ./config:/cortex/config
2570
2571- ruler:
2572+ compactor:
2573 build:
2574 context: .
2575 dockerfile: dev.dockerfile
2576 image: cortex
2577- command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18005 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=ruler -server.http-listen-port=8005 -server.grpc-listen-port=9005"]
2578+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18006 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=compactor -server.http-listen-port=8006 -server.grpc-listen-port=9006"]
2579 depends_on:
2580 - consul
2581 - minio
2582 environment:
2583 - JAEGER_AGENT_HOST=jaeger
2584 - JAEGER_AGENT_PORT=6831
2585- - JAEGER_TAGS=app=ruler
2586+ - JAEGER_TAGS=app=compactor
2587 - JAEGER_SAMPLER_TYPE=const
2588 - JAEGER_SAMPLER_PARAM=1
2589 ports:
2590- - 8005:8005
2591- - 18005:18005
2592+ - 8006:8006
2593+ - 18006:18006
2594 volumes:
2595 - ./config:/cortex/config
2596
2597- compactor:
2598+ query-frontend:
2599 build:
2600 context: .
2601 dockerfile: dev.dockerfile
2602 image: cortex
2603- command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18006 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=compactor -server.http-listen-port=8006 -server.grpc-listen-port=9006"]
2604+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18007 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=query-frontend -server.http-listen-port=8007 -server.grpc-listen-port=9007 -store.max-query-length=8760h"]
2605 depends_on:
2606 - consul
2607 - minio
2608 environment:
2609 - JAEGER_AGENT_HOST=jaeger
2610 - JAEGER_AGENT_PORT=6831
2611- - JAEGER_TAGS=app=compactor
2612+ - JAEGER_TAGS=app=query-frontend
2613 - JAEGER_SAMPLER_TYPE=const
2614 - JAEGER_SAMPLER_PARAM=1
2615 ports:
2616- - 8006:8006
2617- - 18006:18006
2618+ - 8007:8007
2619+ - 18007:18007
2620 volumes:
2621 - ./config:/cortex/config
2622
2623- query-frontend:
2624+ alertmanager:
2625 build:
2626 context: .
2627 dockerfile: dev.dockerfile
2628 image: cortex
2629- command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18007 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=query-frontend -server.http-listen-port=8007 -server.grpc-listen-port=9007 -store.max-query-length=8760h"]
2630+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18010 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=alertmanager -server.http-listen-port=8010 -server.grpc-listen-port=9010 -alertmanager.web.external-url=localhost:8010"]
2631+ depends_on:
2632+ - consul
2633+ - minio
2634+ ports:
2635+ - 8010:8010
2636+ - 18010:18010
2637+ volumes:
2638+ - ./config:/cortex/config
2639+
2640+ ruler-1:
2641+ build:
2642+ context: .
2643+ dockerfile: dev.dockerfile
2644+ image: cortex
2645+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18021 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=ruler -server.http-listen-port=8021 -server.grpc-listen-port=9021"]
2646 depends_on:
2647 - consul
2648 - minio
2649 environment:
2650 - JAEGER_AGENT_HOST=jaeger
2651 - JAEGER_AGENT_PORT=6831
2652- - JAEGER_TAGS=app=query-frontend
2653+ - JAEGER_TAGS=app=ruler-1
2654 - JAEGER_SAMPLER_TYPE=const
2655 - JAEGER_SAMPLER_PARAM=1
2656 ports:
2657- - 8007:8007
2658- - 18007:18007
2659+ - 8021:8021
2660+ - 18021:18021
2661 volumes:
2662 - ./config:/cortex/config
2663
2664- alertmanager:
2665+ ruler-2:
2666 build:
2667 context: .
2668 dockerfile: dev.dockerfile
2669 image: cortex
2670- command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18010 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=alertmanager -server.http-listen-port=8010 -server.grpc-listen-port=9010"]
2671+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18022 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=ruler -server.http-listen-port=8022 -server.grpc-listen-port=9022"]
2672 depends_on:
2673 - consul
2674 - minio
2675+ environment:
2676+ - JAEGER_AGENT_HOST=jaeger
2677+ - JAEGER_AGENT_PORT=6831
2678+ - JAEGER_TAGS=app=ruler-2
2679+ - JAEGER_SAMPLER_TYPE=const
2680+ - JAEGER_SAMPLER_PARAM=1
2681 ports:
2682- - 8010:8010
2683- - 18010:18010
2684+ - 8022:8022
2685+ - 18022:18022
2686+ volumes:
2687+ - ./config:/cortex/config
2688+
2689+ query-scheduler:
2690+ build:
2691+ context: .
2692+ dockerfile: dev.dockerfile
2693+ image: cortex
2694+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18011 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=query-scheduler -server.http-listen-port=8011 -server.grpc-listen-port=9011 -store.max-query-length=8760h"]
2695+ depends_on:
2696+ - consul
2697+ - minio
2698+ environment:
2699+ - JAEGER_AGENT_HOST=jaeger
2700+ - JAEGER_AGENT_PORT=6831
2701+ - JAEGER_TAGS=app=query-scheduler
2702+ - JAEGER_SAMPLER_TYPE=const
2703+ - JAEGER_SAMPLER_PARAM=1
2704+ ports:
2705+ - 8011:8011
2706+ - 18011:18011
2707+ volumes:
2708+ - ./config:/cortex/config
2709+
2710+ # This frontend uses query-scheduler, activated by `-frontend.scheduler-address` option.
2711+ query-frontend-with-scheduler:
2712+ build:
2713+ context: .
2714+ dockerfile: dev.dockerfile
2715+ image: cortex
2716+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18012 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=query-frontend -server.http-listen-port=8012 -server.grpc-listen-port=9012 -store.max-query-length=8760h -frontend.scheduler-address=query-scheduler:9011"]
2717+ depends_on:
2718+ - consul
2719+ - minio
2720+ environment:
2721+ - JAEGER_AGENT_HOST=jaeger
2722+ - JAEGER_AGENT_PORT=6831
2723+ - JAEGER_TAGS=app=query-frontend2
2724+ - JAEGER_SAMPLER_TYPE=const
2725+ - JAEGER_SAMPLER_PARAM=1
2726+ ports:
2727+ - 8012:8012
2728+ - 18012:18012
2729+ volumes:
2730+ - ./config:/cortex/config
2731+
2732+ # This querier is connecting to query-scheduler, instead of query-frontend. This is achieved by setting -querier.scheduler-address="..."
2733+ querier-with-scheduler:
2734+ build:
2735+ context: .
2736+ dockerfile: dev.dockerfile
2737+ image: cortex
2738+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18013 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=querier -server.http-listen-port=8013 -server.grpc-listen-port=9013 -querier.scheduler-address=query-scheduler:9011 -querier.frontend-address="]
2739+ depends_on:
2740+ - consul
2741+ - minio
2742+ environment:
2743+ - JAEGER_AGENT_HOST=jaeger
2744+ - JAEGER_AGENT_PORT=6831
2745+ - JAEGER_TAGS=app=querier-scheduler
2746+ - JAEGER_SAMPLER_TYPE=const
2747+ - JAEGER_SAMPLER_PARAM=1
2748+ ports:
2749+ - 8013:8013
2750+ - 18013:18013
2751+ volumes:
2752+ - ./config:/cortex/config
2753+
2754+ purger:
2755+ build:
2756+ context: .
2757+ dockerfile: dev.dockerfile
2758+ image: cortex
2759+ command: ["sh", "-c", "sleep 3 && exec ./dlv exec ./cortex --listen=:18014 --headless=true --api-version=2 --accept-multiclient --continue -- -config.file=./config/cortex.yaml -target=purger -server.http-listen-port=8014 -server.grpc-listen-port=9014"]
2760+ depends_on:
2761+ - consul
2762+ - minio
2763+ environment:
2764+ - JAEGER_AGENT_HOST=jaeger
2765+ - JAEGER_AGENT_PORT=6831
2766+ - JAEGER_TAGS=app=querier-scheduler
2767+ - JAEGER_SAMPLER_TYPE=const
2768+ - JAEGER_SAMPLER_PARAM=1
2769+ ports:
2770+ - 8014:8014
2771+ - 18014:18014
2772 volumes:
2773 - ./config:/cortex/config
2774diff --git a/development/tsdb-blocks-storage-s3/goland/TSDB Query-frontend (using scheduler).run.xml b/development/tsdb-blocks-storage-s3/goland/TSDB Query-frontend (using scheduler).run.xml
2775new file mode 100644
2776index 0000000..c74d201
2777--- /dev/null
2778+++ b/development/tsdb-blocks-storage-s3/goland/TSDB Query-frontend (using scheduler).run.xml
2779@@ -0,0 +1,6 @@
2780+<component name="ProjectRunConfigurationManager">
2781+ <configuration default="false" name="TSDB Query-frontend (using scheduler)" type="GoRemoteDebugConfigurationType" factoryName="Go Remote" port="18012">
2782+ <option name="disconnectOption" value="ASK" />
2783+ <method v="2" />
2784+ </configuration>
2785+</component>
2786\ No newline at end of file
2787diff --git a/development/tsdb-blocks-storage-s3/goland/TSDB Query-scheduler.run.xml b/development/tsdb-blocks-storage-s3/goland/TSDB Query-scheduler.run.xml
2788new file mode 100644
2789index 0000000..932cce6
2790--- /dev/null
2791+++ b/development/tsdb-blocks-storage-s3/goland/TSDB Query-scheduler.run.xml
2792@@ -0,0 +1,6 @@
2793+<component name="ProjectRunConfigurationManager">
2794+ <configuration default="false" name="TSDB Query-scheduler" type="GoRemoteDebugConfigurationType" factoryName="Go Remote" port="18011">
2795+ <option name="disconnectOption" value="ASK" />
2796+ <method v="2" />
2797+ </configuration>
2798+</component>
2799\ No newline at end of file
2800diff --git a/development/tsdb-blocks-storage-s3/goland/ruler-1.run.xml b/development/tsdb-blocks-storage-s3/goland/ruler-1.run.xml
2801new file mode 100644
2802index 0000000..d5ed8e7
2803--- /dev/null
2804+++ b/development/tsdb-blocks-storage-s3/goland/ruler-1.run.xml
2805@@ -0,0 +1,5 @@
2806+<component name="ProjectRunConfigurationManager">
2807+ <configuration default="false" name="TSDB Ruler-1" type="GoRemoteDebugConfigurationType" factoryName="Go Remote" port="18021">
2808+ <method v="2" />
2809+ </configuration>
2810+</component>
2811\ No newline at end of file
2812diff --git a/development/tsdb-blocks-storage-s3/goland/ruler-2.run.xml b/development/tsdb-blocks-storage-s3/goland/ruler-2.run.xml
2813new file mode 100644
2814index 0000000..44f79aa
2815--- /dev/null
2816+++ b/development/tsdb-blocks-storage-s3/goland/ruler-2.run.xml
2817@@ -0,0 +1,5 @@
2818+<component name="ProjectRunConfigurationManager">
2819+ <configuration default="false" name="TSDB Ruler-2" type="GoRemoteDebugConfigurationType" factoryName="Go Remote" port="18022">
2820+ <method v="2" />
2821+ </configuration>
2822+</component>
2823\ No newline at end of file
2824diff --git a/development/tsdb-blocks-storage-swift-single-binary/.data-cortex-1/.gitignore b/development/tsdb-blocks-storage-swift-single-binary/.data-cortex-1/.gitignore
2825new file mode 100644
2826index 0000000..d6b7ef3
2827--- /dev/null
2828+++ b/development/tsdb-blocks-storage-swift-single-binary/.data-cortex-1/.gitignore
2829@@ -0,0 +1,2 @@
2830+*
2831+!.gitignore
2832diff --git a/development/tsdb-blocks-storage-swift-single-binary/.data-cortex-2/.gitignore b/development/tsdb-blocks-storage-swift-single-binary/.data-cortex-2/.gitignore
2833new file mode 100644
2834index 0000000..d6b7ef3
2835--- /dev/null
2836+++ b/development/tsdb-blocks-storage-swift-single-binary/.data-cortex-2/.gitignore
2837@@ -0,0 +1,2 @@
2838+*
2839+!.gitignore
2840diff --git a/development/tsdb-blocks-storage-swift-single-binary/.dockerignore b/development/tsdb-blocks-storage-swift-single-binary/.dockerignore
2841new file mode 100644
2842index 0000000..18e736f
2843--- /dev/null
2844+++ b/development/tsdb-blocks-storage-swift-single-binary/.dockerignore
2845@@ -0,0 +1,4 @@
2846+.data-cortex-1
2847+.data-cortex-2
2848+.data-swift
2849+active-query-tracker
2850\ No newline at end of file
2851diff --git a/development/tsdb-blocks-storage-swift-single-binary/.gitignore b/development/tsdb-blocks-storage-swift-single-binary/.gitignore
2852new file mode 100644
2853index 0000000..06787dd
2854--- /dev/null
2855+++ b/development/tsdb-blocks-storage-swift-single-binary/.gitignore
2856@@ -0,0 +1,2 @@
2857+cortex
2858+.data-swift
2859\ No newline at end of file
2860diff --git a/development/tsdb-blocks-storage-swift-single-binary/compose-down.sh b/development/tsdb-blocks-storage-swift-single-binary/compose-down.sh
2861new file mode 100755
2862index 0000000..39f3730
2863--- /dev/null
2864+++ b/development/tsdb-blocks-storage-swift-single-binary/compose-down.sh
2865@@ -0,0 +1,5 @@
2866+#!/bin/bash
2867+
2868+SCRIPT_DIR=$(cd `dirname $0` && pwd)
2869+
2870+docker-compose -f ${SCRIPT_DIR}/docker-compose.yml down
2871diff --git a/development/tsdb-blocks-storage-swift-single-binary/compose-up.sh b/development/tsdb-blocks-storage-swift-single-binary/compose-up.sh
2872new file mode 100755
2873index 0000000..d42350b
2874--- /dev/null
2875+++ b/development/tsdb-blocks-storage-swift-single-binary/compose-up.sh
2876@@ -0,0 +1,7 @@
2877+#!/bin/bash
2878+
2879+SCRIPT_DIR=$(cd `dirname $0` && pwd)
2880+
2881+CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${SCRIPT_DIR}/cortex ${SCRIPT_DIR}/../../cmd/cortex && \
2882+docker-compose -f ${SCRIPT_DIR}/docker-compose.yml build cortex-1 && \
2883+docker-compose -f ${SCRIPT_DIR}/docker-compose.yml up $@
2884diff --git a/development/tsdb-blocks-storage-swift-single-binary/config/cortex.yaml b/development/tsdb-blocks-storage-swift-single-binary/config/cortex.yaml
2885new file mode 100644
2886index 0000000..e1d52fc
2887--- /dev/null
2888+++ b/development/tsdb-blocks-storage-swift-single-binary/config/cortex.yaml
2889@@ -0,0 +1,84 @@
2890+auth_enabled: false
2891+
2892+distributor:
2893+ shard_by_all_labels: true
2894+ pool:
2895+ health_check_ingesters: true
2896+
2897+ingester_client:
2898+ grpc_client_config:
2899+ # Configure the client to allow messages up to 100MB.
2900+ max_recv_msg_size: 104857600
2901+ max_send_msg_size: 104857600
2902+ grpc_compression: gzip
2903+
2904+ingester:
2905+ lifecycler:
2906+ # We want to start immediately.
2907+ join_after: 0
2908+ final_sleep: 0s
2909+ num_tokens: 512
2910+
2911+ ring:
2912+ kvstore:
2913+ store: consul
2914+ consul:
2915+ host: localhost:8500
2916+ replication_factor: 1
2917+
2918+querier:
2919+ query_ingesters_within: 3h
2920+
2921+store_gateway:
2922+ sharding_enabled: true
2923+ sharding_ring:
2924+ replication_factor: 1
2925+ kvstore:
2926+ store: consul
2927+ consul:
2928+ host: localhost:8500
2929+
2930+blocks_storage:
2931+ backend: swift
2932+
2933+ tsdb:
2934+ dir: /data/cortex-tsdb-ingester
2935+ ship_interval: 1m
2936+ block_ranges_period: [ 2h ]
2937+ retention_period: 3h
2938+
2939+ bucket_store:
2940+ sync_dir: /data/cortex-tsdb-querier
2941+
2942+ swift:
2943+ auth_url: http://localhost:5000/v2.0
2944+ username: admin
2945+ password: s3cr3t
2946+ project_name: admin
2947+ region_name: RegionOne
2948+ container_name: cortex-tsdb
2949+
2950+storage:
2951+ engine: blocks
2952+
2953+ruler:
2954+ enable_api: true
2955+ enable_sharding: true
2956+ poll_interval: 2s
2957+ storage:
2958+ type: swift
2959+ swift:
2960+ auth_url: http://localhost:5000/v2.0
2961+ username: admin
2962+ password: s3cr3t
2963+ project_name: admin
2964+ region_name: RegionOne
2965+ container_name: cortex-rules
2966+ ring:
2967+ kvstore:
2968+ store: consul
2969+ consul:
2970+ host: localhost:8500
2971+
2972+runtime_config:
2973+ file: ./config/runtime.yaml
2974diff --git a/development/tsdb-blocks-storage-swift-single-binary/config/grafana-agent.yaml b/development/tsdb-blocks-storage-swift-single-binary/config/grafana-agent.yaml
2975new file mode 100644
2976index 0000000..9ae002a
2977--- /dev/null
2978+++ b/development/tsdb-blocks-storage-swift-single-binary/config/grafana-agent.yaml
2979@@ -0,0 +1,26 @@
2980+server:
2981+ log_level: debug
2982+ http_listen_port: 9091
2983+
2984+prometheus:
2985+ global:
2986+ scrape_interval: 5s
2987+ external_labels:
2988+ scraped_by: grafana-agent
2989+ configs:
2990+ - name: local
2991+ host_filter: false
2992+ scrape_configs:
2993+ - job_name: cortex-1
2994+ static_configs:
2995+ - targets: ['localhost:8001']
2996+ labels:
2997+ container: 'cortex-1'
2998+ - job_name: cortex-2
2999+ static_configs:
3000+ - targets: ['localhost:8002']
3001+ labels:
3002+ container: 'cortex-2'
3003+
3004+ remote_write:
3005+ - url: http://localhost:8001/api/prom/push
3006diff --git a/development/tsdb-blocks-storage-swift-single-binary/config/prometheus.yaml b/development/tsdb-blocks-storage-swift-single-binary/config/prometheus.yaml
3007new file mode 100644
3008index 0000000..f650c3a
3009--- /dev/null
3010+++ b/development/tsdb-blocks-storage-swift-single-binary/config/prometheus.yaml
3011@@ -0,0 +1,19 @@
3012+global:
3013+ scrape_interval: 5s
3014+ external_labels:
3015+ scraped_by: prometheus
3016+
3017+scrape_configs:
3018+ - job_name: cortex-1
3019+ static_configs:
3020+ - targets: ['localhost:8001']
3021+ labels:
3022+ container: 'cortex-1'
3023+ - job_name: cortex-2
3024+ static_configs:
3025+ - targets: ['localhost:8002']
3026+ labels:
3027+ container: 'cortex-2'
3028+
3029+remote_write:
3030+ - url: http://localhost:8001/api/prom/push
3031diff --git a/development/tsdb-blocks-storage-swift-single-binary/config/runtime.yaml b/development/tsdb-blocks-storage-swift-single-binary/config/runtime.yaml
3032new file mode 100644
3033index 0000000..475c274
3034--- /dev/null
3035+++ b/development/tsdb-blocks-storage-swift-single-binary/config/runtime.yaml
3036@@ -0,0 +1 @@
3037+# This file is left empty. It can be configured with overrides or other runtime config.
3038diff --git a/development/tsdb-blocks-storage-swift-single-binary/dev.dockerfile b/development/tsdb-blocks-storage-swift-single-binary/dev.dockerfile
3039new file mode 100644
3040index 0000000..8947594
3041--- /dev/null
3042+++ b/development/tsdb-blocks-storage-swift-single-binary/dev.dockerfile
3043@@ -0,0 +1,5 @@
3044+FROM alpine:3.12
3045+
3046+RUN mkdir /cortex
3047+WORKDIR /cortex
3048+ADD ./cortex ./
3049diff --git a/development/tsdb-blocks-storage-swift-single-binary/docker-compose.yml b/development/tsdb-blocks-storage-swift-single-binary/docker-compose.yml
3050new file mode 100644
3051index 0000000..ef28014
3052--- /dev/null
3053+++ b/development/tsdb-blocks-storage-swift-single-binary/docker-compose.yml
3054@@ -0,0 +1,100 @@
3055+version: '3.4'
3056+services:
3057+
3058+ consul:
3059+ image: consul
3060+ command: [ "agent", "-dev" ,"-client=0.0.0.0", "-log-level=info" ]
3061+ ports:
3062+ - 8500:8500
3063+
3064+ swift:
3065+ image: beaukode/docker-swift-onlyone-authv2-keystone
3066+ volumes:
3067+ - .data-swift:/srv:delegated
3068+ ports:
3069+ - 5000:5000
3070+ - 5001:5001
3071+ - 8080:8080
3072+ - 35357:35357
3073+
3074+ swift-create-container:
3075+ network_mode: host
3076+ image: theflockers/swiftclient
3077+ environment:
3078+ - OS_USERNAME=admin
3079+ - OS_PASSWORD=s3cr3t
3080+ - OS_TENANT_NAME=admin
3081+ - OS_AUTH_URL=http://localhost:5000/v2.0
3082+ - OS_REGION_NAME=RegionOne
3083+ command: ["sh", "-c", "sleep 30 && swift post cortex-rules && \
3084+ swift post cortex-tsdb && swift list"]
3085+
3086+ prometheus:
3087+ network_mode: host
3088+ image: prom/prometheus:v2.16.0
3089+ command: ["--config.file=/etc/prometheus/prometheus.yaml"]
3090+ volumes:
3091+ - ./config:/etc/prometheus
3092+ ports:
3093+ - 9090:9090
3094+
3095+ # Scrape the metrics also with the Grafana agent (useful to test metadata ingestion
3096+ # until metadata remote write is not supported by Prometheus).
3097+ grafana-agent:
3098+ network_mode: host
3099+ image: grafana/agent:v0.2.0
3100+ command: ["-config.file=/etc/agent-config/grafana-agent.yaml", "-prometheus.wal-directory=/tmp"]
3101+ volumes:
3102+ - ./config:/etc/agent-config
3103+ ports:
3104+ - 9091:9091
3105+
3106+ jaeger:
3107+ image: jaegertracing/all-in-one
3108+ ports:
3109+ - 16686:16686
3110+ - "14268"
3111+
3112+ cortex-1:
3113+ network_mode: host
3114+ build:
3115+ context: .
3116+ dockerfile: dev.dockerfile
3117+ image: cortex
3118+ command: ["sh", "-c", "sleep 40 && exec ./cortex -config.file=./config/cortex.yaml -target=all -server.http-listen-port=8001 -server.grpc-listen-port=9001"]
3119+ depends_on:
3120+ - consul
3121+ - swift
3122+ environment:
3123+ - JAEGER_AGENT_HOST=jaeger
3124+ - JAEGER_AGENT_PORT=6831
3125+ - JAEGER_TAGS=app=cortex-1
3126+ - JAEGER_SAMPLER_TYPE=const
3127+ - JAEGER_SAMPLER_PARAM=1
3128+ ports:
3129+ - 8001:8001
3130+ volumes:
3131+ - ./config:/cortex/config
3132+ - .data-cortex-1:/data:delegated
3133+
3134+ cortex-2:
3135+ network_mode: host
3136+ build:
3137+ context: .
3138+ dockerfile: dev.dockerfile
3139+ image: cortex
3140+ command: ["sh", "-c", "sleep 40 && exec ./cortex -config.file=./config/cortex.yaml -target=all -server.http-listen-port=8002 -server.grpc-listen-port=9002"]
3141+ depends_on:
3142+ - consul
3143+ - swift
3144+ environment:
3145+ - JAEGER_AGENT_HOST=jaeger
3146+ - JAEGER_AGENT_PORT=6831
3147+ - JAEGER_TAGS=app=cortex-2
3148+ - JAEGER_SAMPLER_TYPE=const
3149+ - JAEGER_SAMPLER_PARAM=1
3150+ ports:
3151+ - 8002:8002
3152+ volumes:
3153+ - ./config:/cortex/config
3154+ - .data-cortex-2:/data:delegated
3155diff --git a/docs/_index.md b/docs/_index.md
3156index 3cf5c5d..28de70d 100644
3157--- a/docs/_index.md
3158+++ b/docs/_index.md
3159@@ -8,7 +8,7 @@ menu:
3160 ---
3161 <p align="center"><img width="200px" src="https://cncf-branding.netlify.com/img/projects/cortex/stacked/color/cortex-stacked-color.png" alt="Cortex Logo"></p>
3162
3163-[![Circle CI](https://circleci.com/gh/cortexproject/cortex/tree/master.svg?style=shield)](https://circleci.com/gh/cortexproject/cortex/tree/master)
3164+[![CI](https://github.com/cortexproject/cortex/workflows/ci/badge.svg)](https://github.com/cortexproject/cortex/actions)
3165 [![GoDoc](https://godoc.org/github.com/cortexproject/cortex?status.svg)](https://godoc.org/github.com/cortexproject/cortex)
3166 <a href="https://goreportcard.com/report/github.com/cortexproject/cortex"><img src="https://goreportcard.com/badge/github.com/cortexproject/cortex" alt="Go Report Card" /></a>
3167 <a href="https://cloud-native.slack.com/messages/cortex/"><img src="https://img.shields.io/badge/join%20slack-%23cortex-brightgreen.svg" alt="Slack" /></a>
3168@@ -28,20 +28,41 @@ Cortex is primarily used as a [remote write](https://prometheus.io/docs/operatin
3169
3170 ## Documentation
3171
3172-Read the [getting started guide](getting-started/) if you're new to the
3173+Read the [getting started guide](getting-started/_index.md) if you're new to the
3174 project. Before deploying Cortex with a permanent storage backend you
3175 should read:
3176
3177 1. [An overview of Cortex's architecture](architecture.md)
3178-1. [A guide to running Cortex](production/running.md)
3179-1. [Information regarding configuring Cortex](configuration/arguments.md)
3180+1. [A guide to running Cortex chunks storage](guides/running-chunks-storage-in-production.md)
3181+1. [Information regarding configuring Cortex](configuration/_index.md)
3182
3183 For a guide to contributing to Cortex, see the [contributor guidelines](contributing/).
3184
3185 ## Further reading
3186
3187-To learn more about Cortex, consult the following documents & talks:
3188+To learn more about Cortex, consult the following talks and articles.
3189
3190+### Recent talks and articles
3191+
3192+- Dec 2020 blog post "[How AWS and Grafana Labs are scaling Cortex for the cloud](https://aws.amazon.com/blogs/opensource/how-aws-and-grafana-labs-are-scaling-cortex-for-the-cloud/)
3193+- Oct 2020 blog post "[How to switch Cortex from chunks to blocks storage (and why you won’t look back)](https://grafana.com/blog/2020/10/19/how-to-switch-cortex-from-chunks-to-blocks-storage-and-why-you-wont-look-back/)"
3194+- Oct 2020 blog post "[Now GA: Cortex blocks storage for running Prometheus at scale with reduced operational complexity](https://grafana.com/blog/2020/10/06/now-ga-cortex-blocks-storage-for-running-prometheus-at-scale-with-reduced-operational-complexity/)"
3195+- Sep 2020 blog post "[A Tale of Tail Latencies](https://www.weave.works/blog/a-tale-of-tail-latencies)"
3196+- Sep 2020 KubeCon talk "Scaling Prometheus: How We Got Some Thanos Into Cortex" ([video](https://www.youtube.com/watch?v=Z5OJzRogAS4), [slides](https://static.sched.com/hosted_files/kccnceu20/ec/2020-08%20-%20KubeCon%20EU%20-%20Cortex%20blocks%20storage.pdf))
3197+- Aug 2020 blog post "[Scaling Prometheus: How we’re pushing Cortex blocks storage to its limit and beyond](https://grafana.com/blog/2020/08/12/scaling-prometheus-how-were-pushing-cortex-blocks-storage-to-its-limit-and-beyond/)"
3198+- Jul 2020 blog post "[How blocks storage in Cortex reduces operational complexity for running Prometheus at massive scale](https://grafana.com/blog/2020/07/29/how-blocks-storage-in-cortex-reduces-operational-complexity-for-running-prometheus-at-massive-scale/)"
3199+- Jul 2020 PromCon talk "Sharing is Caring: Leveraging Open Source to Improve Cortex & Thanos" ([video](https://www.youtube.com/watch?v=2oTLouUvsac), [slides](https://docs.google.com/presentation/d/1OuKYD7-k9Grb7unppYycdmVGWN0Bo0UwdJRySOoPdpg/edit))
3200+- Mar 2020 blog post "[Cortex: Zone Aware Replication](https://kenhaines.net/cortex-zone-aware-replication/)"
3201+- Mar 2020 blog post "[How we're using gossip to improve Cortex and Loki availability](https://grafana.com/blog/2020/03/25/how-were-using-gossip-to-improve-cortex-and-loki-availability/)"
3202+- Jan 2020 blog post "[The Future of Cortex: Into the Next Decade][future-of-cortex-blog]"
3203+
3204+[future-of-cortex-blog]: https://grafana.com/blog/2020/01/21/the-future-of-cortex-into-the-next-decade/
3205+
3206+### Previous talks and articles
3207+
3208+- Nov 2019 KubeCon talks "[Cortex 101: Horizontally Scalable Long Term Storage for Prometheus][kubecon-cortex-101]" ([video][kubecon-cortex-101-video], [slides][kubecon-cortex-101-slides]), "[Configuring Cortex for Max
3209+Performance][kubecon-cortex-201]" ([video][kubecon-cortex-201-video], [slides][kubecon-cortex-201-slides], [write up][kubecon-cortex-201-writeup]) and "[Blazin’ Fast PromQL][kubecon-blazin]" ([slides][kubecon-blazin-slides], [video][kubecon-blazin-video], [write up][kubecon-blazin-writeup])
3210+- Nov 2019 PromCon talk "[Two Households, Both Alike in Dignity: Cortex and Thanos][promcon-two-households]" ([video][promcon-two-households-video], [slides][promcon-two-households-slides], [write up][promcon-two-households-writeup])
3211 - May 2019 KubeCon talks; "[Cortex: Intro][kubecon-cortex-intro]" ([video][kubecon-cortex-intro-video], [slides][kubecon-cortex-intro-slides], [blog post][kubecon-cortex-intro-blog]) and "[Cortex: Deep Dive][kubecon-cortex-deepdive]" ([video][kubecon-cortex-deepdive-video], [slides][kubecon-cortex-deepdive-slides])
3212 - Feb 2019 blog post & podcast; "[Prometheus Scalability with Bryan Boreham][prometheus-scalability]" ([podcast][prometheus-scalability-podcast])
3213 - Feb 2019 blog post; "[How Aspen Mesh Runs Cortex in Production][aspen-mesh-2019]"
3214@@ -58,6 +79,21 @@ To learn more about Cortex, consult the following documents & talks:
3215 - Aug 2016 PromCon talk; "Project Frankenstein: Multitenant, Scale-Out Prometheus": ([video][promcon-2016-video], [slides][promcon-2016-slides])
3216 - Jun 2016 design document; "[Project Frankenstein: A Multi Tenant, Scale Out Prometheus](http://goo.gl/prdUYV)"
3217
3218+[kubecon-cortex-101]: https://kccncna19.sched.com/event/UaiH/cortex-101-horizontally-scalable-long-term-storage-for-prometheus-chris-marchbanks-splunk
3219+[kubecon-cortex-101-video]: https://www.youtube.com/watch?v=f8GmbH0U_kI
3220+[kubecon-cortex-101-slides]: https://static.sched.com/hosted_files/kccncna19/92/cortex_101.pdf
3221+[kubecon-cortex-201]: https://kccncna19.sched.com/event/UagC/performance-tuning-and-day-2-operations-goutham-veeramachaneni-grafana-labs
3222+[kubecon-cortex-201-slides]: https://static.sched.com/hosted_files/kccncna19/87/Taming%20Cortex_%20Configuring%20for%20maximum%20performance%281%29.pdf
3223+[kubecon-cortex-201-video]: https://www.youtube.com/watch?v=VuE5aDHDexU
3224+[kubecon-cortex-201-writeup]: https://grafana.com/blog/2019/12/02/kubecon-recap-configuring-cortex-for-maximum-performance-at-scale/
3225+[kubecon-blazin]: https://kccncna19.sched.com/event/UaWT/blazin-fast-promql-tom-wilkie-grafana-labs
3226+[kubecon-blazin-slides]: https://static.sched.com/hosted_files/kccncna19/0b/2019-11%20Blazin%27%20Fast%20PromQL.pdf
3227+[kubecon-blazin-video]: https://www.youtube.com/watch?v=yYgdZyeBOck
3228+[kubecon-blazin-writeup]: https://grafana.com/blog/2019/09/19/how-to-get-blazin-fast-promql/
3229+[promcon-two-households]: https://promcon.io/2019-munich/talks/two-households-both-alike-in-dignity-cortex-and-thanos/
3230+[promcon-two-households-video]: https://www.youtube.com/watch?v=KmJnmd3K3Ws&feature=youtu.be
3231+[promcon-two-households-slides]: https://promcon.io/2019-munich/slides/two-households-both-alike-in-dignity-cortex-and-thanos.pdf
3232+[promcon-two-households-writeup]: https://grafana.com/blog/2019/11/21/promcon-recap-two-households-both-alike-in-dignity-cortex-and-thanos/
3233 [kubecon-cortex-intro]: https://kccnceu19.sched.com/event/MPhX/intro-cortex-tom-wilkie-grafana-labs-bryan-boreham-weaveworks
3234 [kubecon-cortex-intro-video]: https://www.youtube.com/watch?v=_7Wnta-3-W0
3235 [kubecon-cortex-intro-slides]: https://static.sched.com/hosted_files/kccnceu19/af/Cortex%20Intro%20KubeCon%20EU%202019.pdf
3236@@ -120,3 +156,8 @@ in the [Weave Cloud documentation](https://www.weave.works/docs/cloud/latest/ove
3237 To use Cortex as part of Grafana Cloud, sign up for [Grafana Cloud](https://grafana.com/cloud)
3238 by clicking "Log In" in the top right and then "Sign Up Now". Cortex is included
3239 as part of the Starter and Basic Hosted Grafana plans.
3240+
3241+### Amazon Managed Service for Prometheus (AMP)
3242+[Amazon Managed Service for Prometheus (AMP)](https://aws.amazon.com/prometheus/) is a Prometheus-compatible monitoring service that makes it easy to monitor containerized applications at scale. It is a highly available, secure, and managed monitoring for your containers. Get started [here](https://console.aws.amazon.com/prometheus/home). To learn more about the AMP, reference our [documentation](https://docs.aws.amazon.com/prometheus/latest/userguide/what-is-Amazon-Managed-Service-Prometheus.html) and [Getting Started with AMP blog](https://aws.amazon.com/blogs/mt/getting-started-amazon-managed-service-for-prometheus/).
3243+
3244+
3245diff --git a/docs/api/_index.md b/docs/api/_index.md
3246index 6d8783d..1cc8673 100644
3247--- a/docs/api/_index.md
3248+++ b/docs/api/_index.md
3249@@ -1,7 +1,7 @@
3250 ---
3251 title: "HTTP API"
3252 linkTitle: "HTTP API"
3253-weight: 5
3254+weight: 7
3255 slug: api
3256 menu:
3257 no_section_index_title: true
3258@@ -19,9 +19,12 @@ For the sake of clarity, in this document we have grouped API endpoints by servi
3259 | --- | ------- | -------- |
3260 | [Index page](#index-page) | _All services_ | `GET /` |
3261 | [Configuration](#configuration) | _All services_ | `GET /config` |
3262+| [Runtime Configuration](#runtime-configuration) | _All services_ | `GET /runtime_config` |
3263 | [Services status](#services-status) | _All services_ | `GET /services` |
3264 | [Readiness probe](#readiness-probe) | _All services_ | `GET /ready` |
3265 | [Metrics](#metrics) | _All services_ | `GET /metrics` |
3266+| [Pprof](#pprof) | _All services_ | `GET /debug/pprof` |
3267+| [Fgprof](#fgprof) | _All services_ | `GET /debug/fgprof` |
3268 | [Remote write](#remote-write) | Distributor | `POST /api/v1/push` |
3269 | [Tenants stats](#tenants-stats) | Distributor | `GET /distributor/all_user_stats` |
3270 | [HA tracker status](#ha-tracker-status) | Distributor | `GET /distributor/ha_tracker` |
3271@@ -47,6 +50,7 @@ For the sake of clarity, in this document we have grouped API endpoints by servi
3272 | [Delete rule group](#delete-rule-group) | Ruler | `DELETE /api/v1/rules/{namespace}/{groupName}` |
3273 | [Delete namespace](#delete-namespace) | Ruler | `DELETE /api/v1/rules/{namespace}` |
3274 | [Alertmanager status](#alertmanager-status) | Alertmanager | `GET /multitenant_alertmanager/status` |
3275+| [Alertmanager ring status](#alertmanager-ring-status) | Alertmanager | `GET /multitenant_alertmanager/ring` |
3276 | [Alertmanager UI](#alertmanager-ui) | Alertmanager | `GET /<alertmanager-http-prefix>` |
3277 | [Get Alertmanager configuration](#get-alertmanager-configuration) | Alertmanager | `GET /api/v1/alerts` |
3278 | [Set Alertmanager configuration](#set-alertmanager-configuration) | Alertmanager | `POST /api/v1/alerts` |
3279@@ -54,6 +58,8 @@ For the sake of clarity, in this document we have grouped API endpoints by servi
3280 | [Delete series](#delete-series) | Purger | `PUT,POST <prometheus-http-prefix>/api/v1/admin/tsdb/delete_series` |
3281 | [List delete requests](#list-delete-requests) | Purger | `GET <prometheus-http-prefix>/api/v1/admin/tsdb/delete_series` |
3282 | [Cancel delete request](#cancel-delete-request) | Purger | `PUT,POST <prometheus-http-prefix>/api/v1/admin/tsdb/cancel_delete_request` |
3283+| [Tenant delete request](#tenant-delete-request) | Purger | `POST /purger/delete_tenant` |
3284+| [Tenant delete status](#tenant-delete-status) | Purger | `GET /purger/delete_tenant_status` |
3285 | [Store-gateway ring status](#store-gateway-ring-status) | Store-gateway | `GET /store-gateway/ring` |
3286 | [Compactor ring status](#compactor-ring-status) | Compactor | `GET /compactor/ring` |
3287 | [Get rule files](#get-rule-files) | Configs API (deprecated) | `GET /api/prom/configs/rules` |
3288@@ -83,7 +89,7 @@ When multi-tenancy is enabled, endpoints requiring authentication are expected t
3289
3290 Multi-tenancy can be enabled/disabled via the CLI flag `-auth.enabled` or its respective YAML config option.
3291
3292-_For more information, please refer to the dedicated [Authentication and Authorisation](../production/auth.md) guide._
3293+_For more information, please refer to the dedicated [Authentication and Authorisation](../guides/authentication-and-authorisation.md) guide._
3294
3295 ## All services
3296
3297@@ -105,6 +111,28 @@ GET /config
3298
3299 Displays the configuration currently applied to Cortex (in YAML format), including default values and settings via CLI flags. Sensitive data is masked. Please be aware that the exported configuration **doesn't include the per-tenant overrides**.
3300
3301+#### Different modes
3302+
3303+```
3304+GET /config?mode=diff
3305+```
3306+
3307+Displays the configuration currently applied to Cortex (in YAML format) as before, but containing only the values that differ from the default values.
3308+
3309+```
3310+GET /config?mode=defaults
3311+```
3312+
3313+Displays the configuration using only the default values.
3314+
3315+### Runtime Configuration
3316+
3317+```
3318+GET /runtime_config
3319+```
3320+
3321+Displays the runtime configuration currently applied to Cortex (in YAML format), including default values. Please be aware that the endpoint will be only available if Cortex is configured with the `-runtime-config.file` option.
3322+
3323 ### Services status
3324
3325 ```
3326@@ -129,6 +157,31 @@ GET /metrics
3327
3328 Returns the metrics for the running Cortex service in the Prometheus exposition format.
3329
3330+### Pprof
3331+
3332+```
3333+GET /debug/pprof/heap
3334+GET /debug/pprof/block
3335+GET /debug/pprof/profile
3336+GET /debug/pprof/trace
3337+GET /debug/pprof/goroutine
3338+GET /debug/pprof/mutex
3339+```
3340+
3341+Returns the runtime profiling data in the format expected by the pprof visualization tool. There are many things which can be profiled using this including heap, trace, goroutine, etc.
3342+
3343+_For more information, please check out the official documentation of [pprof](https://golang.org/pkg/net/http/pprof/)._
3344+
3345+### Fgprof
3346+
3347+```
3348+GET /debug/fgprof
3349+```
3350+
3351+Returns the sampling Go profiling data which allows you to analyze On-CPU as well as Off-CPU (e.g. I/O) time together.
3352+
3353+_For more information, please check out the official documentation of [fgprof](https://github.com/felixge/fgprof)._
3354+
3355 ## Distributor
3356
3357 ### Remote write
3358@@ -170,6 +223,7 @@ GET /ha-tracker
3359
3360 Displays a web page with the current status of the HA tracker, including the elected replica for each Prometheus HA cluster.
3361
3362+
3363 ## Ingester
3364
3365 ### Flush chunks / blocks
3366@@ -192,7 +246,7 @@ GET,POST /ingester/shutdown
3367 GET,POST /shutdown
3368 ```
3369
3370-Flushes in-memory time series data from ingester to the long-term storage, and shuts down the ingester service. Notice that the other Cortex services are still running, and the operator (or any automation) is expected to terminate the process with a `SIGINT` / `SIGTERM` signal after the shutdown endpoint returns. In the meantime, `/ready` will not return 200.
3371+Flushes in-memory time series data from ingester to the long-term storage, and shuts down the ingester service. Notice that the other Cortex services are still running, and the operator (or any automation) is expected to terminate the process with a `SIGINT` / `SIGTERM` signal after the shutdown endpoint returns. In the meantime, `/ready` will not return 200. This endpoint will unregister the ingester from the ring even if `-ingester.unregister-on-shutdown` is disabled.
3372
3373 _This API endpoint is usually used by scale down automations._
3374
3375@@ -251,7 +305,7 @@ GET,POST <prometheus-http-prefix>/api/v1/series
3376 GET,POST <legacy-http-prefix>/api/v1/series
3377 ```
3378
3379-Find series by label matchers. Differently than Prometheus and due to scalability and performances reasons, Cortex currently ignores the `start` and `end` request parameters and always fetches the series from in-memory data stored in the ingesters.
3380+Find series by label matchers. Differently than Prometheus and due to scalability and performances reasons, Cortex currently ignores the `start` and `end` request parameters and always fetches the series from in-memory data stored in the ingesters. There is experimental support to query the long-term store with the *blocks* storage engine when `-querier.query-store-for-labels-enabled` is set.
3381
3382 _For more information, please check out the Prometheus [series endpoint](https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers) documentation._
3383
3384@@ -266,7 +320,7 @@ GET,POST <prometheus-http-prefix>/api/v1/labels
3385 GET,POST <legacy-http-prefix>/api/v1/labels
3386 ```
3387
3388-Get label names of ingested series. Differently than Prometheus and due to scalability and performances reasons, Cortex currently ignores the `start` and `end` request parameters and always fetches the label names from in-memory data stored in the ingesters.
3389+Get label names of ingested series. Differently than Prometheus and due to scalability and performances reasons, Cortex currently ignores the `start` and `end` request parameters and always fetches the label names from in-memory data stored in the ingesters. There is experimental support to query the long-term store with the *blocks* storage engine when `-querier.query-store-for-labels-enabled` is set.
3390
3391 _For more information, please check out the Prometheus [get label names](https://prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names) documentation._
3392
3393@@ -281,7 +335,7 @@ GET <prometheus-http-prefix>/api/v1/label/{name}/values
3394 GET <legacy-http-prefix>/api/v1/label/{name}/values
3395 ```
3396
3397-Get label values for a given label name. Differently than Prometheus and due to scalability and performances reasons, Cortex currently ignores the `start` and `end` request parameters and always fetches the label values from in-memory data stored in the ingesters.
3398+Get label values for a given label name. Differently than Prometheus and due to scalability and performances reasons, Cortex currently ignores the `start` and `end` request parameters and always fetches the label values from in-memory data stored in the ingesters. There is experimental support to query the long-term store with the *blocks* storage engine when `-querier.query-store-for-labels-enabled` is set.
3399
3400 _For more information, please check out the Prometheus [get label values](https://prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values) documentation._
3401
3402@@ -587,6 +641,14 @@ GET /status
3403
3404 Displays a web page with the current status of the Alertmanager, including the Alertmanager cluster members.
3405
3406+### Alertmanager ring status
3407+
3408+```
3409+GET /multitenant_alertmanager/ring
3410+```
3411+
3412+Displays a web page with the Alertmanager hash ring status, including the state, healthy and last heartbeat time of each Alertmanager instance.
3413+
3414 ### Alertmanager UI
3415
3416 ```
3417@@ -639,6 +701,8 @@ alertmanager_config: |
3418 global:
3419 smtp_smarthost: 'localhost:25'
3420 smtp_from: 'youraddress@example.org'
3421+ templates:
3422+ - 'default_template'
3423 route:
3424 receiver: example-email
3425 receivers:
3426@@ -710,6 +774,26 @@ Cancel a delete request while the request is still in the grace period (before t
3427
3428 _Requires [authentication](#authentication)._
3429
3430+### Tenant Delete Request
3431+
3432+```
3433+POST /purger/delete_tenant
3434+```
3435+
3436+Request deletion of ALL tenant data. Only works with blocks storage. Experimental.
3437+
3438+_Requires [authentication](#authentication)._
3439+
3440+### Tenant Delete Status
3441+
3442+```
3443+GET /purger/delete_tenant_status
3444+```
3445+
3446+Returns status of tenant deletion. Output format to be defined. Experimental.
3447+
3448+_Requires [authentication](#authentication)._
3449+
3450 ## Store-gateway
3451
3452 ### Store-gateway ring status
3453@@ -764,7 +848,16 @@ The following schema is used both when retrieving the current configs from the A
3454 - **`config.rules_files`**<br />
3455 The contents of a rules file should be as described [here](http://prometheus.io/docs/prometheus/latest/configuration/recording_rules/), encoded as a single string to fit within the overall JSON payload.
3456 - **`config.template_files`**<br />
3457- The contents of a template file should be as described [here](https://prometheus.io/docs/alerting/notification_examples/#defining-reusable-templates), encoded as a single string to fit within the overall JSON payload.
3458+ The contents of a template file should be as described [here](https://prometheus.io/docs/alerting/notification_examples/#defining-reusable-templates), encoded as a single string to fit within the overall JSON payload. These entries should match the `templates` entries in `alertmanager_config`. Example:
3459+ ```yaml
3460+ template_files:
3461+ myorg.tmpl: |
3462+ {{ define "__alertmanager" }}AlertManager{{ end }}
3463+ {{ define "__alertmanagerURL" }}{{ .ExternalURL }}/#/alerts?receiver={{ .Receiver | urlquery }}{{ end }}
3464+ alertmanager_config: |
3465+ templates:
3466+ - 'myorg.tmpl'
3467+ ```
3468
3469 ### Get rule files
3470
3471diff --git a/docs/architecture.md b/docs/architecture.md
3472index dcbe65d..c4cd232 100644
3473--- a/docs/architecture.md
3474+++ b/docs/architecture.md
3475@@ -44,11 +44,7 @@ For this reason, the chunks storage consists of:
3476 * [Google Cloud Storage](https://cloud.google.com/storage/)
3477 * [Microsoft Azure Storage](https://azure.microsoft.com/en-us/services/storage/)
3478
3479-Internally, the access to the chunks storage relies on a unified interface called "chunks store". Unlike other Cortex components, the chunk store is not a separate service, but rather a library embedded in the services that need to access the long-term storage: [ingester](#ingester), [querier](#querier) and [ruler](#ruler).
3480-
3481-The chunk and index format are versioned, this allows Cortex operators to upgrade the cluster to take advantage of new features and improvements. This strategy enables changes in the storage format without requiring any downtime or complex procedures to rewrite the stored data. A set of schemas are used to map the version while reading and writing time series belonging to a specific period of time.
3482-
3483-The current schema recommendation is the **v9 schema** for most use cases and **v10 schema** if you expect to have very high cardinality metrics (v11 is still experimental). For more information about the schema, please check out the [Schema](configuration/schema-config-reference.md) documentation.
3484+For more information, please check out the [Chunks storage](./chunks-storage/_index.md) documentation.
3485
3486 ### Blocks storage
3487
3488@@ -61,10 +57,10 @@ The blocks storage doesn't require a dedicated storage backend for the index. Th
3489 * [Amazon S3](https://aws.amazon.com/s3)
3490 * [Google Cloud Storage](https://cloud.google.com/storage/)
3491 * [Microsoft Azure Storage](https://azure.microsoft.com/en-us/services/storage/)
3492-* [Local Filesystem](https://thanos.io/storage.md/#filesystem) (single node only)
3493 * [OpenStack Swift](https://wiki.openstack.org/wiki/Swift) (experimental)
3494+* [Local Filesystem](https://thanos.io/storage.md/#filesystem) (single node only)
3495
3496-For more information, please check out the [Blocks storage](./blocks-storage/) documentation.
3497+For more information, please check out the [Blocks storage](./blocks-storage/_index.md) documentation.
3498
3499 ## Services
3500
3501@@ -110,7 +106,7 @@ The supported KV stores for the HA tracker are:
3502
3503 Note: Memberlist is not supported. Memberlist-based KV store propagates updates using gossip, which is very slow for HA purposes: result is that different distributors may see different Prometheus server as elected HA replica, which is definitely not desirable.
3504
3505-For more information, please refer to [config for sending HA pairs data to Cortex](production/ha-pair-handling.md) in the documentation.
3506+For more information, please refer to [config for sending HA pairs data to Cortex](guides/ha-pair-handling.md) in the documentation.
3507
3508 #### Hashing
3509
3510@@ -207,6 +203,13 @@ The query frontend internally performs some query adjustments and holds queries
3511
3512 Query frontends are **stateless**. However, due to how the internal queue works, it's recommended to run a few query frontend replicas to reap the benefit of fair scheduling. Two replicas should suffice in most cases.
3513
3514+Flow of the query in the system when using query-frontend:
3515+
3516+1) Query is received by query frontend, which can optionally split it or serve from the cache.
3517+2) Query frontend stores the query into in-memory queue, where it waits for some querier to pick it up.
3518+3) Querier picks up the query, and executes it.
3519+4) Querier sends result back to query-frontend, which then forwards it to the client.
3520+
3521 #### Queueing
3522
3523 The query frontend queuing mechanism is used to:
3524@@ -223,6 +226,24 @@ The query frontend splits multi-day queries into multiple single-day queries, ex
3525
3526 The query frontend supports caching query results and reuses them on subsequent queries. If the cached results are incomplete, the query frontend calculates the required subqueries and executes them in parallel on downstream queriers. The query frontend can optionally align queries with their step parameter to improve the cacheability of the query results. The result cache is compatible with any cortex caching backend (currently memcached, redis, and an in-memory cache).
3527
3528+### Query Scheduler
3529+
3530+Query Scheduler is an **optional** service that moves the internal queue from query frontend into separate component.
3531+This enables independent scaling of query frontends and number of queues (query scheduler).
3532+
3533+In order to use query scheduler, both query frontend and queriers must be configured with query scheduler address
3534+(using `-frontend.scheduler-address` and `-querier.scheduler-address` options respectively).
3535+
3536+Flow of the query in the system changes when using query scheduler:
3537+
3538+1) Query is received by query frontend, which can optionally split it or serve from the cache.
3539+2) Query frontend forwards the query to random query scheduler process.
3540+3) Query scheduler stores the query into in-memory queue, where it waits for some querier to pick it up.
3541+3) Querier picks up the query, and executes it.
3542+4) Querier sends result back to query-frontend, which then forwards it to the client.
3543+
3544+Query schedulers are **stateless**. It is recommended to run two replicas to make sure queries can still be serviced while one replica is restarting.
3545+
3546 ### Ruler
3547
3548 The **ruler** is an **optional service** executing PromQL queries for recording rules and alerts. The ruler requires a database storing the recording rules and alerts for each tenant.
3549diff --git a/docs/blocks-storage/_index.md b/docs/blocks-storage/_index.md
3550index 124c887..e0541f4 100644
3551--- a/docs/blocks-storage/_index.md
3552+++ b/docs/blocks-storage/_index.md
3553@@ -1,7 +1,7 @@
3554 ---
3555 title: "Blocks Storage"
3556 linkTitle: "Blocks Storage"
3557-weight: 8
3558+weight: 3
3559 menu:
3560 ---
3561
3562@@ -12,9 +12,10 @@ The supported backends for the blocks storage are:
3563 * [Amazon S3](https://aws.amazon.com/s3)
3564 * [Google Cloud Storage](https://cloud.google.com/storage/)
3565 * [Microsoft Azure Storage](https://azure.microsoft.com/en-us/services/storage/)
3566+* [OpenStack Swift](https://wiki.openstack.org/wiki/Swift) (experimental)
3567 * [Local Filesystem](https://thanos.io/storage.md/#filesystem) (single node only)
3568
3569-_Internally, this storage engine is based on [Thanos](https://thanos.io), but no Thanos knowledge is required in order to run it._
3570+_Internally, some components are based on [Thanos](https://thanos.io), but no Thanos knowledge is required in order to run it._
3571
3572 ## Architecture
3573
3574@@ -28,9 +29,9 @@ When running the Cortex blocks storage, the Cortex architecture doesn't signific
3575
3576 The **[store-gateway](./store-gateway.md)** is responsible to query blocks and is used by the [querier](./querier.md) at query time. The store-gateway is required when running the blocks storage.
3577
3578-The **[compactor](./compactor.md)** is responsible to merge and deduplicate smaller blocks into larger ones, in order to reduce the number of blocks stored in the long-term storage for a given tenant and query them more efficiently. The compactor is optional but highly recommended.
3579+The **[compactor](./compactor.md)** is responsible to merge and deduplicate smaller blocks into larger ones, in order to reduce the number of blocks stored in the long-term storage for a given tenant and query them more efficiently. It also keeps the [bucket index](./bucket-index.md) updated and, for this reason, it's a required component.
3580
3581-Finally, the **table-manager** is not used by the blocks storage.
3582+Finally, the [**table-manager**](../chunks-storage/table-manager.md) and the [**schema config**](../chunks-storage/schema-config.md) are **not used** by the blocks storage.
3583
3584 ### The write path
3585
3586@@ -44,7 +45,7 @@ In order to effectively use the **WAL** and being able to recover the in-memory
3587
3588 The series sharding and replication done by the distributor doesn't change based on the storage engine.
3589
3590-It's important to note that - differently than the [chunks storage](../architecture.md#chunks-storage-default) - due to the replication factor N (typically 3), each time series is stored by N ingesters. Since each ingester writes its own block to the long-term storage, this leads a storage utilization N times more than the chunks storage. [Compactor](./compactor.md) solves this problem by merging blocks from multiple ingesters into a single block, and removing duplicated samples.
3591+It's important to note that - differently than the [chunks storage](../chunks-storage/_index.md) - due to the replication factor N (typically 3), each time series is stored by N ingesters. Since each ingester writes its own block to the long-term storage, this leads a storage utilization N times more than the chunks storage. [Compactor](./compactor.md) solves this problem by merging blocks from multiple ingesters into a single block, and removing duplicated samples. After blocks compaction, the storage utilization is significantly smaller compared to the chunks storage for the same exact series and samples.
3592
3593 For more information, please refer to the following dedicated sections:
3594
3595diff --git a/docs/blocks-storage/bucket-index.md b/docs/blocks-storage/bucket-index.md
3596new file mode 100644
3597index 0000000..67947d0
3598--- /dev/null
3599+++ b/docs/blocks-storage/bucket-index.md
3600@@ -0,0 +1,61 @@
3601+---
3602+title: "Bucket Index"
3603+linkTitle: "Bucket Index"
3604+weight: 5
3605+slug: bucket-index
3606+---
3607+
3608+The bucket index is a **per-tenant file containing the list of blocks and block deletion marks** in the storage. The bucket index itself is stored in the backend object storage, is periodically updated by the compactor, and used by queriers, store-gateways and rulers to discover blocks in the storage.
3609+
3610+The bucket index usage is **optional** and can be enabled via `-blocks-storage.bucket-store.bucket-index.enabled=true` (or its respective YAML config option).
3611+
3612+## Benefits
3613+
3614+The [querier](./querier.md), [store-gateway](./store-gateway.md) and ruler need to have an almost up-to-date view over the entire storage bucket, in order to find the right blocks to lookup at query time (querier) and load block's [index-header](./binary-index-header.md) (store-gateway). Because of this, they need to periodically scan the bucket to look for new blocks uploaded by ingester or compactor, and blocks deleted (or marked for deletion) by compactor.
3615+
3616+When the bucket index is enabled, the querier, store-gateway and ruler periodically look up the per-tenant bucket index instead of scanning the bucket via "list objects" operations. This brings few benefits:
3617+
3618+1. Reduced number of API calls to the object storage by querier and store-gateway
3619+2. No "list objects" storage API calls done by querier and store-gateway
3620+3. The [querier](./querier.md) is up and running immediately after the startup (no need to run an initial bucket scan)
3621+
3622+## Structure of the index
3623+
3624+The `bucket-index.json.gz` contains:
3625+
3626+- **`blocks`**<br />
3627+ List of complete blocks of a tenant, including blocks marked for deletion (partial blocks are excluded from the index).
3628+- **`block_deletion_marks`**<br />
3629+ List of block deletion marks.
3630+- **`updated_at`**<br />
3631+ Unix timestamp (seconds precision) of when the index has been updated (written in the storage) the last time.
3632+
3633+## How it gets updated
3634+
3635+The [compactor](./compactor.md) periodically scans the bucket and uploads an updated bucket index to the storage. The frequency at which the bucket index is updated can be configured via `-compactor.cleanup-interval`.
3636+
3637+Despite using the bucket index is optional, the index itself is built and updated by the compactor even if `-blocks-storage.bucket-store.bucket-index.enabled` has **not** been enabled. This is intentional, so that once a Cortex cluster operator decides to enable the bucket index in a live cluster, the bucket index for any tenant is already existing and query results consistency is guaranteed. The overhead introduced by keeping the bucket index updated is expected to be non significative.
3638+
3639+## How it's used by the querier
3640+
3641+At query time the [querier](./querier.md) and ruler check whether the bucket index for the tenant has already been loaded in memory. If not, the querier and ruler download it from the storage and cache it in memory.
3642+
3643+_Given it's a small file, lazy downloading it doesn't significantly impact on first query performances, but allows to get a querier up and running without pre-downloading every tenant's bucket index. Moreover, if the [metadata cache](./querier.md#metadata-cache) is enabled, the bucket index will be cached for a short time in a shared cache, reducing the actual latency and number of API calls to the object storage in case multiple queriers and rulers will fetch the same tenant's bucket index in a short time._
3644+
3645+![Querier - Bucket index](/images/blocks-storage/bucket-index-querier-workflow.png)
3646+<!-- Diagram source at https://docs.google.com/presentation/d/1bHp8_zcoWCYoNU2AhO2lSagQyuIrghkCncViSqn14cU/edit -->
3647+
3648+While in-memory, a background process will keep it **updated at periodic intervals**, so that subsequent queries from the same tenant to the same querier instance will use the cached (and periodically updated) bucket index. There are two config options involved:
3649+
3650+- `-blocks-storage.bucket-store.sync-interval`<br />
3651+ This option configures how frequently a cached bucket index should be refreshed.
3652+- `-blocks-storage.bucket-store.bucket-index.update-on-error-interval`<br />
3653+ If downloading a bucket index fails, the failure is cached for a short time in order to avoid hammering the backend storage. This option configures how frequently a bucket index, which previously failed to load, should be tried to load again.
3654+
3655+If a bucket index is unused for a long time (configurable via `-blocks-storage.bucket-store.bucket-index.idle-timeout`), e.g. because that querier instance is not receiving any query from the tenant, the querier will offload it, stopping to keep it updated at regular intervals. This is particularly for tenants which are resharded to different queriers when [shuffle sharding](../guides/shuffle-sharding.md) is enabled.
3656+
3657+Finally, at query time the querier and ruler check how old a bucket index is (based on its `updated_at`) and fail a query if its age is older than `-blocks-storage.bucket-store.bucket-index.max-stale-period`. This circuit breaker is used to ensure queriers and rulers will not return any partial query results due to a stale view over the long-term storage.
3658+
3659+## How it's used by the store-gateway
3660+
3661+The [store-gateway](./store-gateway.md), at startup and periodically, fetches the bucket index for each tenant belonging to their shard and uses it as the source of truth for the blocks (and deletion marks) in the storage. This removes the need to periodically scan the bucket to discover blocks belonging to their shard.
3662diff --git a/docs/blocks-storage/compactor.md b/docs/blocks-storage/compactor.md
3663index f4721b0..bcea40d 100644
3664--- a/docs/blocks-storage/compactor.md
3665+++ b/docs/blocks-storage/compactor.md
3666@@ -7,13 +7,16 @@ slug: compactor
3667
3668 <!-- DO NOT EDIT THIS FILE - This file has been automatically generated from its .template -->
3669
3670-The **compactor** is an optional service which compacts multiple blocks of a given tenant into a single optimized larger block. Running compactor is **highly recommended** to reduce storage costs (deduplication, index size reduction), and increase query speed (querying fewer blocks is faster).
3671+The **compactor** is an service which is responsible to:
3672+
3673+- Compact multiple blocks of a given tenant into a single optimized larger block. This helps to reduce storage costs (deduplication, index size reduction), and increase query speed (querying fewer blocks is faster).
3674+- Keep the per-tenant bucket index updated. The [bucket index](./bucket-index.md) is used by [queriers](./querier.md), [store-gateways](./store-gateway.md) and rulers to discover new blocks in the storage.
3675
3676 The compactor is **stateless**.
3677
3678-## How it works
3679+## How compaction works
3680
3681-The compactor has two main benefits:
3682+The blocks compaction has two main benefits:
3683
3684 1. Vertically compact blocks uploaded by all ingesters for the same time range
3685 2. Horizontally compact blocks with small time ranges into a single larger block
3686@@ -38,6 +41,14 @@ The compactor sharding is based on the Cortex [hash ring](../architecture.md#the
3687
3688 This feature can be enabled via `-compactor.sharding-enabled=true` and requires the backend [hash ring](../architecture.md#the-hash-ring) to be configured via `-compactor.ring.*` flags (or their respective YAML config options).
3689
3690+### Waiting for stable ring at startup
3691+
3692+In the event of a cluster cold start or scale up of 2+ compactor instances at the same time we may end up in a situation where each new compactor instance starts at a slightly different time and thus each one runs the first compaction based on a different state of the ring. This is not a critical condition, but may be inefficient, because multiple compactor replicas may start compacting the same tenant nearly at the same time.
3693+
3694+To reduce the likelihood this could happen, the compactor waits for a stable ring at startup. A ring is considered stable if no instance is added/removed to the ring for at least `-compactor.ring.wait-stability-min-duration`. If the ring keep getting changed after `-compactor.ring.wait-stability-max-duration`, the compactor will stop waiting for a stable ring and will proceed starting up normally.
3695+
3696+To disable this waiting logic, you can start the compactor with `-compactor.ring.wait-stability-min-duration=0`.
3697+
3698 ## Soft and hard blocks deletion
3699
3700 When the compactor successfully compacts some source blocks into a larger block, source blocks are deleted from the storage. Blocks deletion is not immediate, but follows a two steps process:
3701@@ -105,8 +116,7 @@ compactor:
3702 # CLI flag: -compactor.compaction-interval
3703 [compaction_interval: <duration> | default = 1h]
3704
3705- # How many times to retry a failed compaction during a single compaction
3706- # interval
3707+ # How many times to retry a failed compaction within a single compaction run.
3708 # CLI flag: -compactor.compaction-retries
3709 [compaction_retries: <int> | default = 3]
3710
3711@@ -114,16 +124,48 @@ compactor:
3712 # CLI flag: -compactor.compaction-concurrency
3713 [compaction_concurrency: <int> | default = 1]
3714
3715+ # How frequently compactor should run blocks cleanup and maintenance, as well
3716+ # as update the bucket index.
3717+ # CLI flag: -compactor.cleanup-interval
3718+ [cleanup_interval: <duration> | default = 15m]
3719+
3720+ # Max number of tenants for which blocks cleanup and maintenance should run
3721+ # concurrently.
3722+ # CLI flag: -compactor.cleanup-concurrency
3723+ [cleanup_concurrency: <int> | default = 20]
3724+
3725 # Time before a block marked for deletion is deleted from bucket. If not 0,
3726- # blocks will be marked for deletion and compactor component will delete
3727- # blocks marked for deletion from the bucket. If delete-delay is 0, blocks
3728- # will be deleted straight away. Note that deleting blocks immediately can
3729- # cause query failures, if store gateway still has the block loaded, or
3730- # compactor is ignoring the deletion because it's compacting the block at the
3731- # same time.
3732+ # blocks will be marked for deletion and compactor component will permanently
3733+ # delete blocks marked for deletion from the bucket. If 0, blocks will be
3734+ # deleted straight away. Note that deleting blocks immediately can cause query
3735+ # failures.
3736 # CLI flag: -compactor.deletion-delay
3737 [deletion_delay: <duration> | default = 12h]
3738
3739+ # For tenants marked for deletion, this is time between deleting of last
3740+ # block, and doing final cleanup (marker files, debug files) of the tenant.
3741+ # CLI flag: -compactor.tenant-cleanup-delay
3742+ [tenant_cleanup_delay: <duration> | default = 6h]
3743+
3744+ # When enabled, at compactor startup the bucket will be scanned and all found
3745+ # deletion marks inside the block location will be copied to the markers
3746+ # global location too. This option can (and should) be safely disabled as soon
3747+ # as the compactor has successfully run at least once.
3748+ # CLI flag: -compactor.block-deletion-marks-migration-enabled
3749+ [block_deletion_marks_migration_enabled: <boolean> | default = true]
3750+
3751+ # Comma separated list of tenants that can be compacted. If specified, only
3752+ # these tenants will be compacted by compactor, otherwise all tenants can be
3753+ # compacted. Subject to sharding.
3754+ # CLI flag: -compactor.enabled-tenants
3755+ [enabled_tenants: <string> | default = ""]
3756+
3757+ # Comma separated list of tenants that cannot be compacted by this compactor.
3758+ # If specified, and compactor would normally pick given tenant for compaction
3759+ # (via -compactor.enabled-tenants or sharding), it will be ignored instead.
3760+ # CLI flag: -compactor.disabled-tenants
3761+ [disabled_tenants: <string> | default = ""]
3762+
3763 # Shard tenants across multiple compactor instances. Sharding is required if
3764 # you run multiple compactor instances, in order to coordinate compactions and
3765 # avoid race conditions leading to the same tenant blocks simultaneously
3766@@ -175,4 +217,17 @@ compactor:
3767 # within the ring.
3768 # CLI flag: -compactor.ring.heartbeat-timeout
3769 [heartbeat_timeout: <duration> | default = 1m]
3770+
3771+ # Minimum time to wait for ring stability at startup. 0 to disable.
3772+ # CLI flag: -compactor.ring.wait-stability-min-duration
3773+ [wait_stability_min_duration: <duration> | default = 1m]
3774+
3775+ # Maximum time to wait for ring stability at startup. If the compactor ring
3776+ # keep changing after this period of time, the compactor will start anyway.
3777+ # CLI flag: -compactor.ring.wait-stability-max-duration
3778+ [wait_stability_max_duration: <duration> | default = 5m]
3779+
3780+ # Name of network interface to read address from.
3781+ # CLI flag: -compactor.ring.instance-interface-names
3782+ [instance_interface_names: <list of string> | default = [eth0 en0]]
3783 ```
3784diff --git a/docs/blocks-storage/compactor.template b/docs/blocks-storage/compactor.template
3785index 102bb0a..5de4e9c 100644
3786--- a/docs/blocks-storage/compactor.template
3787+++ b/docs/blocks-storage/compactor.template
3788@@ -7,13 +7,16 @@ slug: compactor
3789
3790 {{ .GeneratedFileWarning }}
3791
3792-The **compactor** is an optional service which compacts multiple blocks of a given tenant into a single optimized larger block. Running compactor is **highly recommended** to reduce storage costs (deduplication, index size reduction), and increase query speed (querying fewer blocks is faster).
3793+The **compactor** is an service which is responsible to:
3794+
3795+- Compact multiple blocks of a given tenant into a single optimized larger block. This helps to reduce storage costs (deduplication, index size reduction), and increase query speed (querying fewer blocks is faster).
3796+- Keep the per-tenant bucket index updated. The [bucket index](./bucket-index.md) is used by [queriers](./querier.md), [store-gateways](./store-gateway.md) and rulers to discover new blocks in the storage.
3797
3798 The compactor is **stateless**.
3799
3800-## How it works
3801+## How compaction works
3802
3803-The compactor has two main benefits:
3804+The blocks compaction has two main benefits:
3805
3806 1. Vertically compact blocks uploaded by all ingesters for the same time range
3807 2. Horizontally compact blocks with small time ranges into a single larger block
3808@@ -38,6 +41,14 @@ The compactor sharding is based on the Cortex [hash ring](../architecture.md#the
3809
3810 This feature can be enabled via `-compactor.sharding-enabled=true` and requires the backend [hash ring](../architecture.md#the-hash-ring) to be configured via `-compactor.ring.*` flags (or their respective YAML config options).
3811
3812+### Waiting for stable ring at startup
3813+
3814+In the event of a cluster cold start or scale up of 2+ compactor instances at the same time we may end up in a situation where each new compactor instance starts at a slightly different time and thus each one runs the first compaction based on a different state of the ring. This is not a critical condition, but may be inefficient, because multiple compactor replicas may start compacting the same tenant nearly at the same time.
3815+
3816+To reduce the likelihood this could happen, the compactor waits for a stable ring at startup. A ring is considered stable if no instance is added/removed to the ring for at least `-compactor.ring.wait-stability-min-duration`. If the ring keep getting changed after `-compactor.ring.wait-stability-max-duration`, the compactor will stop waiting for a stable ring and will proceed starting up normally.
3817+
3818+To disable this waiting logic, you can start the compactor with `-compactor.ring.wait-stability-min-duration=0`.
3819+
3820 ## Soft and hard blocks deletion
3821
3822 When the compactor successfully compacts some source blocks into a larger block, source blocks are deleted from the storage. Blocks deletion is not immediate, but follows a two steps process:
3823diff --git a/docs/blocks-storage/convert-stored-chunks-to-blocks.md b/docs/blocks-storage/convert-stored-chunks-to-blocks.md
3824index 88ab405..4afd765 100644
3825--- a/docs/blocks-storage/convert-stored-chunks-to-blocks.md
3826+++ b/docs/blocks-storage/convert-stored-chunks-to-blocks.md
3827@@ -23,6 +23,8 @@ Tools are:
3828 Looks for plan files, and distributes them to builders. Scheduler has global view of overall conversion progress.
3829 - [**Builder**](#builder)<br />
3830 Asks scheduler for next plan file to work on, fetches chunks, puts them into TSDB block, and uploads the block to the object store. It repeats this process until there are no more plans.
3831+- [**Cleaner**](#cleaner)<br />
3832+ Cleaner asks scheduler for next plan file to work on, but instead of building the block, it actually **REMOVES CHUNKS** and **INDEX ENTRIES** from the Index database.
3833
3834 All tools start HTTP server (see `-server.http*` options) exposing the `/metrics` endpoint.
3835 All tools also start gRPC server (`-server.grpc*` options), but only Scheduler exposes services on it.
3836@@ -38,6 +40,7 @@ Scanner is started by running `blocksconvert -target=scanner`. Scanner requires
3837 - `-scanner.allowed-users` – comma-separated list of Cortex tenants that should have plans generated. If empty, plans for all found users are generated.
3838 - `-scanner.ignore-users-regex` - If plans for all users are generated (`-scanner.allowed-users` is not set), then users matching this non-empty regular expression will be skipped.
3839 - `-scanner.tables-limit` – How many tables should be scanned? By default all tables are scanned, but when testing scanner it may be useful to start with small number of tables first.
3840+- `-scanner.tables` – Comma-separated list of tables to be scanned. Can be used to scan specific tables only. Note that schema is still used to find all tables first, and then this list is consulted to select only specified tables.
3841
3842 Scanner will read the Cortex schema file to discover Index tables, and then it will start scanning them from most-recent table first, going back.
3843 For each table, it will fully read the table and generate a plan for each user and day stored in the table.
3844@@ -83,9 +86,28 @@ Builders are CPU intensive (decoding and merging chunks), and require fast disk
3845
3846 Builders's metrics have `cortex_blocksconvert_builder` prefix, and include total number of fetched chunks and their size, read position of the current plan and plan size, total number of written series and samples, number of chunks that couldn't be downloaded.
3847
3848+### Cleaner
3849+
3850+Cleaner is similar to builder in that it asks scheduler for next plan to work on, but instead of building blocks, it actually **REMOVES CHUNKS and INDEX ENTRIES**. Use with caution.
3851+
3852+Cleaner is started by using `blocksconvert -target=cleaner`. Like Builder, it needs Scheduler endpoint, Cortex schema file, index and chunk-store specific options. Note that Cleaner works with any index store supported by Cortex, not just BigTable.
3853+
3854+- `-cleaner.scheduler-endpoint` – where to find scheduler
3855+- `-blocks-storage.*` – blocks storage configuration, used for downloading plan files
3856+- `-cleaner.plans-dir` – local directory to store plan file while it is being processed by Cleaner.
3857+- `-schema-config-file` – Cortex schema file.
3858+
3859+Cleaner doesn't **scan** for index entries, but uses existing plan files to find chunks and index entries. For each series, Cleaner needs to download at least one chunk. This is because plan file doesn't contain label names and values, but chunks do. Cleaner will then delete all index entries associated with the series, and also all chunks.
3860+
3861+**WARNING:** If both Builder and Cleaner run at the same time and use use the same Scheduler, **some plans will be handled by builder, and some by cleaner!** This will result in a loss of data!
3862+
3863+Cleaner should only be deployed if no other Builder is running. Running multiple Cleaners at once is not supported, and will result in leftover chunks and index entries. Reason for this is that chunks can span multiple days, and chunk is fully deleted only when processing plan (day) when chunk started. Since cleaner also needs to download some chunks to be able to clean up all index entries, when using multiple cleaners, it can happen that cleaner processing older plans will delete chunks required to properly clean up data in newer plans. When using single cleaner only, this is not a problem, since scheduler sends plans to cleaner in time-reversed order.
3864+
3865+**Note:** Cleaner is designed for use in very special cases, eg. when deleting chunks and index entries for a specific customer. If `blocksconvert` was used to convert ALL chunks to blocks, it is simpler to just drop the index and chunks database afterwards. In such case, Cleaner is not needed.
3866+
3867 ### Limitations
3868
3869 The `blocksconvert` toolset currently has the following limitations:
3870
3871-- Supports only BigTable for chunks index backend
3872+- Scanner supports only BigTable for chunks index backend, and cannot currently scan other databases.
3873 - Supports only chunks schema versions v9, v10 and v11
3874diff --git a/docs/blocks-storage/learn-more.md b/docs/blocks-storage/learn-more.md
3875new file mode 100644
3876index 0000000..5dd7d65
3877--- /dev/null
3878+++ b/docs/blocks-storage/learn-more.md
3879@@ -0,0 +1,21 @@
3880+---
3881+title: "Learn more"
3882+linkTitle: "Learn more"
3883+weight: 100
3884+slug: learn-more
3885+---
3886+
3887+In this page we're listing some external resources to learn more about the Cortex blocks storage.
3888+
3889+## Talks
3890+
3891+### Scaling Prometheus: How We Got Some Thanos Into Cortex
3892+
3893+<iframe width="560" height="315" src="https://www.youtube.com/embed/Z5OJzRogAS4" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
3894+
3895+## Articles
3896+
3897+- [How to switch Cortex from chunks to blocks storage (and why you won’t look back)](https://grafana.com/blog/2020/10/19/how-to-switch-cortex-from-chunks-to-blocks-storage-and-why-you-wont-look-back/) (Oct 2020)
3898+- [Now GA: Cortex blocks storage for running Prometheus at scale with reduced operational complexity](https://grafana.com/blog/2020/10/06/now-ga-cortex-blocks-storage-for-running-prometheus-at-scale-with-reduced-operational-complexity/) (Oct 2020)
3899+- [Scaling Prometheus: How we’re pushing Cortex blocks storage to its limit and beyond](https://grafana.com/blog/2020/08/12/scaling-prometheus-how-were-pushing-cortex-blocks-storage-to-its-limit-and-beyond/) (Aug 2020)
3900+- [How blocks storage in Cortex reduces operational complexity for running Prometheus at massive scale](https://grafana.com/blog/2020/07/29/how-blocks-storage-in-cortex-reduces-operational-complexity-for-running-prometheus-at-massive-scale/) (Jul 2020)
3901diff --git a/docs/blocks-storage/production-tips.md b/docs/blocks-storage/production-tips.md
3902index 0f12e04..50238f0 100644
3903--- a/docs/blocks-storage/production-tips.md
3904+++ b/docs/blocks-storage/production-tips.md
3905@@ -7,6 +7,16 @@ slug: production-tips
3906
3907 This page shares some tips and things to take in consideration when setting up a production Cortex cluster based on the blocks storage.
3908
3909+## Ingester
3910+
3911+### Ensure a high number of max open file descriptors
3912+
3913+The ingester stores received series into per-tenant TSDB blocks. Both TSDB WAL, head and compacted blocks are composed by a relatively large number of files which gets loaded via mmap. This means that the ingester keeps file descriptors open for TSDB WAL segments, chunk files and compacted blocks which haven't reached the retention period yet.
3914+
3915+If your Cortex cluster has many tenants or ingester is running with a long `-blocks-storage.tsdb.retention-period`, the ingester may hit the **`file-max` ulimit** (maximum number of open file descriptions by a process); in such case, we recommend increasing the limit on your system or enabling [shuffle sharding](../guides/shuffle-sharding.md).
3916+
3917+The rule of thumb is that a production system shouldn't have the `file-max` ulimit below `65536`, but higher values are recommended (eg. `1048576`).
3918+
3919 ## Querier
3920
3921 ### Ensure caching is enabled
3922@@ -53,6 +63,8 @@ The store-gateway heavily relies on caching both to speed up the queries and to
3923
3924 The store-gateway stores each block’s index-header on the local disk and loads it via mmap. This means that the store-gateway keeps a file descriptor open for each loaded block. If your Cortex cluster has many blocks in the bucket, the store-gateway may hit the **`file-max` ulimit** (maximum number of open file descriptions by a process); in such case, we recommend increasing the limit on your system or running more store-gateway instances with blocks sharding enabled.
3925
3926+The rule of thumb is that a production system shouldn't have the `file-max` ulimit below `65536`, but higher values are recommended (eg. `1048576`).
3927+
3928 ## Compactor
3929
3930 ### Ensure the compactor has enough disk space
3931diff --git a/docs/blocks-storage/querier.md b/docs/blocks-storage/querier.md
3932index 6a03b97..5e6351b 100644
3933--- a/docs/blocks-storage/querier.md
3934+++ b/docs/blocks-storage/querier.md
3935@@ -13,12 +13,28 @@ The querier is **stateless**.
3936
3937 ## How it works
3938
3939-At startup **queriers** iterate over the entire storage bucket to discover all tenants blocks and download the `meta.json` for each block. During this initial bucket scanning phase, a querier is not ready to handle incoming queries yet and its `/ready` readiness probe endpoint will fail.
3940+The querier needs to have an almost up-to-date view over the entire storage bucket, in order to find the right blocks to lookup at query time. The querier can keep the bucket view updated in to two different ways:
3941+
3942+1. Periodically scanning the bucket (default)
3943+2. Periodically downloading the [bucket index](./bucket-index.md)
3944+
3945+### Bucket index disabled (default)
3946+
3947+At startup, **queriers** iterate over the entire storage bucket to discover all tenants blocks and download the `meta.json` for each block. During this initial bucket scanning phase, a querier is not ready to handle incoming queries yet and its `/ready` readiness probe endpoint will fail.
3948
3949 While running, queriers periodically iterate over the storage bucket to discover new tenants and recently uploaded blocks. Queriers do **not** download any content from blocks except a small `meta.json` file containing the block's metadata (including the minimum and maximum timestamp of samples within the block).
3950
3951 Queriers use the metadata to compute the list of blocks that need to be queried at query time and fetch matching series from the [store-gateway](./store-gateway.md) instances holding the required blocks.
3952
3953+### Bucket index enabled
3954+
3955+When [bucket index](./bucket-index.md) is enabled, queriers lazily download the bucket index upon the first query received for a given tenant, cache it in memory and periodically keep it update. The bucket index contains the list of blocks and block deletion marks of a tenant, which is later used during the query execution to find the set of blocks that need to be queried for the given query.
3956+
3957+Given the bucket index removes the need to scan the bucket, it brings few benefits:
3958+
3959+1. The querier is expected to be ready shortly after startup.
3960+2. Lower volume of API calls to object storage.
3961+
3962 ### Anatomy of a query request
3963
3964 When a querier receives a query range request, it contains the following parameters:
3965@@ -60,6 +76,7 @@ Caching is optional, but **highly recommended** in a production environment. Ple
3966 - List of blocks per tenant
3967 - Block's `meta.json` content
3968 - Block's `deletion-mark.json` existence and content
3969+- Tenant's `bucket-index.json.gz` content
3970
3971 Using the metadata cache can significantly reduce the number of API calls to object storage and protects from linearly scale the number of these API calls with the number of querier and store-gateway instances (because the bucket is periodically scanned and synched by each querier and store-gateway).
3972
3973@@ -110,11 +127,16 @@ querier:
3974 # CLI flag: -querier.query-ingesters-within
3975 [query_ingesters_within: <duration> | default = 0s]
3976
3977- # The time after which a metric should only be queried from storage and not
3978- # just ingesters. 0 means all queries are sent to store. When running the
3979- # blocks storage, if this option is enabled, the time range of the query sent
3980- # to the store will be manipulated to ensure the query end is not more recent
3981- # than 'now - query-store-after'.
3982+ # Query long-term store for series, label values and label names APIs. Works
3983+ # only with blocks engine.
3984+ # CLI flag: -querier.query-store-for-labels-enabled
3985+ [query_store_for_labels_enabled: <boolean> | default = false]
3986+
3987+ # The time after which a metric should be queried from storage and not just
3988+ # ingesters. 0 means all queries are sent to store. When running the blocks
3989+ # storage, if this option is enabled, the time range of the query sent to the
3990+ # store will be manipulated to ensure the query end is not more recent than
3991+ # 'now - query-store-after'.
3992 # CLI flag: -querier.query-store-after
3993 [query_store_after: <duration> | default = 0s]
3994
3995@@ -173,6 +195,15 @@ querier:
3996 # Default value 0 means secondary store is always queried.
3997 # CLI flag: -querier.use-second-store-before-time
3998 [use_second_store_before_time: <time> | default = 0]
3999+
4000+ # When distributor's sharding strategy is shuffle-sharding and this setting is
4001+ # > 0, queriers fetch in-memory series from the minimum set of required
4002+ # ingesters, selecting only ingesters which may have received series since
4003+ # 'now - lookback period'. The lookback period should be greater or equal than
4004+ # the configured 'query store after'. If this setting is 0, queriers always
4005+ # query all ingesters (ingesters shuffle sharding on read path is disabled).
4006+ # CLI flag: -querier.shuffle-sharding-ingesters-lookback-period
4007+ [shuffle_sharding_ingesters_lookback_period: <duration> | default = 0s]
4008 ```
4009
4010 ### `blocks_storage_config`
4011@@ -181,7 +212,8 @@ The `blocks_storage_config` configures the blocks storage.
4012
4013 ```yaml
4014 blocks_storage:
4015- # Backend storage to use. Supported backends are: s3, gcs, azure, filesystem.
4016+ # Backend storage to use. Supported backends are: s3, gcs, azure, swift,
4017+ # filesystem.
4018 # CLI flag: -blocks-storage.backend
4019 [backend: <string> | default = "s3"]
4020
4021@@ -210,6 +242,25 @@ blocks_storage:
4022 # CLI flag: -blocks-storage.s3.insecure
4023 [insecure: <boolean> | default = false]
4024
4025+ # The signature version to use for authenticating against S3. Supported
4026+ # values are: v4, v2.
4027+ # CLI flag: -blocks-storage.s3.signature-version
4028+ [signature_version: <string> | default = "v4"]
4029+
4030+ http:
4031+ # The time an idle connection will remain idle before closing.
4032+ # CLI flag: -blocks-storage.s3.http.idle-conn-timeout
4033+ [idle_conn_timeout: <duration> | default = 1m30s]
4034+
4035+ # The amount of time the client will wait for a servers response headers.
4036+ # CLI flag: -blocks-storage.s3.http.response-header-timeout
4037+ [response_header_timeout: <duration> | default = 2m]
4038+
4039+ # If the client connects to S3 via HTTPS and this option is enabled, the
4040+ # client will accept any certificate and hostname.
4041+ # CLI flag: -blocks-storage.s3.http.insecure-skip-verify
4042+ [insecure_skip_verify: <boolean> | default = false]
4043+
4044 gcs:
4045 # GCS bucket name
4046 # CLI flag: -blocks-storage.gcs.bucket-name
4047@@ -243,22 +294,100 @@ blocks_storage:
4048 # CLI flag: -blocks-storage.azure.max-retries
4049 [max_retries: <int> | default = 20]
4050
4051+ swift:
4052+ # OpenStack Swift authentication API version. 0 to autodetect.
4053+ # CLI flag: -blocks-storage.swift.auth-version
4054+ [auth_version: <int> | default = 0]
4055+
4056+ # OpenStack Swift authentication URL
4057+ # CLI flag: -blocks-storage.swift.auth-url
4058+ [auth_url: <string> | default = ""]
4059+
4060+ # OpenStack Swift username.
4061+ # CLI flag: -blocks-storage.swift.username
4062+ [username: <string> | default = ""]
4063+
4064+ # OpenStack Swift user's domain name.
4065+ # CLI flag: -blocks-storage.swift.user-domain-name
4066+ [user_domain_name: <string> | default = ""]
4067+
4068+ # OpenStack Swift user's domain ID.
4069+ # CLI flag: -blocks-storage.swift.user-domain-id
4070+ [user_domain_id: <string> | default = ""]
4071+
4072+ # OpenStack Swift user ID.
4073+ # CLI flag: -blocks-storage.swift.user-id
4074+ [user_id: <string> | default = ""]
4075+
4076+ # OpenStack Swift API key.
4077+ # CLI flag: -blocks-storage.swift.password
4078+ [password: <string> | default = ""]
4079+
4080+ # OpenStack Swift user's domain ID.
4081+ # CLI flag: -blocks-storage.swift.domain-id
4082+ [domain_id: <string> | default = ""]
4083+
4084+ # OpenStack Swift user's domain name.
4085+ # CLI flag: -blocks-storage.swift.domain-name
4086+ [domain_name: <string> | default = ""]
4087+
4088+ # OpenStack Swift project ID (v2,v3 auth only).
4089+ # CLI flag: -blocks-storage.swift.project-id
4090+ [project_id: <string> | default = ""]
4091+
4092+ # OpenStack Swift project name (v2,v3 auth only).
4093+ # CLI flag: -blocks-storage.swift.project-name
4094+ [project_name: <string> | default = ""]
4095+
4096+ # ID of the OpenStack Swift project's domain (v3 auth only), only needed if
4097+ # it differs the from user domain.
4098+ # CLI flag: -blocks-storage.swift.project-domain-id
4099+ [project_domain_id: <string> | default = ""]
4100+
4101+ # Name of the OpenStack Swift project's domain (v3 auth only), only needed
4102+ # if it differs from the user domain.
4103+ # CLI flag: -blocks-storage.swift.project-domain-name
4104+ [project_domain_name: <string> | default = ""]
4105+
4106+ # OpenStack Swift Region to use (v2,v3 auth only).
4107+ # CLI flag: -blocks-storage.swift.region-name
4108+ [region_name: <string> | default = ""]
4109+
4110+ # Name of the OpenStack Swift container to put chunks in.
4111+ # CLI flag: -blocks-storage.swift.container-name
4112+ [container_name: <string> | default = ""]
4113+
4114+ # Max retries on requests error.
4115+ # CLI flag: -blocks-storage.swift.max-retries
4116+ [max_retries: <int> | default = 3]
4117+
4118+ # Time after which a connection attempt is aborted.
4119+ # CLI flag: -blocks-storage.swift.connect-timeout
4120+ [connect_timeout: <duration> | default = 10s]
4121+
4122+ # Time after which an idle request is aborted. The timeout watchdog is reset
4123+ # each time some data is received, so the timeout triggers after X time no
4124+ # data is received on a request.
4125+ # CLI flag: -blocks-storage.swift.request-timeout
4126+ [request_timeout: <duration> | default = 5s]
4127+
4128 filesystem:
4129 # Local filesystem storage directory.
4130 # CLI flag: -blocks-storage.filesystem.dir
4131 [dir: <string> | default = ""]
4132
4133- # This configures how the store-gateway synchronizes blocks stored in the
4134- # bucket.
4135+ # This configures how the querier and store-gateway discover and synchronize
4136+ # blocks stored in the bucket.
4137 bucket_store:
4138 # Directory to store synchronized TSDB index headers.
4139 # CLI flag: -blocks-storage.bucket-store.sync-dir
4140 [sync_dir: <string> | default = "tsdb-sync"]
4141
4142- # How frequently scan the bucket to look for changes (new blocks shipped by
4143- # ingesters and blocks removed by retention or compaction). 0 disables it.
4144+ # How frequently to scan the bucket, or to refresh the bucket index (if
4145+ # enabled), in order to look for changes (new blocks shipped by ingesters
4146+ # and blocks deleted by retention or compaction).
4147 # CLI flag: -blocks-storage.bucket-store.sync-interval
4148- [sync_interval: <duration> | default = 5m]
4149+ [sync_interval: <duration> | default = 15m]
4150
4151 # Max size - in bytes - of a per-tenant chunk pool, used to reduce memory
4152 # allocations.
4153@@ -331,7 +460,7 @@ blocks_storage:
4154 [max_get_multi_concurrency: <int> | default = 100]
4155
4156 # The maximum number of keys a single underlying get operation should
4157- # run. If more keys are specified, internally keys are splitted into
4158+ # run. If more keys are specified, internally keys are split into
4159 # multiple batches and fetched concurrently, honoring the max
4160 # concurrency. If set to 0, the max batch size is unlimited.
4161 # CLI flag: -blocks-storage.bucket-store.index-cache.memcached.max-get-multi-batch-size
4162@@ -342,7 +471,8 @@ blocks_storage:
4163 # CLI flag: -blocks-storage.bucket-store.index-cache.memcached.max-item-size
4164 [max_item_size: <int> | default = 1048576]
4165
4166- # Compress postings before storing them to postings cache.
4167+ # Deprecated: compress postings before storing them to postings cache.
4168+ # This option is unused and postings compression is always enabled.
4169 # CLI flag: -blocks-storage.bucket-store.index-cache.postings-compression-enabled
4170 [postings_compression_enabled: <boolean> | default = false]
4171
4172@@ -382,7 +512,7 @@ blocks_storage:
4173 [max_get_multi_concurrency: <int> | default = 100]
4174
4175 # The maximum number of keys a single underlying get operation should
4176- # run. If more keys are specified, internally keys are splitted into
4177+ # run. If more keys are specified, internally keys are split into
4178 # multiple batches and fetched concurrently, honoring the max
4179 # concurrency. If set to 0, the max batch size is unlimited.
4180 # CLI flag: -blocks-storage.bucket-store.chunks-cache.memcached.max-get-multi-batch-size
4181@@ -406,7 +536,7 @@ blocks_storage:
4182
4183 # TTL for caching object attributes for chunks.
4184 # CLI flag: -blocks-storage.bucket-store.chunks-cache.attributes-ttl
4185- [attributes_ttl: <duration> | default = 24h]
4186+ [attributes_ttl: <duration> | default = 168h]
4187
4188 # TTL for caching individual chunks subranges.
4189 # CLI flag: -blocks-storage.bucket-store.chunks-cache.subrange-ttl
4190@@ -448,7 +578,7 @@ blocks_storage:
4191 [max_get_multi_concurrency: <int> | default = 100]
4192
4193 # The maximum number of keys a single underlying get operation should
4194- # run. If more keys are specified, internally keys are splitted into
4195+ # run. If more keys are specified, internally keys are split into
4196 # multiple batches and fetched concurrently, honoring the max
4197 # concurrency. If set to 0, the max batch size is unlimited.
4198 # CLI flag: -blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-batch-size
4199@@ -471,11 +601,13 @@ blocks_storage:
4200 # CLI flag: -blocks-storage.bucket-store.metadata-cache.chunks-list-ttl
4201 [chunks_list_ttl: <duration> | default = 24h]
4202
4203- # How long to cache information that block metafile exists.
4204+ # How long to cache information that block metafile exists. Also used for
4205+ # user deletion mark file.
4206 # CLI flag: -blocks-storage.bucket-store.metadata-cache.metafile-exists-ttl
4207 [metafile_exists_ttl: <duration> | default = 2h]
4208
4209- # How long to cache information that block metafile doesn't exist.
4210+ # How long to cache information that block metafile doesn't exist. Also
4211+ # used for user deletion mark file.
4212 # CLI flag: -blocks-storage.bucket-store.metadata-cache.metafile-doesnt-exist-ttl
4213 [metafile_doesnt_exist_ttl: <duration> | default = 5m]
4214
4215@@ -483,10 +615,34 @@ blocks_storage:
4216 # CLI flag: -blocks-storage.bucket-store.metadata-cache.metafile-content-ttl
4217 [metafile_content_ttl: <duration> | default = 24h]
4218
4219- # Maximum size of metafile content to cache in bytes.
4220+ # Maximum size of metafile content to cache in bytes. Caching will be
4221+ # skipped if the content exceeds this size. This is useful to avoid
4222+ # network round trip for large content if the configured caching backend
4223+ # has an hard limit on cached items size (in this case, you should set
4224+ # this limit to the same limit in the caching backend).
4225 # CLI flag: -blocks-storage.bucket-store.metadata-cache.metafile-max-size-bytes
4226 [metafile_max_size_bytes: <int> | default = 1048576]
4227
4228+ # How long to cache attributes of the block metafile.
4229+ # CLI flag: -blocks-storage.bucket-store.metadata-cache.metafile-attributes-ttl
4230+ [metafile_attributes_ttl: <duration> | default = 168h]
4231+
4232+ # How long to cache attributes of the block index.
4233+ # CLI flag: -blocks-storage.bucket-store.metadata-cache.block-index-attributes-ttl
4234+ [block_index_attributes_ttl: <duration> | default = 168h]
4235+
4236+ # How long to cache content of the bucket index.
4237+ # CLI flag: -blocks-storage.bucket-store.metadata-cache.bucket-index-content-ttl
4238+ [bucket_index_content_ttl: <duration> | default = 5m]
4239+
4240+ # Maximum size of bucket index content to cache in bytes. Caching will be
4241+ # skipped if the content exceeds this size. This is useful to avoid
4242+ # network round trip for large content if the configured caching backend
4243+ # has an hard limit on cached items size (in this case, you should set
4244+ # this limit to the same limit in the caching backend).
4245+ # CLI flag: -blocks-storage.bucket-store.metadata-cache.bucket-index-max-size-bytes
4246+ [bucket_index_max_size_bytes: <int> | default = 1048576]
4247+
4248 # Duration after which the blocks marked for deletion will be filtered out
4249 # while fetching blocks. The idea of ignore-deletion-marks-delay is to
4250 # ignore blocks that are marked for deletion with some delay. This ensures
4251@@ -496,6 +652,30 @@ blocks_storage:
4252 # CLI flag: -blocks-storage.bucket-store.ignore-deletion-marks-delay
4253 [ignore_deletion_mark_delay: <duration> | default = 6h]
4254
4255+ bucket_index:
4256+ # True to enable querier and store-gateway to discover blocks in the
4257+ # storage via bucket index instead of bucket scanning.
4258+ # CLI flag: -blocks-storage.bucket-store.bucket-index.enabled
4259+ [enabled: <boolean> | default = false]
4260+
4261+ # How frequently a bucket index, which previously failed to load, should
4262+ # be tried to load again. This option is used only by querier.
4263+ # CLI flag: -blocks-storage.bucket-store.bucket-index.update-on-error-interval
4264+ [update_on_error_interval: <duration> | default = 1m]
4265+
4266+ # How long a unused bucket index should be cached. Once this timeout
4267+ # expires, the unused bucket index is removed from the in-memory cache.
4268+ # This option is used only by querier.
4269+ # CLI flag: -blocks-storage.bucket-store.bucket-index.idle-timeout
4270+ [idle_timeout: <duration> | default = 1h]
4271+
4272+ # The maximum allowed age of a bucket index (last updated) before queries
4273+ # start failing because the bucket index is too old. The bucket index is
4274+ # periodically updated by the compactor, while this check is enforced in
4275+ # the querier (at query time).
4276+ # CLI flag: -blocks-storage.bucket-store.bucket-index.max-stale-period
4277+ [max_stale_period: <duration> | default = 1h]
4278+
4279 tsdb:
4280 # Local directory to store TSDBs in the ingesters.
4281 # CLI flag: -blocks-storage.tsdb.dir
4282@@ -535,6 +715,12 @@ blocks_storage:
4283 # CLI flag: -blocks-storage.tsdb.head-compaction-idle-timeout
4284 [head_compaction_idle_timeout: <duration> | default = 1h]
4285
4286+ # The write buffer size used by the head chunks mapper. Lower values reduce
4287+ # memory utilisation on clusters with a large number of tenants at the cost
4288+ # of increased disk I/O operations.
4289+ # CLI flag: -blocks-storage.tsdb.head-chunks-write-buffer-size-bytes
4290+ [head_chunks_write_buffer_size_bytes: <int> | default = 4194304]
4291+
4292 # The number of shards of series to use in TSDB (must be a power of 2).
4293 # Reducing this will decrease memory footprint, but can negatively impact
4294 # performance.
4295@@ -545,11 +731,24 @@ blocks_storage:
4296 # CLI flag: -blocks-storage.tsdb.wal-compression-enabled
4297 [wal_compression_enabled: <boolean> | default = false]
4298
4299+ # TSDB WAL segments files max size (bytes).
4300+ # CLI flag: -blocks-storage.tsdb.wal-segment-size-bytes
4301+ [wal_segment_size_bytes: <int> | default = 134217728]
4302+
4303 # True to flush blocks to storage on shutdown. If false, incomplete blocks
4304 # will be reused after restart.
4305 # CLI flag: -blocks-storage.tsdb.flush-blocks-on-shutdown
4306 [flush_blocks_on_shutdown: <boolean> | default = false]
4307
4308+ # If TSDB has not received any data for this duration, and all blocks from
4309+ # TSDB have been shipped, TSDB is closed and deleted from local disk. If set
4310+ # to positive value, this value should be equal or higher than
4311+ # -querier.query-ingesters-within flag to make sure that TSDB is not closed
4312+ # prematurely, which could cause partial query results. 0 or negative value
4313+ # disables closing of idle TSDB.
4314+ # CLI flag: -blocks-storage.tsdb.close-idle-tsdb-timeout
4315+ [close_idle_tsdb_timeout: <duration> | default = 0s]
4316+
4317 # limit the number of concurrently opening TSDB's on startup
4318 # CLI flag: -blocks-storage.tsdb.max-tsdb-opening-concurrency-on-startup
4319 [max_tsdb_opening_concurrency_on_startup: <int> | default = 10]
4320diff --git a/docs/blocks-storage/querier.template b/docs/blocks-storage/querier.template
4321index 97d59a2..ee944d3 100644
4322--- a/docs/blocks-storage/querier.template
4323+++ b/docs/blocks-storage/querier.template
4324@@ -13,12 +13,28 @@ The querier is **stateless**.
4325
4326 ## How it works
4327
4328-At startup **queriers** iterate over the entire storage bucket to discover all tenants blocks and download the `meta.json` for each block. During this initial bucket scanning phase, a querier is not ready to handle incoming queries yet and its `/ready` readiness probe endpoint will fail.
4329+The querier needs to have an almost up-to-date view over the entire storage bucket, in order to find the right blocks to lookup at query time. The querier can keep the bucket view updated in to two different ways:
4330+
4331+1. Periodically scanning the bucket (default)
4332+2. Periodically downloading the [bucket index](./bucket-index.md)
4333+
4334+### Bucket index disabled (default)
4335+
4336+At startup, **queriers** iterate over the entire storage bucket to discover all tenants blocks and download the `meta.json` for each block. During this initial bucket scanning phase, a querier is not ready to handle incoming queries yet and its `/ready` readiness probe endpoint will fail.
4337
4338 While running, queriers periodically iterate over the storage bucket to discover new tenants and recently uploaded blocks. Queriers do **not** download any content from blocks except a small `meta.json` file containing the block's metadata (including the minimum and maximum timestamp of samples within the block).
4339
4340 Queriers use the metadata to compute the list of blocks that need to be queried at query time and fetch matching series from the [store-gateway](./store-gateway.md) instances holding the required blocks.
4341
4342+### Bucket index enabled
4343+
4344+When [bucket index](./bucket-index.md) is enabled, queriers lazily download the bucket index upon the first query received for a given tenant, cache it in memory and periodically keep it update. The bucket index contains the list of blocks and block deletion marks of a tenant, which is later used during the query execution to find the set of blocks that need to be queried for the given query.
4345+
4346+Given the bucket index removes the need to scan the bucket, it brings few benefits:
4347+
4348+1. The querier is expected to be ready shortly after startup.
4349+2. Lower volume of API calls to object storage.
4350+
4351 ### Anatomy of a query request
4352
4353 When a querier receives a query range request, it contains the following parameters:
4354@@ -60,6 +76,7 @@ Caching is optional, but **highly recommended** in a production environment. Ple
4355 - List of blocks per tenant
4356 - Block's `meta.json` content
4357 - Block's `deletion-mark.json` existence and content
4358+- Tenant's `bucket-index.json.gz` content
4359
4360 Using the metadata cache can significantly reduce the number of API calls to object storage and protects from linearly scale the number of these API calls with the number of querier and store-gateway instances (because the bucket is periodically scanned and synched by each querier and store-gateway).
4361
4362diff --git a/docs/blocks-storage/store-gateway.md b/docs/blocks-storage/store-gateway.md
4363index c145c01..32961dd 100644
4364--- a/docs/blocks-storage/store-gateway.md
4365+++ b/docs/blocks-storage/store-gateway.md
4366@@ -13,6 +13,13 @@ The store-gateway is **semi-stateful**.
4367
4368 ## How it works
4369
4370+The store-gateway needs to have an almost up-to-date view over the storage bucket, in order to discover blocks belonging to their shard. The store-gateway can keep the bucket view updated in to two different ways:
4371+
4372+1. Periodically scanning the bucket (default)
4373+2. Periodically downloading the [bucket index](./bucket-index.md)
4374+
4375+### Bucket index disabled (default)
4376+
4377 At startup **store-gateways** iterate over the entire storage bucket to discover blocks for all tenants and download the `meta.json` and index-header for each block. During this initial bucket synchronization phase, the store-gateway `/ready` readiness probe endpoint will fail.
4378
4379 While running, store-gateways periodically rescan the storage bucket to discover new blocks (uploaded by the ingesters and [compactor](./compactor.md)) and blocks marked for deletion or fully deleted since the last scan (as a result of compaction). The frequency at which this occurs is configured via `-blocks-storage.bucket-store.sync-interval`.
4380@@ -21,6 +28,12 @@ The blocks chunks and the entire index are never fully downloaded by the store-g
4381
4382 _For more information about the index-header, please refer to [Binary index-header documentation](./binary-index-header.md)._
4383
4384+### Bucket index enabled
4385+
4386+When bucket index is enabled, the overall workflow is the same but, instead of iterating over the bucket objects, the store-gateway fetch the [bucket index](./bucket-index.md) for each tenant belonging to their shard in order to discover each tenant's blocks and block deletion marks.
4387+
4388+_For more information about the bucket index, please refer to [bucket index documentation](./bucket-index.md)._
4389+
4390 ## Blocks sharding and replication
4391
4392 The store-gateway optionally supports blocks sharding. Sharding can be used to horizontally scale blocks in a large cluster without hitting any vertical scalability limit.
4393@@ -48,6 +61,8 @@ The **`shuffle-sharding`** strategy spreads the blocks of a tenant across a subs
4394
4395 The shuffle sharding strategy can be enabled via `-store-gateway.sharding-strategy=shuffle-sharding` and requires the `-store-gateway.tenant-shard-size` flag (or their respective YAML config options) to be set to the default shard size, which is the default number of store-gateway instances each tenant should be sharded to. The shard size can then be overridden on a per-tenant basis setting the `store_gateway_tenant_shard_size` in the limits overrides.
4396
4397+_Please check out the [shuffle sharding documentation](../guides/shuffle-sharding.md) for more information about how it works._
4398+
4399 ### Auto-forget
4400
4401 When a store-gateway instance cleanly shutdowns, it automatically unregisters itself from the ring. However, in the event of a crash or node failure, the instance will not be unregistered from the ring, potentially leaving a spurious entry in the ring forever.
4402@@ -56,6 +71,16 @@ To protect from this, when an healthy store-gateway instance finds another insta
4403
4404 This feature is called **auto-forget** and is built into the store-gateway.
4405
4406+### Zone-awareness
4407+
4408+The store-gateway replication optionally supports [zone-awareness](../guides/zone-replication.md). When zone-aware replication is enabled and the blocks replication factor is > 1, each block is guaranteed to be replicated across store-gateway instances running in different availability zones.
4409+
4410+**To enable** the zone-aware replication for the store-gateways you should:
4411+
4412+1. Configure the availability zone for each store-gateway via the `-store-gateway.sharding-ring.instance-availability-zone` CLI flag (or its respective YAML config option)
4413+2. Enable blocks zone-aware replication via the `-store-gateway.sharding-ring.zone-awareness-enabled` CLI flag (or its respective YAML config option). Please be aware this configuration option should be set to store-gateways, queriers and rulers.
4414+3. Rollout store-gateways, queriers and rulers to apply the new configuration
4415+
4416 ## Caching
4417
4418 The store-gateway supports the following caches:
4419@@ -113,6 +138,7 @@ Store-gateway and [querier](./querier.md) can use memcached for caching bucket m
4420 - List of blocks per tenant
4421 - Block's `meta.json` content
4422 - Block's `deletion-mark.json` existence and content
4423+- Tenant's `bucket-index.json.gz` content
4424
4425 Using the metadata cache can significantly reduce the number of API calls to object storage and protects from linearly scale the number of these API calls with the number of querier and store-gateway instances (because the bucket is periodically scanned and synched by each querier and store-gateway).
4426
4427@@ -207,6 +233,20 @@ store_gateway:
4428 # CLI flag: -store-gateway.sharding-ring.tokens-file-path
4429 [tokens_file_path: <string> | default = ""]
4430
4431+ # True to enable zone-awareness and replicate blocks across different
4432+ # availability zones.
4433+ # CLI flag: -store-gateway.sharding-ring.zone-awareness-enabled
4434+ [zone_awareness_enabled: <boolean> | default = false]
4435+
4436+ # Name of network interface to read address from.
4437+ # CLI flag: -store-gateway.sharding-ring.instance-interface-names
4438+ [instance_interface_names: <list of string> | default = [eth0 en0]]
4439+
4440+ # The availability zone where this instance is running. Required if
4441+ # zone-awareness is enabled.
4442+ # CLI flag: -store-gateway.sharding-ring.instance-availability-zone
4443+ [instance_availability_zone: <string> | default = ""]
4444+
4445 # The sharding strategy to use. Supported values are: default,
4446 # shuffle-sharding.
4447 # CLI flag: -store-gateway.sharding-strategy
4448@@ -219,7 +259,8 @@ The `blocks_storage_config` configures the blocks storage.
4449
4450 ```yaml
4451 blocks_storage:
4452- # Backend storage to use. Supported backends are: s3, gcs, azure, filesystem.
4453+ # Backend storage to use. Supported backends are: s3, gcs, azure, swift,
4454+ # filesystem.
4455 # CLI flag: -blocks-storage.backend
4456 [backend: <string> | default = "s3"]
4457
4458@@ -248,6 +289,25 @@ blocks_storage:
4459 # CLI flag: -blocks-storage.s3.insecure
4460 [insecure: <boolean> | default = false]
4461
4462+ # The signature version to use for authenticating against S3. Supported
4463+ # values are: v4, v2.
4464+ # CLI flag: -blocks-storage.s3.signature-version
4465+ [signature_version: <string> | default = "v4"]
4466+
4467+ http:
4468+ # The time an idle connection will remain idle before closing.
4469+ # CLI flag: -blocks-storage.s3.http.idle-conn-timeout
4470+ [idle_conn_timeout: <duration> | default = 1m30s]
4471+
4472+ # The amount of time the client will wait for a servers response headers.
4473+ # CLI flag: -blocks-storage.s3.http.response-header-timeout
4474+ [response_header_timeout: <duration> | default = 2m]
4475+
4476+ # If the client connects to S3 via HTTPS and this option is enabled, the
4477+ # client will accept any certificate and hostname.
4478+ # CLI flag: -blocks-storage.s3.http.insecure-skip-verify
4479+ [insecure_skip_verify: <boolean> | default = false]
4480+
4481 gcs:
4482 # GCS bucket name
4483 # CLI flag: -blocks-storage.gcs.bucket-name
4484@@ -281,22 +341,100 @@ blocks_storage:
4485 # CLI flag: -blocks-storage.azure.max-retries
4486 [max_retries: <int> | default = 20]
4487
4488+ swift:
4489+ # OpenStack Swift authentication API version. 0 to autodetect.
4490+ # CLI flag: -blocks-storage.swift.auth-version
4491+ [auth_version: <int> | default = 0]
4492+
4493+ # OpenStack Swift authentication URL
4494+ # CLI flag: -blocks-storage.swift.auth-url
4495+ [auth_url: <string> | default = ""]
4496+
4497+ # OpenStack Swift username.
4498+ # CLI flag: -blocks-storage.swift.username
4499+ [username: <string> | default = ""]
4500+
4501+ # OpenStack Swift user's domain name.
4502+ # CLI flag: -blocks-storage.swift.user-domain-name
4503+ [user_domain_name: <string> | default = ""]
4504+
4505+ # OpenStack Swift user's domain ID.
4506+ # CLI flag: -blocks-storage.swift.user-domain-id
4507+ [user_domain_id: <string> | default = ""]
4508+
4509+ # OpenStack Swift user ID.
4510+ # CLI flag: -blocks-storage.swift.user-id
4511+ [user_id: <string> | default = ""]
4512+
4513+ # OpenStack Swift API key.
4514+ # CLI flag: -blocks-storage.swift.password
4515+ [password: <string> | default = ""]
4516+
4517+ # OpenStack Swift user's domain ID.
4518+ # CLI flag: -blocks-storage.swift.domain-id
4519+ [domain_id: <string> | default = ""]
4520+
4521+ # OpenStack Swift user's domain name.
4522+ # CLI flag: -blocks-storage.swift.domain-name
4523+ [domain_name: <string> | default = ""]
4524+
4525+ # OpenStack Swift project ID (v2,v3 auth only).
4526+ # CLI flag: -blocks-storage.swift.project-id
4527+ [project_id: <string> | default = ""]
4528+
4529+ # OpenStack Swift project name (v2,v3 auth only).
4530+ # CLI flag: -blocks-storage.swift.project-name
4531+ [project_name: <string> | default = ""]
4532+
4533+ # ID of the OpenStack Swift project's domain (v3 auth only), only needed if
4534+ # it differs the from user domain.
4535+ # CLI flag: -blocks-storage.swift.project-domain-id
4536+ [project_domain_id: <string> | default = ""]
4537+
4538+ # Name of the OpenStack Swift project's domain (v3 auth only), only needed
4539+ # if it differs from the user domain.
4540+ # CLI flag: -blocks-storage.swift.project-domain-name
4541+ [project_domain_name: <string> | default = ""]
4542+
4543+ # OpenStack Swift Region to use (v2,v3 auth only).
4544+ # CLI flag: -blocks-storage.swift.region-name
4545+ [region_name: <string> | default = ""]
4546+
4547+ # Name of the OpenStack Swift container to put chunks in.
4548+ # CLI flag: -blocks-storage.swift.container-name
4549+ [container_name: <string> | default = ""]
4550+
4551+ # Max retries on requests error.
4552+ # CLI flag: -blocks-storage.swift.max-retries
4553+ [max_retries: <int> | default = 3]
4554+
4555+ # Time after which a connection attempt is aborted.
4556+ # CLI flag: -blocks-storage.swift.connect-timeout
4557+ [connect_timeout: <duration> | default = 10s]
4558+
4559+ # Time after which an idle request is aborted. The timeout watchdog is reset
4560+ # each time some data is received, so the timeout triggers after X time no
4561+ # data is received on a request.
4562+ # CLI flag: -blocks-storage.swift.request-timeout
4563+ [request_timeout: <duration> | default = 5s]
4564+
4565 filesystem:
4566 # Local filesystem storage directory.
4567 # CLI flag: -blocks-storage.filesystem.dir
4568 [dir: <string> | default = ""]
4569
4570- # This configures how the store-gateway synchronizes blocks stored in the
4571- # bucket.
4572+ # This configures how the querier and store-gateway discover and synchronize
4573+ # blocks stored in the bucket.
4574 bucket_store:
4575 # Directory to store synchronized TSDB index headers.
4576 # CLI flag: -blocks-storage.bucket-store.sync-dir
4577 [sync_dir: <string> | default = "tsdb-sync"]
4578
4579- # How frequently scan the bucket to look for changes (new blocks shipped by
4580- # ingesters and blocks removed by retention or compaction). 0 disables it.
4581+ # How frequently to scan the bucket, or to refresh the bucket index (if
4582+ # enabled), in order to look for changes (new blocks shipped by ingesters
4583+ # and blocks deleted by retention or compaction).
4584 # CLI flag: -blocks-storage.bucket-store.sync-interval
4585- [sync_interval: <duration> | default = 5m]
4586+ [sync_interval: <duration> | default = 15m]
4587
4588 # Max size - in bytes - of a per-tenant chunk pool, used to reduce memory
4589 # allocations.
4590@@ -369,7 +507,7 @@ blocks_storage:
4591 [max_get_multi_concurrency: <int> | default = 100]
4592
4593 # The maximum number of keys a single underlying get operation should
4594- # run. If more keys are specified, internally keys are splitted into
4595+ # run. If more keys are specified, internally keys are split into
4596 # multiple batches and fetched concurrently, honoring the max
4597 # concurrency. If set to 0, the max batch size is unlimited.
4598 # CLI flag: -blocks-storage.bucket-store.index-cache.memcached.max-get-multi-batch-size
4599@@ -380,7 +518,8 @@ blocks_storage:
4600 # CLI flag: -blocks-storage.bucket-store.index-cache.memcached.max-item-size
4601 [max_item_size: <int> | default = 1048576]
4602
4603- # Compress postings before storing them to postings cache.
4604+ # Deprecated: compress postings before storing them to postings cache.
4605+ # This option is unused and postings compression is always enabled.
4606 # CLI flag: -blocks-storage.bucket-store.index-cache.postings-compression-enabled
4607 [postings_compression_enabled: <boolean> | default = false]
4608
4609@@ -420,7 +559,7 @@ blocks_storage:
4610 [max_get_multi_concurrency: <int> | default = 100]
4611
4612 # The maximum number of keys a single underlying get operation should
4613- # run. If more keys are specified, internally keys are splitted into
4614+ # run. If more keys are specified, internally keys are split into
4615 # multiple batches and fetched concurrently, honoring the max
4616 # concurrency. If set to 0, the max batch size is unlimited.
4617 # CLI flag: -blocks-storage.bucket-store.chunks-cache.memcached.max-get-multi-batch-size
4618@@ -444,7 +583,7 @@ blocks_storage:
4619
4620 # TTL for caching object attributes for chunks.
4621 # CLI flag: -blocks-storage.bucket-store.chunks-cache.attributes-ttl
4622- [attributes_ttl: <duration> | default = 24h]
4623+ [attributes_ttl: <duration> | default = 168h]
4624
4625 # TTL for caching individual chunks subranges.
4626 # CLI flag: -blocks-storage.bucket-store.chunks-cache.subrange-ttl
4627@@ -486,7 +625,7 @@ blocks_storage:
4628 [max_get_multi_concurrency: <int> | default = 100]
4629
4630 # The maximum number of keys a single underlying get operation should
4631- # run. If more keys are specified, internally keys are splitted into
4632+ # run. If more keys are specified, internally keys are split into
4633 # multiple batches and fetched concurrently, honoring the max
4634 # concurrency. If set to 0, the max batch size is unlimited.
4635 # CLI flag: -blocks-storage.bucket-store.metadata-cache.memcached.max-get-multi-batch-size
4636@@ -509,11 +648,13 @@ blocks_storage:
4637 # CLI flag: -blocks-storage.bucket-store.metadata-cache.chunks-list-ttl
4638 [chunks_list_ttl: <duration> | default = 24h]
4639
4640- # How long to cache information that block metafile exists.
4641+ # How long to cache information that block metafile exists. Also used for
4642+ # user deletion mark file.
4643 # CLI flag: -blocks-storage.bucket-store.metadata-cache.metafile-exists-ttl
4644 [metafile_exists_ttl: <duration> | default = 2h]
4645
4646- # How long to cache information that block metafile doesn't exist.
4647+ # How long to cache information that block metafile doesn't exist. Also
4648+ # used for user deletion mark file.
4649 # CLI flag: -blocks-storage.bucket-store.metadata-cache.metafile-doesnt-exist-ttl
4650 [metafile_doesnt_exist_ttl: <duration> | default = 5m]
4651
4652@@ -521,10 +662,34 @@ blocks_storage:
4653 # CLI flag: -blocks-storage.bucket-store.metadata-cache.metafile-content-ttl
4654 [metafile_content_ttl: <duration> | default = 24h]
4655
4656- # Maximum size of metafile content to cache in bytes.
4657+ # Maximum size of metafile content to cache in bytes. Caching will be
4658+ # skipped if the content exceeds this size. This is useful to avoid
4659+ # network round trip for large content if the configured caching backend
4660+ # has an hard limit on cached items size (in this case, you should set
4661+ # this limit to the same limit in the caching backend).
4662 # CLI flag: -blocks-storage.bucket-store.metadata-cache.metafile-max-size-bytes
4663 [metafile_max_size_bytes: <int> | default = 1048576]
4664
4665+ # How long to cache attributes of the block metafile.
4666+ # CLI flag: -blocks-storage.bucket-store.metadata-cache.metafile-attributes-ttl
4667+ [metafile_attributes_ttl: <duration> | default = 168h]
4668+
4669+ # How long to cache attributes of the block index.
4670+ # CLI flag: -blocks-storage.bucket-store.metadata-cache.block-index-attributes-ttl
4671+ [block_index_attributes_ttl: <duration> | default = 168h]
4672+
4673+ # How long to cache content of the bucket index.
4674+ # CLI flag: -blocks-storage.bucket-store.metadata-cache.bucket-index-content-ttl
4675+ [bucket_index_content_ttl: <duration> | default = 5m]
4676+
4677+ # Maximum size of bucket index content to cache in bytes. Caching will be
4678+ # skipped if the content exceeds this size. This is useful to avoid
4679+ # network round trip for large content if the configured caching backend
4680+ # has an hard limit on cached items size (in this case, you should set
4681+ # this limit to the same limit in the caching backend).
4682+ # CLI flag: -blocks-storage.bucket-store.metadata-cache.bucket-index-max-size-bytes
4683+ [bucket_index_max_size_bytes: <int> | default = 1048576]
4684+
4685 # Duration after which the blocks marked for deletion will be filtered out
4686 # while fetching blocks. The idea of ignore-deletion-marks-delay is to
4687 # ignore blocks that are marked for deletion with some delay. This ensures
4688@@ -534,6 +699,30 @@ blocks_storage:
4689 # CLI flag: -blocks-storage.bucket-store.ignore-deletion-marks-delay
4690 [ignore_deletion_mark_delay: <duration> | default = 6h]
4691
4692+ bucket_index:
4693+ # True to enable querier and store-gateway to discover blocks in the
4694+ # storage via bucket index instead of bucket scanning.
4695+ # CLI flag: -blocks-storage.bucket-store.bucket-index.enabled
4696+ [enabled: <boolean> | default = false]
4697+
4698+ # How frequently a bucket index, which previously failed to load, should
4699+ # be tried to load again. This option is used only by querier.
4700+ # CLI flag: -blocks-storage.bucket-store.bucket-index.update-on-error-interval
4701+ [update_on_error_interval: <duration> | default = 1m]
4702+
4703+ # How long a unused bucket index should be cached. Once this timeout
4704+ # expires, the unused bucket index is removed from the in-memory cache.
4705+ # This option is used only by querier.
4706+ # CLI flag: -blocks-storage.bucket-store.bucket-index.idle-timeout
4707+ [idle_timeout: <duration> | default = 1h]
4708+
4709+ # The maximum allowed age of a bucket index (last updated) before queries
4710+ # start failing because the bucket index is too old. The bucket index is
4711+ # periodically updated by the compactor, while this check is enforced in
4712+ # the querier (at query time).
4713+ # CLI flag: -blocks-storage.bucket-store.bucket-index.max-stale-period
4714+ [max_stale_period: <duration> | default = 1h]
4715+
4716 tsdb:
4717 # Local directory to store TSDBs in the ingesters.
4718 # CLI flag: -blocks-storage.tsdb.dir
4719@@ -573,6 +762,12 @@ blocks_storage:
4720 # CLI flag: -blocks-storage.tsdb.head-compaction-idle-timeout
4721 [head_compaction_idle_timeout: <duration> | default = 1h]
4722
4723+ # The write buffer size used by the head chunks mapper. Lower values reduce
4724+ # memory utilisation on clusters with a large number of tenants at the cost
4725+ # of increased disk I/O operations.
4726+ # CLI flag: -blocks-storage.tsdb.head-chunks-write-buffer-size-bytes
4727+ [head_chunks_write_buffer_size_bytes: <int> | default = 4194304]
4728+
4729 # The number of shards of series to use in TSDB (must be a power of 2).
4730 # Reducing this will decrease memory footprint, but can negatively impact
4731 # performance.
4732@@ -583,11 +778,24 @@ blocks_storage:
4733 # CLI flag: -blocks-storage.tsdb.wal-compression-enabled
4734 [wal_compression_enabled: <boolean> | default = false]
4735
4736+ # TSDB WAL segments files max size (bytes).
4737+ # CLI flag: -blocks-storage.tsdb.wal-segment-size-bytes
4738+ [wal_segment_size_bytes: <int> | default = 134217728]
4739+
4740 # True to flush blocks to storage on shutdown. If false, incomplete blocks
4741 # will be reused after restart.
4742 # CLI flag: -blocks-storage.tsdb.flush-blocks-on-shutdown
4743 [flush_blocks_on_shutdown: <boolean> | default = false]
4744
4745+ # If TSDB has not received any data for this duration, and all blocks from
4746+ # TSDB have been shipped, TSDB is closed and deleted from local disk. If set
4747+ # to positive value, this value should be equal or higher than
4748+ # -querier.query-ingesters-within flag to make sure that TSDB is not closed
4749+ # prematurely, which could cause partial query results. 0 or negative value
4750+ # disables closing of idle TSDB.
4751+ # CLI flag: -blocks-storage.tsdb.close-idle-tsdb-timeout
4752+ [close_idle_tsdb_timeout: <duration> | default = 0s]
4753+
4754 # limit the number of concurrently opening TSDB's on startup
4755 # CLI flag: -blocks-storage.tsdb.max-tsdb-opening-concurrency-on-startup
4756 [max_tsdb_opening_concurrency_on_startup: <int> | default = 10]
4757diff --git a/docs/blocks-storage/store-gateway.template b/docs/blocks-storage/store-gateway.template
4758index 8c95335..5f43448 100644
4759--- a/docs/blocks-storage/store-gateway.template
4760+++ b/docs/blocks-storage/store-gateway.template
4761@@ -13,6 +13,13 @@ The store-gateway is **semi-stateful**.
4762
4763 ## How it works
4764
4765+The store-gateway needs to have an almost up-to-date view over the storage bucket, in order to discover blocks belonging to their shard. The store-gateway can keep the bucket view updated in to two different ways:
4766+
4767+1. Periodically scanning the bucket (default)
4768+2. Periodically downloading the [bucket index](./bucket-index.md)
4769+
4770+### Bucket index disabled (default)
4771+
4772 At startup **store-gateways** iterate over the entire storage bucket to discover blocks for all tenants and download the `meta.json` and index-header for each block. During this initial bucket synchronization phase, the store-gateway `/ready` readiness probe endpoint will fail.
4773
4774 While running, store-gateways periodically rescan the storage bucket to discover new blocks (uploaded by the ingesters and [compactor](./compactor.md)) and blocks marked for deletion or fully deleted since the last scan (as a result of compaction). The frequency at which this occurs is configured via `-blocks-storage.bucket-store.sync-interval`.
4775@@ -21,6 +28,12 @@ The blocks chunks and the entire index are never fully downloaded by the store-g
4776
4777 _For more information about the index-header, please refer to [Binary index-header documentation](./binary-index-header.md)._
4778
4779+### Bucket index enabled
4780+
4781+When bucket index is enabled, the overall workflow is the same but, instead of iterating over the bucket objects, the store-gateway fetch the [bucket index](./bucket-index.md) for each tenant belonging to their shard in order to discover each tenant's blocks and block deletion marks.
4782+
4783+_For more information about the bucket index, please refer to [bucket index documentation](./bucket-index.md)._
4784+
4785 ## Blocks sharding and replication
4786
4787 The store-gateway optionally supports blocks sharding. Sharding can be used to horizontally scale blocks in a large cluster without hitting any vertical scalability limit.
4788@@ -48,6 +61,8 @@ The **`shuffle-sharding`** strategy spreads the blocks of a tenant across a subs
4789
4790 The shuffle sharding strategy can be enabled via `-store-gateway.sharding-strategy=shuffle-sharding` and requires the `-store-gateway.tenant-shard-size` flag (or their respective YAML config options) to be set to the default shard size, which is the default number of store-gateway instances each tenant should be sharded to. The shard size can then be overridden on a per-tenant basis setting the `store_gateway_tenant_shard_size` in the limits overrides.
4791
4792+_Please check out the [shuffle sharding documentation](../guides/shuffle-sharding.md) for more information about how it works._
4793+
4794 ### Auto-forget
4795
4796 When a store-gateway instance cleanly shutdowns, it automatically unregisters itself from the ring. However, in the event of a crash or node failure, the instance will not be unregistered from the ring, potentially leaving a spurious entry in the ring forever.
4797@@ -56,6 +71,16 @@ To protect from this, when an healthy store-gateway instance finds another insta
4798
4799 This feature is called **auto-forget** and is built into the store-gateway.
4800
4801+### Zone-awareness
4802+
4803+The store-gateway replication optionally supports [zone-awareness](../guides/zone-replication.md). When zone-aware replication is enabled and the blocks replication factor is > 1, each block is guaranteed to be replicated across store-gateway instances running in different availability zones.
4804+
4805+**To enable** the zone-aware replication for the store-gateways you should:
4806+
4807+1. Configure the availability zone for each store-gateway via the `-store-gateway.sharding-ring.instance-availability-zone` CLI flag (or its respective YAML config option)
4808+2. Enable blocks zone-aware replication via the `-store-gateway.sharding-ring.zone-awareness-enabled` CLI flag (or its respective YAML config option). Please be aware this configuration option should be set to store-gateways, queriers and rulers.
4809+3. Rollout store-gateways, queriers and rulers to apply the new configuration
4810+
4811 ## Caching
4812
4813 The store-gateway supports the following caches:
4814@@ -113,6 +138,7 @@ Store-gateway and [querier](./querier.md) can use memcached for caching bucket m
4815 - List of blocks per tenant
4816 - Block's `meta.json` content
4817 - Block's `deletion-mark.json` existence and content
4818+- Tenant's `bucket-index.json.gz` content
4819
4820 Using the metadata cache can significantly reduce the number of API calls to object storage and protects from linearly scale the number of these API calls with the number of querier and store-gateway instances (because the bucket is periodically scanned and synched by each querier and store-gateway).
4821
4822diff --git a/docs/case-studies/_index.md b/docs/case-studies/_index.md
4823index ba12af6..12201c5 100644
4824--- a/docs/case-studies/_index.md
4825+++ b/docs/case-studies/_index.md
4826@@ -3,6 +3,6 @@ title: "Case Studies"
4827 linkTitle: "Case Studies"
4828 slug: case-studies
4829 no_section_index_title: true
4830-weight: 11
4831+weight: 9
4832 menu:
4833 ---
4834diff --git a/docs/case-studies/buoyant-cloud.md b/docs/case-studies/buoyant-cloud.md
4835new file mode 100644
4836index 0000000..f4ac0cf
4837--- /dev/null
4838+++ b/docs/case-studies/buoyant-cloud.md
4839@@ -0,0 +1,83 @@
4840+---
4841+title: "Buoyant Cloud and Cortex: Standing on the shoulders of Linkerd and Prometheus"
4842+linkTitle: "Buoyant Cloud"
4843+weight: 3
4844+slug: buoyant-cloud
4845+---
4846+
4847+[Buoyant](https://buoyant.io), the creator of [Linkerd](https://linkerd.io), has had a close relationship with Prometheus and related technologies for years. As of today, that relationship now includes [Cortex](https://cortexmetrics.io/).
4848+
4849+Linkerd is an open source service mesh for Kubernetes, and part of the CNCF, along with Prometheus and Cortex. Linkerd provides three key classes of features: observability, reliability, and security—all without requiring any changes to your code. That first pillar, observability, has motivated deep Prometheus integration, and is the focus of this case study.
4850+
4851+## Linkerd x Prometheus
4852+
4853+In 2016, Linkerd 1.0 shipped with a [visualization module](https://linkerd.io/2016/10/04/a-service-mesh-for-kubernetes-part-i-top-line-service-metrics/#step-3-install-linkerd-viz) built with Prometheus and Grafana. With the release of [Linkerd 2.0 in 2018](https://linkerd.io/2018/09/18/announcing-linkerd-2-0/), Prometheus and Grafana were promoted to first-class components. That evolution was documented in a blog post entitled [Prometheus the Right Way](https://linkerd.io/2018/05/17/prometheus-the-right-way-lessons-learned-evolving-conduits-prometheus-integration/), and a KubeCon North America 2018 talk entitled [Linkerd 2.0, Now with Extra Prometheus](https://www.youtube.com/watch?v=bnDWApsH36Y), both co-authored by [Frederic Branczyk](https://twitter.com/fredbrancz) of Polar Signals and [Andrew Seigner](https://twitter.com/siggy) of Buoyant.
4854+
4855+This deep integration in Linkerd 2.0 provided out-of-the-box golden metrics, that is, success rate, request rate, and latency, across all your Kubernetes workloads.
4856+
4857+![Linkerd Grafana](/images/case-studies/bcloud-linkerd-grafana.png)
4858+_Linkerd 2.0 with integrated Prometheus and Grafana, out-of-the-box golden metrics_
4859+
4860+## Buoyant x Cortex
4861+
4862+Building on the success of Linkerd, Buoyant has created [Buoyant Cloud](https://buoyant.cloud/), a global platform health dashboard for Kubernetes. Leveraging Linkerd's integration with Prometheus, Buoyant Cloud rolls up Linkerd metrics across all Kubernetes clusters to provide global platform-wide observability, including advanced features such as cross-cluster Service Level Objectives for success rate and latency.
4863+
4864+![Buoyant Cloud Screenshot](/images/case-studies/bcloud-screenshot.jpg)
4865+_Service Level Objectives in Buoyant Cloud_
4866+
4867+### Buoyant Cloud Prototyping with Prometheus
4868+
4869+To enable observability in Buoyant Cloud, customers install an agent into their Kubernetes clusters. That agent gathers metrics from Linkerd and sends them up to Buoyant Cloud. Early prototypes of Buoyant Cloud received these metrics, wrote them to [pushgateway](https://github.com/prometheus/pushgateway), and then our own larger Prometheus would scrape metrics from there. While this had the nice property that Linkerd metrics looked the same in Buoyant Cloud as they did in individual Linkerd clusters, gathering metrics across all customers into a single Prometheus instance created an inherent scaling limitation, and a single-point-of-failure.
4870+
4871+### Observability Requirements
4872+
4873+Thinking beyond our early prototypes, we came up with four core requirements for our observability system:
4874+
4875+1. Scalable - To support all Kubernetes clusters across our growing customer base, we needed a system that could scale as-needed. Bonus points if we could scale our reads and writes independently.
4876+2. Reliable - Users of Linkerd expect nothing less.
4877+3. Multi-tenant - To provide an extra layer of security and performance isolation between customers.
4878+4. Prometheus-compatible - To give our customers a familiar API, and to allow a drop-in replacement for our prototype Prometheus instance.
4879+
4880+Those first two requirements in particular are not compatible with a single instance of anything. Even Prometheus, which does exceptionally well as a single instance, is intentionally not designed as a distributed, scalable system.
4881+
4882+Take a look at those requirements again, then go to the [Cortex website](https://cortexmetrics.io/):
4883+
4884+![Cortex Homepage](/images/case-studies/bcloud-cortex-homepage.png)
4885+_[https://cortexmetrics.io/](https://cortexmetrics.io/)_
4886+
4887+This was not intentional, but it was a fortuitous coincidence. Cortex's one-line description of itself literally satisfied all four of our requirements for Buoyant Cloud.
4888+
4889+### Buoyant Cloud Production-Ready with Cortex
4890+
4891+We set about building a proof of concept to validate whether Cortex could be a viable replacement for Buoyant Cloud's prototype Prometheus-based observability.
4892+
4893+#### Development environment
4894+
4895+The very first attempt at Cortex integration in our development environment was surprisingly smooth, thanks largely to Cortex's [single instance, single process](https://cortexmetrics.io/docs/getting-started/getting-started-blocks-storage/#single-instance-single-process) mode. This enabled our developers to operate all of Cortex's services as a single process in our docker-compose development environment, with no dependencies.
4896+
4897+#### (Almost) a drop-in replacement
4898+
4899+Cortex provides a Prometheus-compatible API. To enable multi-tenancy, you must set a [X-Scope-OrgID](https://cortexmetrics.io/docs/guides/auth/) header on every request with a unique identifier for the tenant. We already had a unique public identifier for each Buoyant Cloud customer, so that was a natural fit for this header. Modifying all reads and writes to Prometheus to set this header was a relatively straightforward code change, considering we were about to completely swap out a back-end storage system.
4900+
4901+#### Blocks Storage
4902+
4903+Being the creators of Linkerd, we care a lot about operational complexity. Thus, it was no surprise that we wanted to minimize operational complexity and cost for ourselves in maintaining Buoyant Cloud. Cortex's [Chunk Storage](https://cortexmetrics.io/docs/getting-started/getting-started-chunks-storage/) was a concern here. Operating our own Cassandra cluster would incur developer time, and paying for DynamoDB, BigTable, or Azure Cosmos DB would incur cost. Cortex's [Blocks Storage](https://cortexmetrics.io/docs/blocks-storage/) removed this complexity and cost by relying on a simple and cheap object store, such as S3, GCS, or Azure Storage. At the time, Blocks Storage was still marked experimental. That's when we hopped into a Q&A at a KubeCon EU 2020 talk, [Scaling Prometheus: How We Got Some Thanos Into Cortex](https://www.youtube.com/watch?v=Z5OJzRogAS4) by [Thor Hansen](https://twitter.com/thor4hansen) of HashiCorp and [Marco Pracucci](https://twitter.com/pracucci) of Grafana Labs. We asked the Cortex maintainers how close to General Availability they felt Blocks Storage was. While wisely not guaranteeing a date, they hinted it may be ready by the next Cortex release (and that hint turned out to be true, Blocks Storage was marked stable in [Cortex 1.4.0](https://github.com/cortexproject/cortex/releases/tag/v1.4.0)!). This gave us enough confidence to build our proof of concept around Blocks Storage.
4904+
4905+#### Recording Rules
4906+
4907+Buoyant Cloud uses recording rules for important success rate and latency metrics. One unexpected challenge was that Cortex's multi-tenancy applies to recording rules. This meant that for every customer, we needed to push an identical set of recording rules to the [Cortex Ruler API](https://cortexmetrics.io/docs/api/#ruler). We ended up writing a small background process that continually checks our database for new customers, and pushes recording rules when they appear.
4908+
4909+#### Cortex in Prod: Writes, then reads
4910+
4911+Once all the pieces were in place, we enabled production writes to our new Cortex cluster. We continued writing to and reading from our existing Prometheus. Writing to Cortex and Prometheus simultaneously enabled validation of three things. We could 1) Evaluate Cortex's read performance under full production write load, 2) ensure Cortex query results matched Prometheus, and 3) gather enough historical metrics in Cortex to minimize data loss for our customers.
4912+
4913+When we were satisfied with all three of these validation steps, we switched all reads to Cortex. This was the smallest code change in the entire migration. We simply swapped out a few command-line flags pointing to `prometheus:9009` with `query-frontend.cortex.svc.cluster.local:9009/api/prom`. Boom! It all worked!
4914+
4915+![Cortex Launch](/images/case-studies/bcloud-cortex-launch.png)
4916+_The moment we turned on Cortex reads in production (numbers do not reflect full production load)._
4917+
4918+## Looking Ahead
4919+
4920+Our mission with Buoyant Cloud is to enable our customers to build observable, scalable, and secure Kubernetes platforms, without the complexity of stitching together lots of components.
4921+
4922+Users of Linkerd expect their observability to "just work", and expect it to be something they are already familiar with and have tools to integrate with. For Linkerd running on a single Kubernetes cluster, Prometheus fits the bill perfectly. For Buoyant Cloud, we believe Cortex can deliver that same familiarity and integration story for all Kubernetes clusters across all customers.
4923diff --git a/docs/chunks-storage/_index.md b/docs/chunks-storage/_index.md
4924new file mode 100644
4925index 0000000..7f38eec
4926--- /dev/null
4927+++ b/docs/chunks-storage/_index.md
4928@@ -0,0 +1,36 @@
4929+---
4930+title: "Chunks Storage"
4931+linkTitle: "Chunks Storage"
4932+weight: 4
4933+menu:
4934+---
4935+
4936+The chunks storage is a Cortex storage engine which stores each single time series into a separate object called _chunk_. Each chunk contains the samples for a given period (defaults to 12 hours). Chunks are then indexed by time range and labels, in order to provide a fast lookup across many (over millions) chunks. For this reason, the Cortex chunks storage requires two backend storages: a key-value store for the index and an object store for the chunks.
4937+
4938+The supported backends for the **index store** are:
4939+
4940+* [Amazon DynamoDB](https://aws.amazon.com/dynamodb)
4941+* [Google Bigtable](https://cloud.google.com/bigtable)
4942+* [Apache Cassandra](https://cassandra.apache.org)
4943+
4944+The supported backends for the **chunks store** are:
4945+
4946+* [Amazon DynamoDB](https://aws.amazon.com/dynamodb)
4947+* [Google Bigtable](https://cloud.google.com/bigtable)
4948+* [Apache Cassandra](https://cassandra.apache.org)
4949+* [Amazon S3](https://aws.amazon.com/s3)
4950+* [Google Cloud Storage](https://cloud.google.com/storage/)
4951+* [Microsoft Azure Storage](https://azure.microsoft.com/en-us/services/storage/)
4952+
4953+## Storage versioning
4954+
4955+The chunks storage is based on a custom data format. The **chunks and index format are versioned**: this allows Cortex operators to upgrade the cluster to take advantage of new features and improvements. This strategy enables changes in the storage format without requiring any downtime or complex procedures to rewrite the stored data. A set of schemas are used to map the version while reading and writing time series belonging to a specific period of time.
4956+
4957+The current schema recommendation is the **v9 schema** for most use cases and **v10 schema** if you expect to have very high cardinality metrics (v11 is still experimental). For more information about the schema, please check out the [schema configuration](schema-config.md).
4958+
4959+## Guides
4960+
4961+The following step-by-step guides can help you setting up Cortex running with the chunks storage:
4962+
4963+- [Running Cortex chunks storage in Production](../guides/running-chunks-storage-in-production.md)
4964+- [Running Cortex chunks storage with Cassandra](../guides/running-chunks-storage-with-cassandra.md)
4965diff --git a/docs/production/storage-aws.md b/docs/chunks-storage/aws-tips.md
4966similarity index 87%
4967rename from docs/production/storage-aws.md
4968rename to docs/chunks-storage/aws-tips.md
4969index cd1707a..cef7034 100644
4970--- a/docs/production/storage-aws.md
4971+++ b/docs/chunks-storage/aws-tips.md
4972@@ -1,15 +1,13 @@
4973 ---
4974-title: "Running Cortex with AWS Services"
4975-linkTitle: "Running Cortex with AWS Services"
4976-weight: 2
4977-slug: aws
4978+title: "AWS tips"
4979+linkTitle: "AWS tips"
4980+weight: 10
4981+slug: aws-tips
4982 ---
4983
4984-[this is a work in progress]
4985+This page shares some tips and things to take in consideration when running Cortex chunks storage on AWS.
4986
4987-See also the [Running in Production](running.md) document.
4988-
4989-## Credentials
4990+## AWS Credentials
4991
4992 You can supply credentials to Cortex by setting environment variables
4993 `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` (and `AWS_SESSION_TOKEN`
4994@@ -20,7 +18,7 @@ if you use MFA), or use a short-term token solution such as
4995
4996 Note that the choices for the chunks storage backend are: "chunks" of
4997 timeseries data in S3 and index in DynamoDB, or everything in DynamoDB.
4998-Using just S3 is not an option, unless you use the [blocks storage](../../blocks-storage/) engine.
4999+Using just S3 is not an option, unless you use the [blocks storage](../blocks-storage/_index.md) engine.
5000
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: