All recipes
Express.
CodeMiddlewareNode.js
Mount the CheckUpstream middleware on your Express app. Outbound HTTP calls inside each request get tagged with the route, method, and any custom labels you attach.
1. Install.
Bash
npm install @checkupstream/sdk2. Mount the middleware.
server.ts
import express from "express";
import { checkUpstreamMiddleware } from "@checkupstream/sdk/integrations/express";
const app = express();
app.use(
checkUpstreamMiddleware({
sdkKey: process.env.CHECKUPSTREAM_SDK_KEY!,
services: ["api.stripe.com", "api.openai.com"],
}),
);
app.get("/api/users", async (_req, res) => {
// Outbound calls here are tracked automatically.
const users = await fetchUsers();
res.json(users);
});
app.listen(3000);Note
The middleware is idempotent — mounting it twice does nothing harmful, but only the first call wins. Place it before any route that issues outbound requests so context propagation works for the full handler.
Related
Ship reliable upstream.
Drop the SDK in, point it at your project key, and start seeing live upstream telemetry inside the dashboard.