docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a testing utility that verifies OpenTelemetry instrumentation works correctly across different Express versions (v4 and v5). The utility should set up instrumented Express applications and validate that spans are created properly regardless of Express version.
Create a testing utility that:
/**
* Sets up an instrumented Express v4 or v5 app
* Returns the app and a function to get collected spans
*/
export function setupInstrumentedApp(version: 'v4' | 'v5'): {
app: any;
getSpans: () => any[];
cleanup: () => void;
};
/**
* Verifies that spans were created correctly for the given request
* Checks for expected span names, attributes, and structure
*/
export function verifySpans(spans: any[], expectedRoute: string): boolean;
/**
* Compares spans from v4 and v5 apps to ensure compatibility
* Returns true if spans have consistent structure and attributes
*/
export function compareVersionSpans(v4Spans: any[], v5Spans: any[]): boolean;Provides OpenTelemetry instrumentation for Express.js with version compatibility support.
Provides tracing SDK components for span collection and export.