Add metrics endpoint (#1515)

This commit adds the new package prom-client in order to expose metrics
to prometheus as well as the endpoint and the configuration to do so.
This commit is contained in:
Bruno Bacarini
2021-03-10 23:10:10 +00:00
committed by GitHub
parent 8d2371917f
commit b0b172a362
3 changed files with 41 additions and 5 deletions

View File

@@ -446,6 +446,20 @@ const config = convict({
},
endpoints: {
metrics: {
enable: {
format: 'Boolean',
default: false,
env: 'N8N_ENABLE_METRICS',
doc: 'Enable metrics endpoint',
},
prefix: {
format: String,
default: 'n8n_',
env: 'N8N_METRICS_PREFIX',
doc: 'An optional prefix for metric names. Default: n8n_',
},
},
rest: {
format: String,
default: 'rest',
@@ -471,7 +485,7 @@ const config = convict({
doc: 'Disable production webhooks from main process. This helps ensures no http traffic load to main process when using webhook-specific processes.',
},
skipWebhoooksDeregistrationOnShutdown: {
/**
/**
* Longer explanation: n8n deregisters webhooks on shutdown / deactivation
* and registers on startup / activation. If we skip
* deactivation on shutdown, webhooks will remain active on 3rd party services.