Skip to content

feat: get label names from store gateway #2498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Oct 25, 2023
Merged

feat: get label names from store gateway #2498

merged 33 commits into from
Oct 25, 2023

Conversation

bryanhuhta
Copy link
Contributor

Related: #2230
Related: https://github.com/grafana/pyroscope-app-plugin/issues/70

Previously label names were only queried from the head block in the ingester. This adds a time window to the LabelNames RPC and queries the store gateway if necessary.

@bryanhuhta bryanhuhta marked this pull request as ready for review October 6, 2023 21:07
@bryanhuhta bryanhuhta requested review from a team as code owners October 6, 2023 21:07
@bryanhuhta bryanhuhta self-assigned this Oct 6, 2023
pkg/util/time.go Outdated
Comment on lines 102 to 110
type TimeRangeRequest interface {
GetStart() int64
GetEnd() int64
}

// HasTimeRange is true if the request has a start and end set.
func HasTimeRange(req TimeRangeRequest) bool {
return req.GetStart() == 0 || req.GetEnd() == 0
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to move this helper here, instead of adding a method directly on typesv1.LabelNamesRequest. If I tried to add it directly on the type, the definition got deleted every time we regenerated the protobuf code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that make sense, may be model makes also sense up to you.

@bryanhuhta bryanhuhta requested review from cyriltovena, kolesnikovae and a team October 11, 2023 21:09
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM well done !

Only left few not important comment, you'll have to rebase to my change and may be thing will change a bit :)

@bryanhuhta
Copy link
Contributor Author

I put 38f39cb in dev and ran some quick tests and I couldn't find any appreciable difference for querying label names for the store gateway regardless of the time window. For a 2d to 14d windows it takes about 100ms from my browser and about 1 - 10ms server side.

I'll merge this in and let it cook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants