From 7ed2921efbce7fa5134206763eea986c6ef9a919 Mon Sep 17 00:00:00 2001 From: Frank Nagel Date: Wed, 8 Sep 2021 11:18:21 +0200 Subject: [PATCH] fix: Add default configuration file for prometheus monitoring --- README.md | 5 ++--- config/prometheus.json | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 config/prometheus.json diff --git a/README.md b/README.md index 7eb06383..2897a208 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/config/prometheus.json b/config/prometheus.json new file mode 100644 index 00000000..529e8cd4 --- /dev/null +++ b/config/prometheus.json @@ -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] +}