fix: Add default configuration file for prometheus monitoring

This commit is contained in:
Frank Nagel
2021-09-08 11:18:21 +02:00
committed by Jovan Krunić
parent 1596b6e3b8
commit 7ed2921efb
2 changed files with 9 additions and 3 deletions

View File

@@ -52,13 +52,12 @@ The middleware may be configured with JSON provided in `config/prometheus.json`,
{
"metricsPath": "/metrics",
"collectDefaultMetrics": true,
"requestDurationBuckets": [0.1, 0.5, 1, 2],
"requestDurationBuckets": [0.1, 0.5, 1, 2, 5, 10, 20],
"requestLengthBuckets": [512, 1024, 5120, 10240, 51200, 102400],
"responseLengthBuckets": [512, 1024, 5120, 10240, 51200, 102400]
}
```
You can get a compatible grafana dashboard at [grafana.com](https://grafana.com/grafana/dashboards/14565).
The available options are documented on [npmjs](https://www.npmjs.com/package/express-prometheus-middleware) or the [homepage](https://github.com/joao-fontenele/express-prometheus-middleware#readme) of the express-prometheus-middleware project. You may get a compatible grafana dashboard at [grafana.com](https://grafana.com/grafana/dashboards/14565).
## Start backend
Run `npm install` and `npm run build`, then start with `npm start`. The server should now be accepting connections at `http://localhost:3000`.

7
config/prometheus.json Normal file
View File

@@ -0,0 +1,7 @@
{
"metricsPath": "/metrics",
"collectDefaultMetrics": true,
"requestDurationBuckets": [0.1, 0.5, 1, 2, 5, 10, 20],
"requestLengthBuckets": [512, 1024, 5120, 10240, 51200, 102400],
"responseLengthBuckets": [512, 1024, 5120, 10240, 51200, 102400]
}