-
Notifications
You must be signed in to change notification settings - Fork 487
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
Prototype using our own embedded HTTP server #3780
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.
Left some comments to help read the code.
// ==== configuration NOT exposed in River configs === | ||
|
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.
Exposing these in River would be trivial now and all components could benefit from new configuration options, e.g. TLS.
) | ||
|
||
// ServerConfig is a River configuration that allows one to configure a weaveworks.Server. It | ||
// exposes a subset of the available configurations. | ||
// ServerConfig for a Server | ||
type ServerConfig struct { |
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 struct is a merge of our ServerConfig and the weaveworks' server Config.
But we would be in control of how this works and what is available in River.
@@ -0,0 +1,55 @@ | |||
package net |
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 file is verbatim copied from weaveworks common.
@@ -1,97 +1,353 @@ | |||
package net |
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 a modified copy of weaveworks' common server. I've removed the GRPC support and made it work with our merged configuration struct.
Name: "tcp_connections", | ||
Help: "Current number of accepted TCP connections.", | ||
}, []string{"protocol"}) | ||
reg.MustRegister(tcpConnections) |
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 will now be able to use Register
and reuse the existing metric if it's already registered. Avoiding the need for workaround here #3711
@thepalbi @tpaschalis When you have some time, I would appreciate some feedback on this idea. |
Had a chat with @tpaschalis about this and we'll explore a couple of alternatives before that, but we keep it as a an open alternative for the future. We should note that we already have a fork of weaveworks server in |
PR Description
Problem
Thinking about our recent components that embed an HTTP server, there are a few issues with weaveworks sever:
Proposed solution
The weaveworks server is not very complex though (500LOC) and I think we can maintain a similar implementation of our own that would be simpler and suit our needs better.
This PR is a quick hack to show how this could work in practice and verify how much code would this require.
Alternatives
Alternatives are:
Which issue(s) this PR fixes
Notes to the Reviewer
PR Checklist