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:
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).
An idea that I had in mind for long time, is to actually embed the "zpages" into Host:
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: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 thehttp.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