Skip to main content

traces

Creates, updates, deletes, gets or lists a traces resource.

Overview

Nametraces
TypeResource
Idvercel.projects.traces

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
root_span_idstring (wire: rootSpanId)
trace_idstring (wire: traceId)
resourcesarray
spansarray

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject_id, request_idteam_id, slugReturns the OTEL trace for a given Vercel CLI request.
create_sessionexecprojectId, hostnameteamId, slugMints a short-lived HS256 JWT scoped to a deployment hostname. The Vercel CLI presents this JWT to the Vercel proxy on requests it wants traced.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
project_idstringThe project ID (wire: projectId)
request_idstringThe Vercel CLI request ID associated with the trace (wire: requestId)
slugstringThe Team slug to perform the request on behalf of.
teamIdstringThe Team identifier to perform the request on behalf of.
team_idstringThe Team identifier to perform the request on behalf of. (wire: teamId)

SELECT examples

Returns the OTEL trace for a given Vercel CLI request.

SELECT
root_span_id,
trace_id,
resources,
spans
FROM vercel.projects.traces
WHERE project_id = '{{ project_id }}' -- required
AND request_id = '{{ request_id }}' -- required
AND team_id = '{{ team_id }}'
AND slug = '{{ slug }}'
;

Lifecycle Methods

EXEC variables use wire (API) names.

Mints a short-lived HS256 JWT scoped to a deployment hostname. The Vercel CLI presents this JWT to the Vercel proxy on requests it wants traced.

EXEC vercel.projects.traces.create_session
@teamId='{{ teamId }}',
@slug='{{ slug }}'
@@json=
'{
"projectId": "{{ projectId }}",
"hostname": "{{ hostname }}"
}'
;