Metrics with Prometheus (#2069)

* Basic process metrics

* Enable Prometheus by an environment variable

* Code formatting

* Documentation for Prometheus metrics

* Link from README to documentation of Prometheus

* Link from README to documentation of Prometheus

* Link from README to documentation of Prometheus

* Separate module for metrics + tests

* Metrics limited by IP

* Metrics are forbidded for all requets by default

* Code refactoring

* allowedIps passed as a string to PrometheusMetrics

* Handle missing config

* METRICS_PROMETHEUS_ALLOWED_IPS added to documentation

* Log info about enabled metrics

* Unused code removed

* package-lock.json updated

* prom-client updated to 11.1.2

* Code refactoring

* Do not read IP address from X-Forwarder-For header
This commit is contained in:
Marcin Mielnicki
2018-11-04 18:54:43 +01:00
committed by GitHub
parent 1460855d6b
commit bc4bd79e90
8 changed files with 180 additions and 3 deletions

View File

@@ -132,12 +132,14 @@ SVG or JSON output. When deliberately changing the output, run
`SNAPSHOT_DRY=1 npm run test:js:server` to preview changes to the saved
snapshots, and `SNAPSHOT_UPDATE=1 npm run test:js:server` to update them.
The server can be [configured][sentry configuration] to use [Sentry][sentry].
The server can be configured to use [Sentry][] ([configuration][sentry configuration]) and [Prometheus][] ([configuration][prometheus configuration]).
[package manager]: https://nodejs.org/en/download/package-manager/
[snapshot tests]: https://glebbahmutov.com/blog/snapshot-testing/
[sentry configuration]: doc/self-hosting.md#sentry
[Prometheus]: https://prometheus.io/
[prometheus configuration]: doc/self-hosting.md#prometheus
[Sentry]: https://sentry.io/
[sentry configuration]: doc/self-hosting.md#sentry
Hosting your own server
-----------------------