Vercel Integration
The Vercel Integration enables you to send logs produced by your projects in Vercel to Dash0.
Set up
The recommended way to send logs from Vercel to Dash0 is via Dash0's Vercel integration. Alternatively, you can also set up Vercel log drains manually, see section "Setting up log drains manually" below.
Set up via the Vercel integration
To install the integration, go to https://vercel.com/integrations/dash0 and click the "Connect Account" button.
Vercel's integration installation wizard guides you through the process. In the first step, select the Vercel team from which you want to send logs to Dash0. You can also optionally restrict the set of projects for which you want to receive logs in Dash0, or select "All Projects".
Click on "Connect Account" at the bottom of the dialog to proceed.
After selecting the Vercel team, you will be redirected to the Dash0 UI, which will open in a popup. If you are not signed into Dash0, please sign in now.
If you have access to multiple Dash0 organizations, you need to decide to which Dash0 organization the Vercel logs will be sent. Click on the logo of your Dash0 organization in the upper left to open the list of organizations, then select the target organization.
Optionally you can also select to which dataset will the Vercel logs. By default, it will be Dash0's Default dataset.
Click "Connect my Vercel account to ..." to finish the process.
You will be redirected to your Vercel dashboard afterwards.
That's it! Your Dash0 Vercel integration has been set up and you will start receiving logs from Vercel in Dash0.
In your Vercel settings under "Log Drains" you will also see a new log drain named "dash0-integration-log-drain", which Dash0 has set up automatically for you.
Setting up log drains manually
This setup is a manual alternative to the Vercel integration setup described above. Some of the setup needs to be executed in Vercel, and some in Dash0. Both parts of the setup are necessary.
Settings in Dash0
To configure and use Vercel's Log Drains capability, you must provide the Dash0 endpoint to send data to and the Dash0 Authorization token.
If you are already using Dash0, you can find it in the onboarding section. If you are just looking for this data, you can find it in the manage section of your organization.
Settings in Vercel
The API Endpoint and Authorization token needs to be specified in Vercel's log drain settings, which can be found under:
Team Settings -> Log Drains (in the left sidebar)
You can choose if you want to forward logs for all projects or only specific projects.
Select the sources, such as Static, Edge, Function, Build, Firewall, etc., for which you want to export logs and choose JSON as the delivery format.
Now specify the environments for which you want to forward logs and select the desired sampling rate. Vercel's documentation provides more details about the sampling rate.
Fill in the API Endpoint URL from Dash0's settings to the Endpoint field.
Authorization when sending data to Dash0 is based on a custom header, so enable "Custom Headers."
Copy x-vercel-verify
to the Header Key and copy the value after the colon into the Header value field. Now, you can add a second header using the "Add" button.
Specify Authorization
as the Header Key and add Bearer
as a prefix to your Authorization token starting with auth_
. The value field will contain a value of the format: Bearer auth_XXXXXX
You can Test the Log Drain configuration using the Test button and finalize the configuration using the Add Log Drain Button.
Further customizations are possible by adding the following HTTP headers:
X-Dash0-Dataset
If you add the X-Dash0-Dataset
header to the log drain configuration, the header value will be converted to the resource attribute dash0.dataset
and the logs will be routed to the matching dataset in Dash0.
X-Dash0-Disable-Open-Telemetry-Semantic-Conventions
If the header X-Dash0-Disable-Open-Telemetry-Semantic-Conventions
is defined with the value 1
, no conversion to OpenTelemetry semantic conventions will be performed.
Instead, the log attributes will be converted exclusively to attribute names with the prefix vercel
.
Log Types
Dash0 supports all log types that Vercel provides:
- Static: access logs for static assets like HTML and CSS files
- Edge: log data from edge functions like middleware
- Function: log data from Vercel functions like API routes
- External: log results for external rewrites to a different domain
- Build: log data from build steps
- Firewall: log data from requests denied by Vercel Firewall rules
Log Attribute Conversion
Attributes on Vercel log records are converted as follows:
Resource attributes:
projectId
->vercel.project_id
deploymentId
->vercel.deployment_id
projectName
->service.name
environment
->deployment.environment
branch
->vercel.branch
buildId
->vercel.build_id
source
->vercel.source
executionRegion
->faas.invoked_region
Log record attributes:
id
->log.record.uid
host
->server.address
entrypoint
->vercel.entrypoint
path
->http.route
requestId
->faas.invocation_id
statusCode
->http.response.status_code
destination
->vercel.destination
type ->
log.iostream
, if the value is eitherstdout
orstderr
, otherwisevercel.type
proxy.timestamp
->vercel.proxy.timestamp
proxy.method
->http.request.method
proxy.scheme
->url.scheme
proxy.host
->url.domain
proxy.path
->url.path
proxy.userAgent
->user_agent.original
proxy.referer
->vercel.proxy.referer
proxy.statusCode
->http.response.status_code
proxy.clientIp
->network.peer.address
proxy.region
->cloud.region
proxy.cacheId
->vercel.proxy.cache_id
proxy.vercelCache
->vercel.proxy.cache_value
proxy.pathType
->vercel.proxy.path_type
proxy.vercelId
->vercel.proxy.vercel_id
When the custom header X-Dash0-Disable-Open-Telemetry-Semantic-Conventions=1
is configured via the log drain settings, the conversion rules are as follows:
Resource attributes:
projectId
->vercel.project_id
deploymentId
->vercel.deployment_id
projectName
->vercel.project_name
environment
->vercel.environment
branch
->vercel.branch
buildId
->vercel.build_id
source
->vercel.source
executionRegion
->faas.invoked_region
Log record attributes:
id
->vercel.log_id
host
->vercel.host
entrypoint
->vercel.entrypoint
path
->vercel.path
requestId
->vercel.request_id
statusCode
->vercel.status_code
destination
->vercel.destination
type
->vercel.type
proxy.timestamp
->vercel.proxy.timestamp
proxy.method
->vercel.proxy.method
proxy.scheme
->vercel.proxy.scheme
proxy.host
->vercel.proxy.host
proxy.path
->vercel.proxy.path
proxy.userAgent
->vercel.proxy.user_agent
proxy.referer
->vercel.proxy.referer
proxy.statusCode
->vercel.proxy.status_code
proxy.clientIp
->vercel.proxy.client_ip
proxy.region
->vercel.proxy.region
proxy.cacheId
->vercel.proxy.cache_id
proxy.vercelCache
->vercel.proxy.cache_value
proxy.pathType
->vercel.proxy.path_type
proxy.vercelId
->vercel.proxy.vercel_id
Last updated: December 17, 2024