Skip to content

[Demo] Instance Monitoring for many self-hosted n8n instances#147

Draft
konstantintieber wants to merge 12 commits into
mainfrom
ligo-496-token-exchange-billing-tracking-demo
Draft

[Demo] Instance Monitoring for many self-hosted n8n instances#147
konstantintieber wants to merge 12 commits into
mainfrom
ligo-496-token-exchange-billing-tracking-demo

Conversation

@konstantintieber

@konstantintieber konstantintieber commented May 22, 2026

Copy link
Copy Markdown

Description

Demo video: https://www.loom.com/share/ca2f66a2744b4167bfaf1392d84a7198

A sample implementation of this guide: https://www.notion.so/n8n/OEM-Guide-How-to-track-billable-executions-across-instances-35d5b6e0c94f80f4b136c6a32cd67495

How to test:
Follow this readme: https://github.com/n8n-io/n8n-hosting/blob/b6e9f1a56a9827370dc76f478f17eb881e910092/local-cluster/README.md#prerequisites

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Example/configuration update
  • CI/CD improvements

Related Issues

Fixes # (issue)
Relates to # (issue)

Screenshots

image

Summary by cubic

Adds a local demo that spins up three n8n instances plus an instance-monitoring service that pulls Insights Public API data via token exchange to track billable executions across instances. Supports LIGO-496 by showing the recommended pull-and-store pattern with a simple dashboard.

  • New Features
    • Local Kind cluster with three isolated instances (n8n-1..3) via Helm, standalone SQLite, image preload n8nio/n8n:local, and background port-forwards (5678–5680).
    • Token exchange enabled by default: Makefile generates RSA keys and injects trusted key config (N8N_TOKEN_EXCHANGE_*, issuer https://instance-monitoring.local, allowedRoles=["global:admin"]).
    • Instance monitoring service (Node + k8s): mints JWT, exchanges at /rest/auth/oauth/token, calls /api/v1/insights/summary, stores per‑instance daily totals in SQLite PVC, serves a dashboard at /dashboard (localhost:5700). Poll interval via POLL_INTERVAL_SECONDS.
    • Docs and Makefiles for one‑command setup (make up/down), optional .env injection, reduced local resources, and new log helpers: make logs <namespace> and make logs monitoring; sets N8N_INSIGHTS_COMPACTION_INTERVAL_MINUTES=1 for fresher data.

Written for commit b6e9f1a. Summary will update on new commits. Review in cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant