User role telemetry added to secrets events

User role is now captured in credential and external secrets telemetry events, enabling role-based adoption analysis across the platform.
External secrets and credential telemetry now include the user's role, making it possible to segment feature adoption by permission level. Previously, these events only tracked user IDs, leaving role-based analysis impossible. The changes add user role to events across secret provider connections (created, updated, deleted, tested, reloaded), credential operations, and custom role management. A new event fires when external secrets system roles are toggled on or off. In the frontend, telemetry identify calls now pass user role through to tracking traits, ensuring consistent role attribution across both client and server telemetry. This enables platform administrators to understand which roles are adopting features and where documentation or training efforts should be targeted.
View Original GitHub DescriptionFact Check
Summary
- Adds
user_roleto all credential and external secrets connection events (created, updated, deleted, tested, reloaded)- added
user_roleto frontend events viacontext.traits
- added
- Adds
uses_external_secretsto credential created/updated events to track secret adoption - Adds new
external-secrets-system-roles-toggledevent when the feature is toggled on/off - Adds custom role CRUD telemetry events (created, updated, deleted)
Testing frontend events
- check the network tabs when creating or updating a credential
- you should see
telemetry/proxy/v1/trackrequests, and in their payload you should seecontext.traits.user_role
Testing backend events
You can create a simple node http server to echo the telemetry events (see code below)
Then start your n8n instance as usual but add this env var: N8N_DIAGNOSTICS_CONFIG_BACKEND="whateverkey;http://localhost:9090"
Then you can make changes to credentials, custom roles and exetrnal secrets and check that the telemetry events are sent with the right data.
// echo-server.js
const http = require('http');
http.createServer((req, res) => {
let body = '';
req.on('data', chunk => body += chunk);
req.on('end', () => {
console.log(`\n--- ${req.method} ${req.url} ---`);
if (body) {
try {
const parsed = JSON.parse(body);
console.dir(parsed, { depth: null, colors: true });
} catch (e) {
console.error('Failed to parse JSON body:', e);
console.log(body);
}
}
res.writeHead(200).end('ok');
});
}).listen(9090, () => console.log('Telemetry server on :9090'));
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/LIGO-380
Review / Merge checklist
- I have seen this code, I have run this code, and I take responsibility for this code.
- PR title and summary are descriptive. (conventions)
- Docs updated or follow-up ticket created.
- Tests included.
- PR Labeled with
release/backport(if the PR is an urgent fix that needs to be backported)