-
Notifications
You must be signed in to change notification settings - Fork 453
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
[query] Take bounds into account for list endpoints #3110
Conversation
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.
some q's / suggestions but LG!
} | ||
|
||
if start.After(end) { | ||
err := fmt.Errorf("start %v must be after end %v", start, end) |
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.
before end
// ParseStartAndEnd parses start and end params from the request. | ||
func ParseStartAndEnd( | ||
r *http.Request, | ||
parseOpts xpromql.ParseOptions, |
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.
why does this need the whole parseOpts
instead of only the NowFn()
?
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.
Figured this was cleaner than building a new parseOpts
on each query; can go that route if preferred
parseOpts xpromql.ParseOptions, | ||
) (time.Time, time.Time, error) { | ||
if err := r.ParseForm(); err != nil { | ||
return time.Time{}, time.Time{}, xerrors.NewInvalidParamsError(err) |
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.
will this propagate as a 400?
@@ -123,7 +123,7 @@ func TestTagValues(t *testing.T) { | |||
url := fmt.Sprintf("/label/{%s}/values", NameReplace) | |||
|
|||
for _, tt := range names { | |||
path := fmt.Sprintf("/label/%s/values", tt.name) | |||
path := fmt.Sprintf("/label/%s/values?start=100", tt.name) |
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.
can we have a case with an end too?
Codecov Report
@@ Coverage Diff @@
## master #3110 +/- ##
=========================================
- Coverage 72.2% 72.2% -0.1%
=========================================
Files 1084 1084
Lines 100264 100188 -76
=========================================
- Hits 72484 72416 -68
+ Misses 22751 22734 -17
- Partials 5029 5038 +9
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
* master: [DOCS] Update to cluster docs (#3084) [dbnode][coordinator] Ensure docs limit is propagated for search and aggregate RPCs (#3108) [query] Take bounds into account for list endpoints (#3110) Add warning to changing blocksize (#3096) Add support for dynamic query limit overriding (#3090) [tests] test setups exported to allow us to use it from other packages (#3042) [query] Implemented Graphite's pow function (#3048) [dbnode] Direct conversion of encoded tags to doc.Metadata (#3087) [tests] Skip flaky TestWatchNoLeader (#3106) [dbnode] Faster search of tag bytes in convert.FromSeriesIDAndTags (#3075) Replace bytes.Compare() == 0 with bytes.Equal() (#3101) Capture seekerMgr instead Rlock (#3104) [m3db] Check bloom filter before stream request allocation (#3103)
Adds bounds parsing to
/api/v1/labels
and/api/v1/label/<label_name>/values
endpoints