Skip to content

Commit 0ce067c

Browse files
(docs) Style fixes for n8n integration (DataDog#23816)
* (docs) Style fixes for n8n integration * Fix typo * tiny edits
1 parent 7e7ccb5 commit 0ce067c

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

n8n/README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@
44

55
This check monitors [n8n][1] through the Datadog Agent.
66

7-
Collect n8n metrics including:
7+
This integration collects n8n metrics including:
88
- Cache metrics: hit, miss, and update counts.
9-
- Workflow metrics: started, success, failed counters, audit workflow lifecycle counters; in n8n 2.x, an execution-duration histogram.
10-
- Node metrics: per-node started and finished counters emitted by worker processes in queue mode.
9+
- Workflow metrics: Started, success, and failed counters. Audit workflow life cycle counters. In n8n 2.x, an execution-duration histogram.
10+
- Node metrics: per-node counters (started and finished) emitted by worker processes in queue mode.
1111
- Queue metrics: queue depth; enqueued, dequeued, completed, failed, and stalled counters; and scaling-mode worker gauges.
1212
- HTTP metrics: request duration histograms tagged with status code.
1313
- Process and Node.js runtime metrics.
1414

15-
1615
## Setup
1716

18-
Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the [Autodiscovery Integration Templates][3] for guidance on applying these instructions.
17+
Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the [Autodiscovery integration templates][3] for guidance on applying these instructions.
1918

2019
### Installation
2120

@@ -26,7 +25,9 @@ No additional installation is needed on your server.
2625

2726
#### Enable the n8n metrics endpoint
2827

29-
The `/metrics` endpoint is disabled by default and must be enabled in your n8n configuration. Note that the `/metrics` endpoint is only available for self-hosted instances and is not available on n8n Cloud.
28+
The `/metrics` endpoint is disabled by default and must be enabled in your n8n configuration.
29+
30+
**Note**: The `/metrics` endpoint is only available for self-hosted instances and is not available on n8n Cloud.
3031

3132
Set the following environment variables to enable metrics:
3233

@@ -51,7 +52,7 @@ N8N_METRICS_PREFIX=n8n_
5152

5253
For more details, see the n8n documentation on [enabling Prometheus metrics][10].
5354

54-
If you change `N8N_METRICS_PREFIX` from its default of `n8n_`, you **must** also set `raw_metric_prefix` in the integration's `conf.yaml` to the same value. Otherwise the check will not recognize the exposed metric names and will silently submit nothing:
55+
If you change `N8N_METRICS_PREFIX` from its default of `n8n_`, you **must** also set `raw_metric_prefix` in the integration's `conf.yaml` to the same value. Otherwise the check does not recognize the exposed metric names and silently submits nothing:
5556

5657
```yaml
5758
instances:
@@ -63,12 +64,12 @@ instances:
6364
6465
Most n8n counters are registered dynamically the first time their underlying event fires. The integration ships mappings for around 70 of these event-bus counters, including:
6566
66-
- Workflow lifecycle: `n8n.workflow.started.count`, `n8n.workflow.success.count`, `n8n.workflow.failed.count`, `n8n.workflow.cancelled.count`
67+
- Workflow life cycle: `n8n.workflow.started.count`, `n8n.workflow.success.count`, `n8n.workflow.failed.count`, `n8n.workflow.cancelled.count`
6768
- Audit (workflow, user, credentials, package, variable, execution data): `n8n.audit.workflow.executed.count`, `n8n.audit.user.login.success.count`, `n8n.audit.user.credentials.created.count`, and similar
6869
- AI nodes: `n8n.ai.tool.called.count`, `n8n.ai.llm.generated.count`, `n8n.ai.vector.store.searched.count`, and similar
69-
- Runner, queue, and node lifecycle: `n8n.runner.task.requested.count`, `n8n.queue.job.completed.count`, `n8n.node.started.count`, `n8n.node.finished.count`
70+
- Runner, queue, and node life cycle: `n8n.runner.task.requested.count`, `n8n.queue.job.completed.count`, `n8n.node.started.count`, `n8n.node.finished.count`
7071

71-
These counters do not appear on the `/metrics` endpoint until the corresponding event has occurred. A healthy idle deployment will not produce data points for them until that activity fires. The complete list is in [`metadata.csv`][7].
72+
These counters do not appear on the `/metrics` endpoint until the corresponding event has occurred. A healthy idle deployment does not produce datapoints for them until that activity fires. The complete list is in [`metadata.csv`][7].
7273

7374
If a future n8n release exposes a new event-driven counter that is not yet covered by this integration, add it to the `extra_metrics` option in your instance configuration:
7475

@@ -85,7 +86,9 @@ The left-hand side is the Prometheus counter name as n8n exposes it (keep the `_
8586

8687
In queue mode, n8n runs separate worker processes that execute jobs picked up from a Redis-backed queue. Each worker exposes its own `/metrics` endpoint and emits a different subset of metrics than the main process. Worker-observed metrics include `n8n.queue.job.dequeued.count`, `n8n.queue.job.stalled.count`, `n8n.node.started.count`, `n8n.node.finished.count`, and `n8n.runner.task.requested.count`. Main-only metrics include `n8n.instance.role.leader` and the `n8n.scaling.mode.queue.jobs.*` family.
8788

88-
To expose worker metrics, set `QUEUE_HEALTH_CHECK_ACTIVE=true` and `QUEUE_HEALTH_CHECK_PORT=<port>` on each worker. **In n8n 2.x, port `5679` is reserved for the task runner broker, so pick a different port (for example `5680`).**
89+
To expose worker metrics, set `QUEUE_HEALTH_CHECK_ACTIVE=true` and `QUEUE_HEALTH_CHECK_PORT=<port>` on each worker.
90+
91+
**Note**: In n8n 2.x, port `5679` is reserved for the task runner broker. Pick a different port (for example `5680`).
8992

9093
For full coverage in queue deployments, configure one Datadog instance per n8n process exposing `/metrics`, including main and worker processes:
9194

@@ -107,11 +110,11 @@ Several metric families were introduced in n8n 2.x and are not emitted on n8n 1.
107110
- The `n8n.{production,manual,production.root}.executions`, `n8n.users.total`, `n8n.enabled.users`, `n8n.workflows.total`, and `n8n.credentials.total` family. Only emitted when `N8N_METRICS_INCLUDE_WORKFLOW_STATISTICS=true` is set.
108111
- The `n8n.expression.*` family (`evaluation.duration.seconds`, `code.cache.{hit,miss,eviction,size}`, `pool.{acquired,replenish.failed,scaled.up,scaled.to.zero}`). Only emitted when n8n is running the new VM-isolated expression engine *and* observability for it is on. Set `N8N_EXPRESSION_ENGINE=vm` and `N8N_EXPRESSION_ENGINE_OBSERVABILITY_ENABLED=true` on the n8n process; both default to off (the engine defaults to `legacy`). These metrics surface the per-expression evaluation latency, the compiled-expression LRU cache hit and miss rates, and the V8-isolate pool's idle scaling behavior. They are most useful for troubleshooting workflow latency that traces back to slow `{{ ... }}` evaluation.
109112

110-
Some metrics only emit samples after the corresponding runtime event occurs. For example, failures-only counters (`*.failures.count`) need an authentication failure, audit workflow counters need the matching workflow state transition, and the libuv `n8n.nodejs.active.requests` gauge needs an in-flight libuv request. A healthy idle deployment may not produce data points for these metrics until that activity occurs.
113+
Some metrics only emit samples after the corresponding runtime event occurs. For example, failures-only counters (`*.failures.count`) need an authentication failure, audit workflow counters need the matching workflow state transition, and the libuv `n8n.nodejs.active.requests` gauge needs an in-flight libuv request. A healthy idle deployment may not produce datapoints for these metrics until that activity occurs.
111114

112115
#### Tag cardinality
113116

114-
When `N8N_METRICS_INCLUDE_WORKFLOW_ID_LABEL=true`, http and workflow execution histograms are tagged with `workflow_id` (and similar labels for nodes). On deployments with many distinct workflows or nodes, this can produce high-cardinality metrics. Drop the label via `exclude_labels` or omit `N8N_METRICS_INCLUDE_WORKFLOW_ID_LABEL` to keep tag cardinality bounded.
117+
When `N8N_METRICS_INCLUDE_WORKFLOW_ID_LABEL=true`, http and workflow execution histograms are tagged with `workflow_id` (and similar labels for nodes). On deployments with many distinct workflows or nodes, this can produce high-cardinality metrics. Drop the label through `exclude_labels` or omit `N8N_METRICS_INCLUDE_WORKFLOW_ID_LABEL` to keep tag cardinality bounded.
115118

116119
#### Configure the Datadog Agent
117120

@@ -121,7 +124,7 @@ When `N8N_METRICS_INCLUDE_WORKFLOW_ID_LABEL=true`, http and workflow execution h
121124

122125
### Log collection
123126

124-
_Available for Agent versions >6.0_
127+
**Note**: Available for Agent versions 6.0 and later.
125128

126129
#### Enable n8n logging
127130

0 commit comments

Comments
 (0)