8. CloudWatch Application Signals for n8n
Spike for issue #14. The question: can n8n appear in CloudWatch Application Signals (traces, service map, SLOs on the editor and webhook endpoints), and is it worth a grammar option?
8.1 Method
Written before the measures were taken. Results are in 8.3.
Options under test
| Option | What it is | Spans expected |
|---|---|---|
| A. Native | n8n's own OpenTelemetry tracing (N8N_OTEL_ENABLED=true), available since n8n 2.19.0, sent over OTLP to the CloudWatch agent sidecar | workflow.execute, node.execute |
| B. ADOT | The AWS Distro for OpenTelemetry Node.js agent loaded with NODE_OPTIONS=--require, copied into the task by an init container | Inbound HTTP, outbound HTTP, database, Redis |
n8n's documentation says a second OpenTelemetry setup in the process makes n8n step aside and ignore its own settings. So A and B are expected to exclude each other. The test checks this instead of assuming it.
Measures
- Does n8n start and run a webhook workflow with an HTTP Request node, with each option.
- Which span names, span kinds and attributes appear, per request and per execution.
- Spans per execution of the test workflow, with node spans on and off.
- CPU and memory of the n8n container with no tracing, A and B, under the same load.
- Whether Application Signals creates a service and metrics (latency, error, fault) from these spans. It needs
SERVERorCONSUMERspan kinds, which only the AWS test can show. - Cost at 5% and 100% sampling, priced from the AWS pricing page on the day of the test.
Setup
- Local: Docker, the n8n image behind
n8n.version: stable, an OpenTelemetry Collector that prints spans, a fixed test workflow driven by a loop of 200 webhook calls. - AWS: one deployment of the sample
fixtures/configuration/minimal.yamlin eu-west-3, with the sidecar changed by hand outsidesrc/, then destroyed.
Decision rule
Recommend a grammar option if at least one option gives Application Signals services with working metrics, at an overhead under 10% CPU and memory on the main task, and a cost at 5% sampling the maintainer accepts as a default-off option. Otherwise record the findings and stop.
8.2 What n8n offers natively
- The pinned
stabletag resolves to n8n 2.49.8. It documentsN8N_OTEL_*variables since 2.19.0 and ships the OpenTelemetry SDK. The feature is in Preview. - Native tracing exports
workflow.executeandnode.executespans (and agent spans), each withn8n.*attributes. It exports nothing for HTTP requests, database queries or outbound calls. - n8n's documentation says a second OpenTelemetry setup in the process makes n8n step aside. Observed with the ADOT agent loaded and
N8N_OTEL_ENABLED=true: the workflow and node spans were still exported, through the ADOT tracer provider. They form their own trace, separate from the trace of the inbound webhook request.
8.3 Results
Test workflow: a webhook, then an HTTP Request node on a public HTTPS address. Single runs, 29 November 2026. Sizes are those of the minimal sample (one Fargate task, 0.5 vCPU, 1 GiB, arm64, Aurora Serverless v2, eu-west-3), with n8n.version pinned to 2.49.8. The task runs n8n, its task runner and, when present, the agent.
Spans (local Docker, then ECS)
| Option | Spans per webhook execution | Span kinds |
|---|---|---|
| A. Native | 3: workflow.execute, 2 × node.execute | all Internal |
| B. ADOT | about 17 locally, 148 in an X-Ray trace on ECS: 1 Server, 1 Client for the HTTP call, a dozen of Express middleware spans, and about 66 PostgreSQL queries | Server, Client, Internal |
Per-request PostgreSQL queries come from n8n saving the execution; they dominate the span count. At idle, ADOT still produced about 16 sampled traces a minute, each a single background query.
Application Signals
- A: no Application Signals service appeared. X-Ray's service graph showed one node named
workflow.execute. Application Signals derives its service metrics fromServerspans and its dependency metrics fromClientspans. The spans of option A are allInternal, and no service was created. - B: the service
n8n-appsigappeared with Latency, Error and Fault metrics, operations such asGET /webhook, and the dependenciespostgresqland the outbound host. This confirms that no change to n8n is needed.
Overhead on ECS
CPU and memory are the task averages from CloudWatch for the ECS service over 5 minutes at 5 requests a second; p95 is the latency seen from a client behind CloudFront.
| Condition | CPU of 0.5 vCPU | Memory of 1 GiB | p95 latency |
|---|---|---|---|
| No tracing | 30% | 39% | 0.24 s |
| A. Native, CloudWatch agent present | 39% | 41% | 0.24 s |
| B. ADOT with Application Signals | 77% | 55% | 0.78 s |
With a load as fast as the client allowed (3000 requests, 4 in parallel), the task saturated in both cases. No tracing: 17 requests a second. ADOT: 6.5 requests a second. Locally, CPU per request was within the noise of the runs (35 to 53 ms in every condition), and the ADOT memory was 50 to 70 MiB above native.
Other costs seen: the ADOT agent weighs 102 MB as an npm install, copied by the init container at each task start; and n8n's log stream gained a warning line per instrumented module, many times at start.
The existing sidecar
The sidecar of cdk/metrics.py carries only logs.metrics_collected.prometheus. Application Signals needs two more sections in the same CW_CONFIG_CONTENT: traces.traces_collected.application_signals and logs.metrics_collected.application_signals. The test ran the agent with those two sections alone, with the same image, and not together with the Prometheus section, so sharing one sidecar is plausible but untested. The agent needs the CloudWatchAgentServerPolicy permissions on the task role, which the stack does not grant.
Cost
Prices are from the CloudWatch pricing page on the day of the test (US East). Application Signals bills $1.50 per million signals for the first 100 million, then $0.75 and $0.30. A signal is one inbound request or one outbound dependency call. X-Ray stores traces at $5 per million after 100,000 free a month.
- B: about 68 signals per webhook execution (1 inbound, 1 outbound HTTP, about 66 PostgreSQL queries), so about $100 per million executions, before any background polling. Idle background queries add a few signals a second, roughly 10 million a month, from one 3-minute idle window and with a wide margin. The signals do not depend on the sampling rate. The ADOT run used the X-Ray sampler (1 trace a second plus 5%); the 5% and 100% trace figures are computed from the prices and from the trace counts seen, not from two runs. Only the X-Ray traces do: at 5% about $0.50 per million executions (two traces each), at 100% about $10.
- A: no signals. X-Ray traces would be one per execution, $0.25 per million at 5% and $5 at 100%, if the traces were sent to X-Ray.
8.4 Recommendation
Do not add observability.application_signals to the grammar.
- B meets the goal of services and dependencies without changing n8n, but fails the decision rule: the task CPU went from 30% to 77% at the same load, and the signals alone cost more than the $69 monthly estimate of the minimal deployment from about 0.7 million executions a month.
- A has a low overhead and gives per-workflow and per-node traces, which is what an n8n operator can act on, but Application Signals ignores
Internalspans. - Anyone who wants native traces can already set
N8N_OTEL_ENABLEDandN8N_OTEL_EXPORTER_OTLP_ENDPOINTinn8n.envand point them at their own collector. No grammar change is needed.
Worth revisiting if n8n marks tracing generally available, adds Server-kind spans for webhooks, or if the ADOT overhead drops on a larger task.
Limits of this test: one run per condition; the 0.5 vCPU task is small; the CPU figures include the task runner and the agent; the signal counts per request come from the trace composition of 15 sampled traces, not from billing.