mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-16 21:19:43 +02:00
Merge c2deaaa0ea into ec074519d9
This commit is contained in:
commit
87a0d06411
|
|
@ -156,8 +156,8 @@ describe('ExpressionEngineConfig', () => {
|
|||
expect(Container.get(ExpressionEngineConfig).observabilityEnabled).toBe(true);
|
||||
});
|
||||
|
||||
test('tracesEnabled defaults to true', () => {
|
||||
expect(Container.get(ExpressionEngineConfig).tracesEnabled).toBe(true);
|
||||
test('tracesEnabled defaults to false', () => {
|
||||
expect(Container.get(ExpressionEngineConfig).tracesEnabled).toBe(false);
|
||||
});
|
||||
|
||||
test('slowEvaluationThresholdMs defaults to 50', () => {
|
||||
|
|
|
|||
|
|
@ -65,12 +65,13 @@ export class ExpressionEngineConfig {
|
|||
observabilityEnabled: boolean = true;
|
||||
|
||||
/**
|
||||
* Whether to emit OpenTelemetry spans for expression evaluation.
|
||||
* Slow evaluations (>slowEvaluationThresholdMs) and errors always emit a span.
|
||||
* Healthy-path evaluations are sampled at tracesSampleRate.
|
||||
* Whether n8n sends OpenTelemetry spans for expression evaluations when `N8N_OTEL_ENABLED`
|
||||
* is true. n8n creates a span for each evaluation that fails or takes longer than
|
||||
* `N8N_EXPRESSION_ENGINE_SLOW_EVAL_THRESHOLD_MS`, and samples the rest at
|
||||
* `N8N_EXPRESSION_ENGINE_TRACES_SAMPLE_RATE`.
|
||||
*/
|
||||
@Env('N8N_EXPRESSION_ENGINE_TRACES_ENABLED')
|
||||
tracesEnabled: boolean = true;
|
||||
tracesEnabled: boolean = false;
|
||||
|
||||
/** Threshold in ms above which an evaluation is considered "slow" and gets a span. */
|
||||
@Env('N8N_EXPRESSION_ENGINE_SLOW_EVAL_THRESHOLD_MS', z.number({ coerce: true }).positive())
|
||||
|
|
|
|||
|
|
@ -699,7 +699,7 @@ describe('GlobalConfig', () => {
|
|||
bridgeTimeout: 5000,
|
||||
bridgeMemoryLimit: 128,
|
||||
observabilityEnabled: true,
|
||||
tracesEnabled: true,
|
||||
tracesEnabled: false,
|
||||
slowEvaluationThresholdMs: 50,
|
||||
tracesSampleRate: 0.0,
|
||||
allowWebhookIsolateSkip: true,
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ const startSpanMock = vi.fn().mockReturnValue({
|
|||
|
||||
function buildConfig(overrides: Partial<ExpressionEngineConfig> = {}): ExpressionEngineConfig {
|
||||
const config = new ExpressionEngineConfig();
|
||||
// The provider is a no-op unless engine === 'vm'. Default tests to the active
|
||||
// engine so shared assertions exercise the real code path.
|
||||
return Object.assign(config, { engine: 'vm' as const, ...overrides });
|
||||
// The provider is a no-op unless engine is 'vm', and spans are off by default.
|
||||
// Turn both on so shared assertions exercise the real code path.
|
||||
return Object.assign(config, { engine: 'vm' as const, tracesEnabled: true, ...overrides });
|
||||
}
|
||||
|
||||
function buildLogger(): Logger {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user