-
Notifications
You must be signed in to change notification settings - Fork 673
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
Conversation
pkg/util/time.go
Outdated
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 | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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 :)
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. |
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.