Skip to content

Support Metadata API limit param in storage layer #6127

Closed
@harry671003

Description

@harry671003

Is your feature request related to a problem? Please describe.
The metadata APIs like /api/v1/series, /api/v1/labels, /api/v1/label/<name>/values often timeout when queried with a lot of data.
Recently Prometheus introduced a new limit param in the above APIs for limiting the amount of data returned. This change was implemented in:

The #14109 allows storage implementations to know that the label names or label values request has a limit applied.
However, we currently don't make use of this information, so ingesters and store-gateways may do a bunch of work retrieving values that will then be thrown away in the querier.

Describe the solution you'd like
Cortex ingesters and store-gateways should truncate the results and return only up to the limit number of results

Describe alternatives you've considered
N/A

Additional context
prometheus/prometheus#12795 has more context about this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions