Skip to content

Commit

Permalink
cleanup docs for query_store_for_labels_enabled config (cortexproject…
Browse files Browse the repository at this point in the history
…#6156)

* cleanup docs for query_store_for_labels_enabled config

Signed-off-by: Ben Ye <[email protected]>

* update doc and mention the release

Signed-off-by: Ben Ye <[email protected]>

---------

Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed Aug 14, 2024
1 parent ee8f8e9 commit 76ca69d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
8 changes: 3 additions & 5 deletions docs/api/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,7 @@ GET,POST <prometheus-http-prefix>/api/v1/series
GET,POST <legacy-http-prefix>/api/v1/series
```

Find series by label matchers. Differently than Prometheus and due to scalability and performances reasons, if `-querier.query-store-for-labels-enabled` is not set or if `start` param is not specified, Cortex currently always fetches series from data stored in the ingesters.

If `-querier.query-store-for-labels-enabled` is configured, Cortex also queries the long-term store with the *blocks* storage engine.
Find series by label matchers. Starting from release v1.18.0, Cortex by default honors the `start` and `end` request parameters and fetches series from either ingester, store gateway or both. The special case is that if `start` param is not specified, Cortex currently fetches series from data stored in the ingesters.

_For more information, please check out the Prometheus [series endpoint](https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers) documentation._

Expand All @@ -372,7 +370,7 @@ GET,POST <prometheus-http-prefix>/api/v1/labels
GET,POST <legacy-http-prefix>/api/v1/labels
```

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.
Get label names of ingested series. Starting from release v1.18.0, Cortex by default honors the `start` and `end` request parameters and fetches label names from either ingester, store gateway or both.

_For more information, please check out the Prometheus [get label names](https://prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names) documentation._

Expand All @@ -387,7 +385,7 @@ GET <prometheus-http-prefix>/api/v1/label/{name}/values
GET <legacy-http-prefix>/api/v1/label/{name}/values
```

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.
Get label values for a given label name. Starting from release v1.18.0, Cortex by default honors the `start` and `end` request parameters and fetches label values from either ingester, store gateway or both.

_For more information, please check out the Prometheus [get label values](https://prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values) documentation._

Expand Down
2 changes: 0 additions & 2 deletions docs/configuration/v1-guarantees.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ The Cortex maintainers commit to ensuring future version of Cortex can read data

Cortex strives to be 100% API compatible with Prometheus (under `/prometheus/*` and `/api/prom/*`); any deviation from this is considered a bug, except:

- For queries to the `/api/v1/series`, `/api/v1/labels` and `/api/v1/label/{name}/values` endpoints, query's time range is ignored and the data is always fetched from 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.
- Additional API endpoints for creating, removing and modifying alerts and recording rules.
- Additional API around pushing metrics (under `/api/push`).
- Additional API endpoints for management of Cortex itself, such as the ring. These APIs are not part of the any compatibility guarantees.
Expand Down Expand Up @@ -53,7 +52,6 @@ Currently experimental features are:
- OpenStack Swift storage support.
- Metric relabeling in the distributor.
- Scalable query-frontend (when using query-scheduler)
- Querying store for series, labels APIs (`-querier.query-store-for-labels-enabled`)
- Ingester: do not unregister from ring on shutdown (`-ingester.unregister-on-shutdown=false`)
- Distributor: do not extend writes on unhealthy ingesters (`-distributor.extend-writes=false`)
- Tenant Deletion in Purger, for blocks storage.
Expand Down
4 changes: 0 additions & 4 deletions docs/guides/limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,3 @@ All other characters are not safe to use. In particular, slashes `/` and whitesp
### Length

The tenant ID length should not exceed 150 bytes/characters.

## Query series and labels

When running queries to the `/api/v1/series`, `/api/v1/labels` and `/api/v1/label/{name}/values` endpoints, query's time range is ignored and the data is always fetched from 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.
2 changes: 1 addition & 1 deletion pkg/ingester/ingester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2731,7 +2731,7 @@ func Test_Ingester_MetricsForLabelMatchers(t *testing.T) {
{Labels: cortexpb.FromLabelsToLabelAdapters(fixtures[1].lbls)},
},
},
"should filter metrics by time range if queryStoreForLabels and queryIngestersWithin is enabled": {
"should filter metrics by time range if queryIngestersWithin is enabled": {
from: 99999,
to: 100001,
matchers: []*client.LabelMatchers{{
Expand Down
1 change: 0 additions & 1 deletion pkg/querier/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,6 @@ type mockStoreQuerier struct {
// Select implements storage.Querier interface.
// The bool passed is ignored because the series is always sorted.
func (q *mockStoreQuerier) Select(ctx context.Context, _ bool, sp *storage.SelectHints, matchers ...*labels.Matcher) storage.SeriesSet {
// We will hit this for /series lookup when -querier.query-store-for-labels-enabled is set.
// If we don't skip here, it'll make /series lookups extremely slow as all the chunks will be loaded.
// That flag is only to be set with blocks storage engine, and this is a protective measure.
if sp != nil && sp.Func == "series" {
Expand Down

0 comments on commit 76ca69d

Please sign in to comment.