mirror of
https://github.com/n8n-io/n8n.git
synced 2025-11-20 17:46:34 +00:00
Posthog logging test
This commit is contained in:
parent
0dca2b0f12
commit
983fa3c4ff
@ -33,6 +33,7 @@ export class PostHogController {
|
||||
// Main event capture endpoint
|
||||
@Post('/capture/', { skipAuth: true, rateLimit: { limit: 200, windowMs: 60_000 } })
|
||||
async capture(req: AuthenticatedRequest, res: Response, next: NextFunction) {
|
||||
console.log('==> Capture endpoint called');
|
||||
return await this.proxy(req, res, next);
|
||||
}
|
||||
|
||||
@ -51,6 +52,7 @@ export class PostHogController {
|
||||
// Session recording events (alternative endpoint)
|
||||
@Post('/e/', { skipAuth: true, rateLimit: { limit: 50, windowMs: 60_000 } })
|
||||
async sessionEvents(req: AuthenticatedRequest, res: Response, next: NextFunction) {
|
||||
console.log('==> Session events endpoint called', req.body);
|
||||
return await this.proxy(req, res, next);
|
||||
}
|
||||
|
||||
|
||||
@ -764,6 +764,9 @@ onMounted(() => {
|
||||
nodeViewEventBus.on('deleteWorkflow', handleDeleteWorkflow);
|
||||
nodeViewEventBus.on('renameWorkflow', onNameToggle);
|
||||
nodeViewEventBus.on('addTag', onTagsEditEnable);
|
||||
telemetry.track('Very special event', {
|
||||
user_id: usersStore.currentUser?.id,
|
||||
});
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
|
||||
@ -109,6 +109,7 @@ export class Telemetry {
|
||||
},
|
||||
});
|
||||
|
||||
console.log('[TELEMETRY] track:', event, updatedProperties);
|
||||
usePostHog().capture(event, updatedProperties);
|
||||
}
|
||||
|
||||
|
||||
@ -181,7 +181,10 @@ export const usePostHog = defineStore('posthog', () => {
|
||||
|
||||
const capture = (event: string, properties: IDataObject) => {
|
||||
if (typeof window.posthog?.capture === 'function') {
|
||||
console.log(`[POSTHOG STORE] Capture: ${event}`, properties);
|
||||
window.posthog.capture(event, properties);
|
||||
} else {
|
||||
console.log(`[POSTHOG STORE] Capture skipped, PostHog not initialized: ${event}`, properties);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user