grafana / grafana/pyroscope

When fetching label names, the API should return their cardinality

Open
#3,226 2 comments 2 reactions 1 assignee Claimed by @bryanhuhta View on GitHub
enhancement
Dominant language
Go
Stars
11.7k
Forks
802
Avg merge
1d 19h
Merged PRs (30d)
80

Description

#### Is your feature request related to a problem? Please describe.

When fetching label names from the `/querier.v1.QuerierService/LabelNames` API endpoint, it would be great if the API could return the labels cardinality:

1. For our Explore Profiles app in the "Labels" view, this would prevent requesting all the label values for all the labels, which is required to be able to sort the viz panels presented to the user (from highest cardinality to lowest)
2. For the query builder, it would allow to adapt itself and to prevent long loading times, or even timeouts, when fetching label values.

#### Describe the solution you'd like

See above.

#### Describe alternatives you've considered

- The Explore Profiles app currently hides high cardinality labels based on their names. The query builder has also some special logic to prevent fetching label values in this case.
- The "Labels" view is fetching all the label values always, just to figure out their number (their specific values are not used)

#### Additional context

`-`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.