Get a project trace by request ID
GET
https://api.vercel.com/v1/projects/tracesReturns the OTEL trace for a given Vercel CLI request.
Request
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.projects.getProjectTrace({ projectId: "prj_123", requestId: "cli-req-abc", teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", });
console.log(result);}
run();Response
{ "trace": { "resources": [ { "attributes": "value", "name": "Example Name" } ], "rootSpanId": "example_id", "spans": [ { "attributes": "value", "duration": [], "endTime": [], "events": [ { "attributes": "value", "name": "Example Name", "timestamp": [] } ], "kind": "123", "library": { "name": "Example Name", "version": "string" }, "links": [ "value" ], "name": "Example Name", "parentSpanId": "example_id", "resource": "string", "spanId": "example_id", "startTime": [], "status": { "code": "123", "message": "string" }, "traceFlags": "123", "traceState": "string" } ], "traceId": "example_id" }}AuthorizationbearerToken
Default authentication mechanism