Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
64 lines
1.6 KiB
TypeScript
64 lines
1.6 KiB
TypeScript
import { z } from 'zod';
|
|
|
|
import { Config, Env } from '../decorators';
|
|
|
|
/** Schema for sample rates (0.0 to 1.0). */
|
|
export const sampleRateSchema = z.number({ coerce: true }).min(0).max(1);
|
|
|
|
@Config
|
|
export class SentryConfig {
|
|
/** Sentry DSN (data source name) for the backend. */
|
|
@Env('N8N_SENTRY_DSN')
|
|
backendDsn: string = '';
|
|
|
|
/** Sentry DSN (data source name) for the frontend. */
|
|
@Env('N8N_FRONTEND_SENTRY_DSN')
|
|
frontendDsn: string = '';
|
|
|
|
/**
|
|
* Sample rate for Sentry traces (0.0 to 1.0).
|
|
* This determines whether tracing is enabled and what percentage of
|
|
* transactions are traced.
|
|
*
|
|
* @default 0 (disabled)
|
|
*/
|
|
@Env('N8N_SENTRY_TRACES_SAMPLE_RATE', sampleRateSchema)
|
|
tracesSampleRate: number = 0;
|
|
|
|
/**
|
|
* Sample rate for Sentry profiling (0.0 to 1.0).
|
|
* This determines whether profiling is enabled and what percentage of
|
|
* transactions are profiled.
|
|
*
|
|
* @default 0 (disabled)
|
|
*/
|
|
@Env('N8N_SENTRY_PROFILES_SAMPLE_RATE', sampleRateSchema)
|
|
profilesSampleRate: number = 0;
|
|
|
|
/**
|
|
* Threshold in milliseconds for event loop block detection.
|
|
* When the event loop is blocked for longer than this threshold,
|
|
* Sentry will report it.
|
|
*
|
|
* @default 500
|
|
*/
|
|
@Env('N8N_SENTRY_EVENT_LOOP_BLOCK_THRESHOLD', z.number({ coerce: true }).int().positive())
|
|
eventLoopBlockThreshold: number = 500;
|
|
|
|
/**
|
|
* Environment of the n8n instance.
|
|
*
|
|
* @example 'production'
|
|
*/
|
|
@Env('ENVIRONMENT')
|
|
environment: string = '';
|
|
|
|
/**
|
|
* Name of the deployment, e.g. cloud account name.
|
|
*
|
|
* @example 'janober'
|
|
*/
|
|
@Env('DEPLOYMENT_NAME')
|
|
deploymentName: string = '';
|
|
}
|