refactor: Add telemetry for RBAC (no-changelog) (#8056)

https://linear.app/n8n/issue/PAY-1142
This commit is contained in:
Iván Ovejero
2023-12-19 17:02:52 +01:00
committed by GitHub
parent a895ee87fc
commit 38d1336fa7
5 changed files with 60 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ import { License } from '@/License';
import { N8N_VERSION } from '@/constants';
import { WorkflowRepository } from '@db/repositories/workflow.repository';
import { SourceControlPreferencesService } from '../environments/sourceControl/sourceControlPreferences.service.ee';
import { RoleRepository } from '@/databases/repositories/role.repository';
type ExecutionTrackDataKey = 'manual_error' | 'manual_success' | 'prod_error' | 'prod_success';
@@ -110,6 +111,7 @@ export class Telemetry {
plan_name_current: this.license.getPlanName(),
quota: this.license.getTriggerLimit(),
usage: await this.workflowRepository.getActiveTriggerCount(),
role_count: await Container.get(RoleRepository).countUsersByRole(),
source_control_set_up: Container.get(SourceControlPreferencesService).isSourceControlSetup(),
branchName: sourceControlPreferences.branchName,
read_only_instance: sourceControlPreferences.branchReadOnly,