* docker: prometheus and grafana for development
Add prometheus and grafana docker configuration when developing with access to the enterprise repository. This simplifies the setup for developers adding new metrics or even examining events from their development server. The services are disabled by default when no enterprise source is detected.
Grafana is provisioned automatically with the Prometheus datasource, as well as the canonical dashboards used with Mattermost. Furthermore, no authentication is required to access Grafana to simplify access from a development environment. The default home dashboard is customized to automatically show links to the provisioned dashboards. Dashboards can be saved, and login remains available via the default `admin/admin` credentials (which initiates a password reset), but no dashboard or system configuration is (currently) persisted if the container is destroyed.
Linux requires slightly special handling (well, really it's Docker for MacOS/Windows), in that `host.docker.internal` is the canonical way to resolve the host on MacOS/Windows, but on Linux it's usually sufficient to just use `localhost`. Until https://github.com/docker/for-linux/issues/264 is resolved, this PR includes code to customize the Prometheus configuration to point at the required address for the running platform.
* metrics: track active jobs by type
* metrics: active jobs chart
* metrics: server start and job annotations
* Update build/docker-compose.common.yml
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
* prometheus: resolve docker host via 172.17.0.1 instead
* skip enabling prometheus and grafana by default
* handle JOB_STATUS_ERROR and JOB_STATUS_CANCELED end states
* handle nil srv.metrics
* lookup job to determine type for metrics
* mocked unit tests for jobs
* goimports lint fixes
* missing license
* add instance to server start tag
* filter annotations by selected instance
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>