docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A simple Express.js application that demonstrates distributed tracing with OpenTelemetry by instrumenting HTTP requests and Express middleware to capture request lifecycle data.
/users/:id route to trace parameterized path handling @test/users route to trace different HTTP methods @testThe implementation should:
GET /users/:id - Returns a mock user object with the given IDPOST /users - Creates a mock user and returns success response/**
* Starts the Express server with OpenTelemetry tracing enabled.
*
* @param {number} port - The port to listen on
* @returns {Promise<object>} Server instance
*/
function startServer(port) {
// IMPLEMENTATION HERE
}
/**
* Stops the server and flushes any remaining traces.
*
* @param {object} server - The server instance to stop
* @returns {Promise<void>}
*/
function stopServer(server) {
// IMPLEMENTATION HERE
}
/**
* Retrieves captured spans from the in-memory exporter.
*
* @returns {Array} Array of captured span objects
*/
function getSpans() {
// IMPLEMENTATION HERE
}
module.exports = {
startServer,
stopServer,
getSpans,
};Fast, unopinionated, minimalist web framework for Node.js
Public API for OpenTelemetry tracing
OpenTelemetry SDK for Node.js with automatic instrumentation support
Automatic instrumentation for Node.js HTTP/HTTPS modules
Automatic instrumentation for Express.js applications
Core tracing functionality including span processors and exporters