-
Notifications
You must be signed in to change notification settings - Fork 273
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
custom listenaddr and endpoints for plugins #1654
Conversation
This comment has been minimized.
This comment has been minimized.
b909669
to
19ed5ea
Compare
Still needs a changelog entry but I feel like its ready for (code) review |
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.
You still have some TODOs. I don't know if you plan to address them in this PR or not. Also I'm not convinced about the naming web_endpoints
but I don't have better name :p. Good job !
// TODO [igni]: I believe configuring the router | ||
// To listen to port 0 would lead it to change ports on every restart Oo | ||
|
||
// serve main router | ||
|
||
// if we received a TCP listener, reuse it, otherwise create a new one | ||
#[cfg_attr(not(unix), allow(unused_mut))] |
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 think it's now useless. Not sure
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.
do we know who can answer this?
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 don't think any of us develop on Windows. You could just try removing it and then start a circelCI build and see how the Windows build proceeds...
// populate the new listen addrs | ||
for (listen_addr, routers) in extra_routers.into_iter() { | ||
// if we received a TCP listener, reuse it, otherwise create a new one | ||
#[cfg_attr(not(unix), allow(unused_mut))] |
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 think we don't need this.
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.
Great work! A few nits, but nothing substantial.
|
||
let router = make_axum_router(service_factory, &configuration, plugin_handlers)?; | ||
// TODO [igni]: I believe configuring the router | ||
// To listen to port 0 would lead it to change ports on every restart Oo |
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 think that's already an issue. I guess you are noting that it's an issue for --hot-reload since that might be surprising.
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.
Yeah, it's not new, it was just a side by thought, I ll open an issue about that and we'll see if we wanna fix this
let url = format!( | ||
"{}/graphql", | ||
server.graphql_listen_address().as_ref().unwrap() | ||
); |
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.
NIT: We are doing this a lot. There must be a way to make this DRYer... I know this is an existing problem, but you see it and you can't un-see it..
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.
haha that's fair enough, let's open a followup
❗ BREAKING ❗
The prometheus endpoint now listens to 0.0.0.0:9090/metrics by default. It previously listened to http://0.0.0.0:4000/plugins/apollo.telemetry/prometheus
Have a look at the Features section to learn how to customize the listen address and the path
🚀 Features
Allow users to customize the prometheus endpoint URL (#1645)
You can now customize the prometheus endpoint URL in your yml configuration: