opentelemetry-collector
opentelemetry-collector copied to clipboard
Make the service Host own an `http.Server` for extensions to use
An idea that I had in mind for long time, is to actually embed the "zpages" into Host:
- Host will have to start an "http.Server" that can be shared between "health check", "zpages", "status", "etc.".
- If we do this, the zpages/health extensions (maybe) becomes almost a no-op.
How I would design this is probably on the Host interface allow any component to "Register" a path/handler similar with http.ServerMux, something like:
RegisterHandler(pattern string, handler http.Handler)
Then we should extend the "service" configuration to accept an http server configuration for this, and maybe some options to say "register trace zpages", "register metrics zpages", etc.
The service.Host can accept this instance of the http.Server (similar to how you construct things like telemetry).
Originally posted by @bogdandrutu in https://github.com/open-telemetry/opentelemetry-collector/pull/5294#discussion_r861912539
See more details on the linked PR
Should this be closed, given that #5294 has been merged?
No, I think this should be kept open. #5294 improved things a bit, but we may still want to do this.