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
Move all routes and handlers into scoped blocks #321
Conversation
This helps making individual dependencies more clear and should show better how to refactor going forward.
server := httpserver.New(o.Logger, store, validator, transforms) | ||
receiver := receive.NewHandler(o.Logger, o.ForwardURL, prometheus.DefaultRegisterer) | ||
var store store.Store | ||
u, err := url.Parse(o.ForwardURL) |
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.
this is not really specific to the v1 routes since it's used by v2 storage too, right? maybe we can move this flag parsing to ~ line 277 with some of the other parsing
o.Whitelist[i] = s | ||
i++ | ||
} | ||
whitelister, err := metricfamily.NewWhitelist(o.Whitelist) |
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.
TODO we need to eventually port this functionality into the remote write api as well
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.
We should be able to make this a middleware just like everything else, right?
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.
yes exactly
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
let's do some more cleanup in the flag parsing in more followups, yeah?
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: metalmatze, squat The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
4 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
This helps making individual dependencies more clear and should show
better how to refactor going forward.
/cc @squat