The Vercel integration creates JSON log drains for selected projects and forwards their log entries into GraphJSON collections.
Requirements#
Vercel’s current Log Drains capability is available on eligible Vercel plans. Check the Vercel Log Drains reference for current provider availability, formats, fields, and billing.
Connect a project#
- Create or choose a collection, such as
vercel_production_logs. - Open Integrations.
- Choose Vercel and connect the intended personal account or team.
- Map a Vercel project to a GraphJSON collection.
- Create the drain.
- Generate a runtime or build log in that project.
You can map different projects to different collections to keep ownership, retention, and alerting clear.
Inspect the payload#
Open Samples and identify the fields your Vercel project sends. Depending on source and provider version, useful fields can include:
projectId
deploymentId
source
level
message
path
statusCode
environment
requestId
executionRegion
Nested values are flattened into dot-separated keys.
Start with focused metrics#
Errors over time#
- graph: Single Line
- aggregation: Count
- filter:
level = error - granularity: Hour
Create a separate alert for fatal if the source sends that level.
Errors by path#
- graph: Bar Chart
- aggregation: Count
- split:
path - filter:
level = error
High-cardinality paths with raw identifiers can fragment this view. Prefer normalized route fields when available.
SQL query#
SELECT
JSONExtractString(json, 'level') AS level,
JSONExtractString(json, 'source') AS source,
count() AS logs
FROM vercel_production_logs
WHERE toDateTime(timestamp) >= subtractHours(now(), 24)
GROUP BY level, source
ORDER BY logs DESC
Set retention deliberately#
Operational logs can be high volume and may contain request details. Use a shorter collection retention period unless you have a defined need for long-term history.
Review application logging so messages do not contain access tokens, authorization headers, session cookies, or customer secrets before enabling a drain.
Understand source volume#
Vercel can batch multiple JSON log objects in one delivery. A single application request may also produce more than one log entry, especially around rendering and regeneration behavior.
Count logs as log records, not necessarily requests or users. Use a stable request identifier when the payload provides one and the metric requires request-level deduplication.
To compare errors, latency, and product outcomes across deployments, add an immutable release identifier and explicit deployment events using Release-impact analytics.
Disconnect#
Delete the mapping from the GraphJSON Vercel integration page, then confirm the drain no longer appears in Vercel. Removing a drain stops future delivery but does not delete events already stored in GraphJSON.