File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Main entry point for the package
22export { applyPatches } from "./patch-n8n.js" ;
3- export { setupObservability , shutdownObservability , flushObservability } from "./otel-setup.js" ;
3+ export { setupObservability , shutdownObservability } from "./otel-setup.js" ;
44
55// For programmatic setup
66export async function setupN8nObservability ( options ?: {
Original file line number Diff line number Diff line change @@ -294,15 +294,6 @@ export function setupObservability(options: ObservabilityOptions = {}): void {
294294 }
295295}
296296
297- /**
298- * Force flush all pending telemetry (without shutting down)
299- */
300- export async function flushObservability ( ) : Promise < void > {
301- if ( sdkInstance ) {
302- await sdkInstance . forceFlush ( ) ;
303- }
304- }
305-
306297/**
307298 * Shutdown the OpenTelemetry SDK
308299 */
Original file line number Diff line number Diff line change @@ -13,15 +13,6 @@ import {
1313import { flatten } from "flat" ;
1414import type { IExecuteData , INodeExecutionData } from "n8n-workflow" ;
1515
16- // Import the flush function
17- let flushObservability : ( ( ) => Promise < void > ) | null = null ;
18- try {
19- const otelSetup = require ( "./otel-setup.js" ) ;
20- flushObservability = otelSetup . flushObservability ;
21- } catch {
22- // Flush not available
23- }
24-
2516type AnyFunction = ( ...args : unknown [ ] ) => unknown ;
2617
2718type WorkflowMeta = { id ?: string ; name ?: string } ;
@@ -444,15 +435,6 @@ function patchWorkflowExecute(core: unknown): boolean {
444435 throw err ;
445436 } finally {
446437 span . end ( ) ;
447-
448- // Explicitly flush spans after workflow completes (for CLI mode)
449- if ( flushObservability ) {
450- try {
451- await flushObservability ( ) ;
452- } catch {
453- // Ignore flush errors
454- }
455- }
456438 }
457439 }
458440 ) ;
You can’t perform that action at this time.
0 commit comments