For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/integrations/n8n.md. A documentation index is available at /llms.txt.

n8n

Supported OS Linux Windows Mac OS

Integration version1.0.0

To find out if this integration is available in your organization, see your Datadog Integrations page or ask your organization administrator.

To initiate an exception request to enable this integration for your organization, email support@ddog-gov.com.

Overview

This check monitors n8n through the Datadog Agent.

n8n (pronounced n-eight-n) is a workflow automation platform that connects API-enabled apps with minimal code.

This check collects the following n8n metrics:

  • Cache metrics: Monitor cache effectiveness (hit rate), identify performance bottlenecks, and detect cache errors.
  • Message event bus metrics: Monitor event processing health, detect bottlenecks in event handling, track event bus connectivity, and identify processing failures.
  • Workflow metrics: Track workflow success rates, identify slow or failing workflows, monitor concurrent execution load, and analyze execution patterns.
  • Queue metrics: Monitor queue health, identify processing bottlenecks, track job success rates, analyze wait times, and detect retry patterns or persistent failures.

Setup

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 for guidance on applying these instructions.

Installation

The n8n check is included in the Datadog Agent package. No additional installation is needed.

Enable the n8n metrics endpoint

The /metrics endpoint is disabled by default and must be enabled in your n8n configuration.

Note: The /metrics endpoint is only available for self-hosted instances and is not available on n8n Cloud.

Set the following environment variables to enable metrics:

# Required: Enable the metrics endpoint
N8N_METRICS=true

# Optional: Include additional metric categories
N8N_METRICS_INCLUDE_DEFAULT_METRICS=true
N8N_METRICS_INCLUDE_CACHE_METRICS=true
N8N_METRICS_INCLUDE_MESSAGE_EVENT_BUS_METRICS=true
N8N_METRICS_INCLUDE_WORKFLOW_ID_LABEL=true
N8N_METRICS_INCLUDE_API_ENDPOINTS=true

# Optional: Customize the metric prefix (default is 'n8n_')
N8N_METRICS_PREFIX=n8n_

For more details, see the n8n documentation on enabling Prometheus metrics.

Configure the Datadog Agent

  1. Edit the n8n.d/conf.yaml file in the conf.d/ folder at the root of your Agent’s configuration directory. See the sample n8n.d/conf.yaml for all available configuration options.

  2. Restart the Agent.

Log collection

Available for Agent versions 6.0+.

Enable n8n logging

Configure n8n to output logs by setting the following environment variables:

# Set the log level (error, warn, info, debug)
N8N_LOG_LEVEL=info

# Output logs to console (for containerized environments) or file
N8N_LOG_OUTPUT=console

# If using file output, specify the log file location
# N8N_LOG_FILE_LOCATION=/var/log/n8n/n8n.log

Structured event logs

n8n can output structured JSON logs to n8nEventLog.log containing detailed workflow execution events. To enable structured event logs, set log output to file:

N8N_LOG_OUTPUT=file
N8N_LOG_FILE_LOCATION=/var/log/n8n/

The event log includes the following event types:

Event TypeDescription
n8n.workflow.startedWorkflow execution has begun
n8n.workflow.successWorkflow completed successfully
n8n.workflow.failedWorkflow execution failed
n8n.node.startedIndividual node started execution
n8n.node.finishedIndividual node completed execution
n8n.audit.workflow.executedAudit trail for workflow execution

Each event contains metadata including executionId, workflowId, workflowName, nodeType, nodeName, and timestamps to correlate with metrics.

Configure the Datadog Agent to collect logs

  1. Collecting logs is disabled by default in the Datadog Agent. Enable it in your datadog.yaml file:

    logs_enabled: true
    
  2. Add this configuration block to your n8n.d/conf.yaml file:

    logs:
      - type: file
        path: /var/log/n8n/*.log
        source: n8n
        service: n8n
    

    For containerized environments using Docker, use the following configuration instead:

    logs:
      - type: docker
        source: n8n
        service: n8n
    
  3. Restart the Agent.

Validation

Run the Agent’s status subcommand and look for n8n under the Checks section.

Data Collected

Metrics

n8n.active.workflow.count
(gauge)
Total number of active workflows.
n8n.api.request.duration.seconds.bucket
(count)
Histogram bucket for API request duration in seconds
n8n.api.request.duration.seconds.count
(count)
The count of API request duration in seconds
n8n.api.request.duration.seconds.sum
(count)
The sum of API request duration in seconds
n8n.api.requests.count
(count)
Total API requests
n8n.cache.errors.count
(count)
Cache errors
n8n.cache.hits.count
(count)
Cache hits
n8n.cache.latency.seconds.bucket
(count)
Histogram bucket for cache operation latency in seconds
n8n.cache.latency.seconds.count
(count)
The count of cache operation latency in seconds
n8n.cache.latency.seconds.sum
(count)
The sum of cache operation latency in seconds
n8n.cache.misses.count
(count)
Cache misses
n8n.cache.operations.count
(count)
Total cache operations
n8n.eventbus.connections.total
(gauge)
Active event bus backend connections
n8n.eventbus.events.count
(count)
Total events published on the event bus
n8n.eventbus.events.failed.count
(count)
Total failed event processing
n8n.eventbus.events.processed.count
(count)
Total processed events
n8n.eventbus.queue.size
(gauge)
Current event queue size
n8n.http.request.duration.seconds.count
(count)
The count of the http responses duration labeled with: status_code
n8n.http.request.duration.seconds.sum
(count)
The sum of the http responses duration labeled with: status_code
n8n.instance.role.leader
(gauge)
Whether this main instance is the leader (1) or not (0).
n8n.last.activity
(gauge)
Time elapsed since the last instance activity (backend request).
Shown as second
n8n.nodejs.active.handles
(gauge)
Number of active libuv handles grouped by handle type. Every handle type is C++ class name.
n8n.nodejs.active.handles.total
(gauge)
Total number of active handles.
n8n.nodejs.active.requests
(gauge)
Number of active libuv requests grouped by request type. Every request type is C++ class name.
n8n.nodejs.active.requests.total
(gauge)
Total number of active requests.
n8n.nodejs.active.resources
(gauge)
Number of active resources that are currently keeping the event loop alive, grouped by async resource type.
n8n.nodejs.active.resources.total
(gauge)
Total number of active resources.
n8n.nodejs.event.loop.lag.seconds
(gauge)
Event loop lag in seconds
n8n.nodejs.eventloop.lag.max.seconds
(gauge)
The maximum recorded event loop delay.
n8n.nodejs.eventloop.lag.mean.seconds
(gauge)
The mean of the recorded event loop delays.
n8n.nodejs.eventloop.lag.min.seconds
(gauge)
The minimum recorded event loop delay.
n8n.nodejs.eventloop.lag.p50.seconds
(gauge)
The 50th percentile of the recorded event loop delays.
n8n.nodejs.eventloop.lag.p90.seconds
(gauge)
The 90th percentile of the recorded event loop delays.
n8n.nodejs.eventloop.lag.p99.seconds
(gauge)
The 99th percentile of the recorded event loop delays.
n8n.nodejs.eventloop.lag.seconds
(gauge)
Lag of event loop in seconds.
n8n.nodejs.eventloop.lag.stddev.seconds
(gauge)
The standard deviation of the recorded event loop delays.
n8n.nodejs.external.memory.bytes
(gauge)
Node.js external memory size in bytes.
n8n.nodejs.gc.duration.seconds.bucket
(count)
Histogram bucket for garbage collection duration by kind
n8n.nodejs.gc.duration.seconds.count
(count)
The count of garbage collection duration by kind
n8n.nodejs.gc.duration.seconds.sum
(count)
The sum of garbage collection duration by kind
n8n.nodejs.heap.size.total.bytes
(gauge)
Process heap size from Node.js in bytes.
n8n.nodejs.heap.size.used.bytes
(gauge)
Process heap size used from Node.js in bytes.
n8n.nodejs.heap.space.size.available.bytes
(gauge)
Process heap space size available from Node.js in bytes.
n8n.nodejs.heap.space.size.total.bytes
(gauge)
Process heap space size total from Node.js in bytes.
n8n.nodejs.heap.space.size.used.bytes
(gauge)
Process heap space size used from Node.js in bytes.
n8n.nodejs.heap.total.bytes
(gauge)
Total heap size allocated in bytes
n8n.nodejs.heap.used.bytes
(gauge)
Heap memory used in bytes
n8n.process.cpu.seconds.count
(count)
Total user and system CPU time spent in seconds.
n8n.process.cpu.system.seconds.count
(count)
Total system CPU time spent in seconds.
n8n.process.cpu.user.seconds.count
(count)
Total user CPU time spent in seconds.
n8n.process.heap.bytes
(gauge)
Process heap size in bytes.
n8n.process.max.fds
(gauge)
Maximum number of open file descriptors.
n8n.process.open.fds
(gauge)
Number of open file descriptors.
n8n.process.resident.memory.bytes
(gauge)
Resident memory size in bytes.
n8n.process.start.time.seconds
(gauge)
Start time of the process since unix epoch in seconds.
n8n.process.uptime.seconds
(gauge)
Process uptime in seconds.
n8n.process.virtual.memory.bytes
(gauge)
Virtual memory size in bytes.
n8n.queue.job.active.total
(gauge)
Number of jobs currently being processed
n8n.queue.job.attempts.count
(count)
Total number of job attempts
n8n.queue.job.completed.count
(count)
Number of jobs completed successfully
n8n.queue.job.delayed.total
(gauge)
Number of jobs scheduled to run later
n8n.queue.job.dequeued.count
(count)
Number of jobs dequeued (picked up from queue)
n8n.queue.job.enqueued.count
(count)
Number of jobs added to the queue
n8n.queue.job.failed.count
(count)
Number of jobs that have failed
n8n.queue.job.waiting.duration.seconds.bucket
(count)
Histogram bucket for duration jobs spend waiting before being processed
n8n.queue.job.waiting.duration.seconds.count
(count)
The count of duration jobs spend waiting before being processed
n8n.queue.job.waiting.duration.seconds.sum
(count)
The sum of duration jobs spend waiting before being processed
n8n.queue.job.waiting.total
(gauge)
Number of jobs currently waiting in the queue
n8n.queue.jobs.count
(count)
Total number of queue jobs
n8n.queue.jobs.duration.seconds.bucket
(count)
Histogram bucket for job duration in seconds
n8n.queue.jobs.duration.seconds.count
(count)
The count of job duration in seconds
n8n.queue.jobs.duration.seconds.sum
(count)
The sum of job duration in seconds
n8n.readiness.check
(gauge)
Readiness check status (1 if ready with status code 200 otherwise 0) with status code tag
n8n.workflow.executions.active
(gauge)
Number of active workflow executions
n8n.workflow.executions.count
(count)
Total number of workflow executions
n8n.workflow.executions.duration.seconds.bucket
(count)
Histogram bucket for workflow execution duration in seconds
n8n.workflow.executions.duration.seconds.count
(count)
The count of workflow execution duration in seconds
n8n.workflow.executions.duration.seconds.sum
(count)
The sum of workflow execution duration in seconds
n8n.workflow.failed.count
(count)
Total number of workflows that failed
n8n.workflow.started.count
(count)
Total number of workflows started
n8n.workflow.success.count
(count)
Total number of workflows completed successfully

Uninstallation

To uninstall this integration from your Agent, run the following command:

datadog-agent integration remove datadog-n8n

Alternatively, to disable the integration, rename the n8n.d/conf.yaml file to n8n.d/conf.yaml.example.

Support

Need help? Contact Datadog Support.