scionproto / scion

SCION Internet Architecture
https://www.scion-architecture.net/
Apache License 2.0
373 stars 156 forks source link

HTTP addr of service should not be hidden in Metrics config. #2312

Open lukedirtwalker opened 5 years ago

lukedirtwalker commented 5 years ago

In env.Metrics we specify the address we export Prometheus metrics. But we deliberately also serve other data on this address. Therefore we should change:

  1. Rename Metrics.Prometheus config to HTTP.Address and add a flag whether Prometheus should be enabled.
  2. Do not call http.ListenAndServe in env.StartPrometheus it should be the app's responsibility to do so.
matzf commented 2 years ago

We now have a separate [metrics] and [api] configuration sections, to define the listen address of separate web services responsible for the prometheus metrics and OpenAPI, respectively. The applications start both services explicitly if configured, as required in 2 above.

The StatusPages APIs are still available via both the "metrics" and the "api" server. This does not appear to make much sense and should be cleaned up.