Add configuration option to disable Metrics

Origin

Is the data on https://flink.is/metrics something you actually want to expose?

Problem

Currently, flink always exposes the /metrics endpoint. For public instances this exposes metrics for all links and Kestrel specific performance metrics. Anyone with access to the WebUI can currently also access the /metrics page. Instance operators cannot choose whether they want to have that publicly available or not. Some instance maintainers don't need Prometheus metrics at all. Others want Metrics, but don't want to expose them to the public

Solution Design

  • introduce feature-toggle in appsettings that allows to enable/disable metrics endpoint. Default: enabled.
  • introduce (optional) Basic Auth credentials for the /metrics endpoint (have that configurable in the appsettings). Default: none.

References

Edited by Raffael Rehberger