This repository provides a complete solution for monitoring n8n workflow automation with comprehensive observability using Parseable - an open-source, unified observability platform.
- π Traces: HTTP requests, database operations, and workflow execution spans
- π Metrics: Resource utilization, execution counts, and performance metrics
- π Logs: Structured workflow logs, node execution logs, and error tracking
- π§ Easy Setup: Docker Compose based deployment with minimal configuration
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β n8n βββββΆβ OpenTelemetryβββββΆβ Parseable β
β β β Instrumentation β β β
β - Workflows β β - Winston Logs β β - Traces β
β - Nodes β β - HTTP Tracing β β - Metrics β
β - Triggers β β - DB Tracing β β - Logs β
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
- Docker and Docker Compose
- Git
git clone https://github.com/parseablehq/n8n-observability.git
cd n8n-observability
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f n8n
- n8n: http://localhost:5678 (admin/admin)
- Parseable: http://localhost:8000 (admin/admin)
- Create a workflow in n8n
- Execute the workflow
- Check Parseable for traces, metrics, and logs:
otel-traces
stream: Workflow execution tracesotel-metrics
stream: Performance metricsn8n-logs
stream: Structured logs
docker-compose.yml
- Complete stack orchestrationDockerfile
- Custom n8n image with observabilityn8n-winston-logger.js
- Winston transport for structured loggingsimple-winston-tracing.js
- OpenTelemetry setupdocker-entrypoint.sh
- Container initialization script
- n8n - Workflow automation platform with observability
- Parseable - Log analytics and observability backend
- PostgreSQL - n8n database backend
Key variables in docker-compose.yml
:
# n8n Configuration
N8N_HOST: "localhost"
N8N_PORT: 5678
N8N_PROTOCOL: "http"
N8N_WINSTON_LOGGING: "true"
# Database
DB_TYPE: "postgresdb"
DB_POSTGRESDB_HOST: "postgres"
DB_POSTGRESDB_DATABASE: "n8n"
# Parseable Integration
PARSEABLE_URL: "http://parseable:8000"
PARSEABLE_USERNAME: "admin"
PARSEABLE_PASSWORD: "admin"
# OpenTelemetry
OTEL_SERVICE_NAME: "n8n-comprehensive"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://parseable:8000"
The setup creates three streams automatically:
n8n-logs
: Structured application logsotel-traces
: Execution traces and spansotel-metrics
: Performance and resource metrics
Workflow Events:
logger.workflow.started(workflowId, workflowName, executionId, metadata);
logger.workflow.completed(workflowId, workflowName, executionId, duration, metadata);
logger.workflow.failed(workflowId, workflowName, executionId, error, duration, metadata);
Node Events:
logger.node.started(workflowId, executionId, nodeType, nodeName, metadata);
logger.node.completed(workflowId, executionId, nodeType, nodeName, duration, metadata);
logger.node.failed(workflowId, executionId, nodeType, nodeName, error, duration, metadata);
HTTP Events:
logger.http.request(method, url, headers, metadata);
logger.http.response(method, url, statusCode, duration, metadata);
Automatic instrumentation for:
- HTTP requests (incoming/outgoing)
- Database operations
- Workflow execution spans
- Node execution spans
Collected metrics include:
- Request counts and durations
- Database connection pools
- Memory and CPU usage
- Workflow execution statistics
Recent Workflow Executions:
SELECT body, severity_text, time_unix_nano
FROM "n8n-logs"
WHERE body LIKE '%workflow%'
ORDER BY time_unix_nano DESC
LIMIT 10
Error Analysis:
SELECT body, severity_text, time_unix_nano
FROM "n8n-logs"
WHERE severity_text = 'ERROR'
ORDER BY time_unix_nano DESC
Performance Traces:
SELECT span_name, duration_nanos, status_code
FROM "otel-traces"
ORDER BY start_time_unix_nano DESC
Extend the Winston logger in n8n-winston-logger.js
:
// Add custom log methods
logger.custom = {
event: (eventType, data) => {
logger.info('Custom event', {
event_type: eventType,
...data
});
}
};
Extend OpenTelemetry setup in simple-winston-tracing.js
:
// Add custom instrumentations
const { YourCustomInstrumentation } = require('your-instrumentation');
registerInstrumentations({
instrumentations: [
// ... existing instrumentations
new YourCustomInstrumentation()
]
});
1. Logs not appearing in Parseable
- Check container connectivity:
docker network ls
- Verify Parseable is running:
docker-compose logs parseable
- Check n8n logs:
docker-compose logs n8n
2. Authentication errors
- Verify credentials in
docker-compose.yml
- Check Parseable access:
curl -u admin:admin http://localhost:8000/api/v1/logstream
3. High memory usage
- Adjust batch sizes in
n8n-winston-logger.js
- Configure log retention in Parseable
# Check service health
docker-compose ps
# View real-time logs
docker-compose logs -f n8n
docker-compose logs -f parseable
# Test Parseable API
curl -u admin:admin http://localhost:8000/api/v1/logstream
# Check n8n database
docker exec -it n8n-postgres psql -U postgres -d n8n
-
Change Default Credentials:
PARSEABLE_USERNAME: "your-username" PARSEABLE_PASSWORD: "your-secure-password"
-
Use Environment Variables:
export PARSEABLE_PASSWORD=$(openssl rand -base64 32)
-
Network Security:
- Use Docker networks for isolation
- Configure firewall rules
- Enable TLS/SSL for production
-
Data Retention:
- Configure log rotation
- Set retention policies
- Monitor disk usage
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Commit changes:
git commit -am 'Add feature'
- Push to branch:
git push origin feature-name
- Submit pull request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- n8n - Workflow automation platform
- Parseable - Log analytics platform
- OpenTelemetry - Observability framework
- Winston - Logging library
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Parseable Community: Discord
β Star this repo if you find it useful!