MongoDB
Inspect MongoDB operations captured by the OpenTelemetry MongoDB instrumentation.
The SDK enables @opentelemetry/instrumentation-mongodb. Install the MongoDB driver in your application and preload ServerDevTools before importing it.
npm install server-devtools mongodbInitialize and preload the SDK as described in Getting Started, then run an operation inside a request:
const users = db.collection("users");
await users.findOne({ _id: userId });The MongoDB span appears under the active HTTP trace with its operation timing. If it is missing, check preload order and that the operation runs within the request context. ServerDevTools does not provide a MongoDB client wrapper.
Last updated on