-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implement am proxy
command
#128
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I think this is the correct way of dealing with this 👍
I think |
hatchan
reviewed
Aug 30, 2023
Co-authored-by: Benno van den Berg <hatchan@users.noreply.github.com>
Co-authored-by: Benno van den Berg <hatchan@users.noreply.github.com>
This reverts commit 87f30a8.
hatchan
approved these changes
Aug 30, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for an
am proxy
command, which would--listen-address
and--explorer-address
)/prometheus
to a user-specified url (configured via--prometheus-url
)So, if we already had prometheus running on
http://localhost:8063
for some odd reason, we could run:And
am
would not download/launch prometheus, but explorer would still be accessible and automagically connected to the Prometheus instance we're interested in connecting to.For what it's worth, I tested that scenario, and it does indeed work.
Where I need help
I wanted to create a handler factory, but struggled immensely with the type definition, because you can't use
impl Trait
to describe the return type for aFn
trait (rust-lang/rust#99697).What I wanted was something that looked like:
Ultimately, I gave up, and opted to use inline blocks/closures to define the handlers for this functionality.
Additionally, I figured we would need to rewrite the path of any requests to
/prometheus/*
before forwarding to the external prometheus. There has to be a better/more concise way than I chose.Basically, this PR still needs some cleanup, api review (is
proxy
the right command name even?), and probably some tests.Checklist