Easily monitor data from requests, functions, and web vitals in one place to get the deepest observability experience for your Vercel projects.
Connect Axiom with Vercel to get the deepest observability experience for your Vercel projects.
Easily monitor data from requests, functions, and web vitals in one place. 100% live and 100% of your data, no sampling.
Axiom’s Vercel app ships with a pre-built dashboard and pre-installed monitors so you can be in complete control of your projects with minimal effort.
If you use Axiom Vercel integration, annotations are automatically created for deployments.
Vercel is a platform for frontend frameworks and static sites, built to integrate with your headless content, commerce, or database.
Vercel provides a frictionless developer experience to take care of the hard things: deploying instantly, scaling automatically, and serving personalized content around the globe.
Vercel makes it easy for frontend teams to develop, preview, and ship delightful user experiences, where performance is the default.
Simply install the Axiom Vercel app from here and be streaming logs and web vitals within minutes!
For both requests and serverless functions, Axiom automatically installs a log drain in your Vercel account to capture data live.
As users interact with your website, various logs will be produced. Axiom captures all these logs and ingests them into the vercel
dataset. You can stream and analyze these logs live, or use our pre-build Vercel Dashboard to get an overview of all the important metrics. When you’re ready, you can fork our dashboard and start building your own!
For function logs, if you call console.log
, console.warn
or console.error
in your function, the output will also be captured and made available as part of the log. You can use our extended query language, APL, to easily search these logs.
Axiom supports capturing and analyzing Web Vital data directly from your user’s browser without any sampling and with more data than is available elsewhere. It is perfect to pair with Vercel’s in-built analytics when you want to get really deep into a specific problem or debug issues with a specific audience (user-agent, location, region, etc).
Web Vitals are only currently supported for Next.js websites. Expanded support is coming soon.
Perform the following steps to install Web Vitals:
npm install --save next-axiom
.next.config.js
, wrap your NextJS config in withAxiom
as follows:This will proxy the Axiom ingest call to improve deliverability.
app/layout.tsx
and add the AxiomWebVitals
component:WebVitals are sent only from production deployments.
For Client Components, replace the log
prop usage with the useLogger
hook:
For Server Components, create a logger and make sure to call flush before returning:
For Route Handlers, wrapping your Route Handlers in withAxiom
will add a logger to your request and automatically log exceptions:
If you’re using Next.js version 12, follow the instructions below to integrate Axiom for logging and capturing Web Vitals data.
In your pages/_app.js
or pages/_app.ts
and add the following line:
If you plan on upgrading to Next.js 13, you’ll need to make specific changes to ensure compatibility:
1.0.0
or higher:NEXT_PUBLIC_ prefix
, for example,, NEXT_PUBLIC_AXIOM_TOKEN
.useLogger
hook instead of the log
prop.Logger
and flush the logs before the component returns.reportWebVitals()
line and instead integrate the AxiomWebVitals
component into your layout.The Vercel 4KB log limit refers to a restriction placed by Vercel on the size of log output generated by serverless functions running on their platform. The 4KB log limit means that each log entry produced by your function should be at most 4 Kilobytes in size.
If your log output is larger than 4KB, you might experience truncation or missing logs. To log above this limit, you can send your function logs using next-axiom.
If you use a logging library in your Vercel project that prints JSON, your message field will contain a stringified and therefore escaped JSON object.
You can parse the JSON using the parse_json function and run queries against the values in the message field.
In May 2024, Vercel introduced higher costs for using Vercel Log Drains. Because the Axiom Vercel app depends on Log Drains, using the next-axiom library can be the cheaper option to analyze telemetry data for higher volume projects.
To migrate from the Axiom Vercel app to the next-axiom library, follow these steps:
NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT
from the environment variables of your Vercel project. For more information, see the Vercel documentation.NEXT_PUBLIC_AXIOM_DATASET
is the name of the Axiom dataset where you want to send data.NEXT_PUBLIC_AXIOM_TOKEN
is the Axiom API token you have generated.npm install --save next-axiom
to install the latest version of next-axiom.next.config.ts
file, wrap your Next.js configuration in withAxiom
:For more configuration options, see the documentation in the next-axiom GitHub repository.
To send logs from Vercel preview deployments to Axiom, enable preview deployments for the environment variable NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT
. For more information, see the Vercel documentation.
Easily monitor data from requests, functions, and web vitals in one place to get the deepest observability experience for your Vercel projects.
Connect Axiom with Vercel to get the deepest observability experience for your Vercel projects.
Easily monitor data from requests, functions, and web vitals in one place. 100% live and 100% of your data, no sampling.
Axiom’s Vercel app ships with a pre-built dashboard and pre-installed monitors so you can be in complete control of your projects with minimal effort.
If you use Axiom Vercel integration, annotations are automatically created for deployments.
Vercel is a platform for frontend frameworks and static sites, built to integrate with your headless content, commerce, or database.
Vercel provides a frictionless developer experience to take care of the hard things: deploying instantly, scaling automatically, and serving personalized content around the globe.
Vercel makes it easy for frontend teams to develop, preview, and ship delightful user experiences, where performance is the default.
Simply install the Axiom Vercel app from here and be streaming logs and web vitals within minutes!
For both requests and serverless functions, Axiom automatically installs a log drain in your Vercel account to capture data live.
As users interact with your website, various logs will be produced. Axiom captures all these logs and ingests them into the vercel
dataset. You can stream and analyze these logs live, or use our pre-build Vercel Dashboard to get an overview of all the important metrics. When you’re ready, you can fork our dashboard and start building your own!
For function logs, if you call console.log
, console.warn
or console.error
in your function, the output will also be captured and made available as part of the log. You can use our extended query language, APL, to easily search these logs.
Axiom supports capturing and analyzing Web Vital data directly from your user’s browser without any sampling and with more data than is available elsewhere. It is perfect to pair with Vercel’s in-built analytics when you want to get really deep into a specific problem or debug issues with a specific audience (user-agent, location, region, etc).
Web Vitals are only currently supported for Next.js websites. Expanded support is coming soon.
Perform the following steps to install Web Vitals:
npm install --save next-axiom
.next.config.js
, wrap your NextJS config in withAxiom
as follows:This will proxy the Axiom ingest call to improve deliverability.
app/layout.tsx
and add the AxiomWebVitals
component:WebVitals are sent only from production deployments.
For Client Components, replace the log
prop usage with the useLogger
hook:
For Server Components, create a logger and make sure to call flush before returning:
For Route Handlers, wrapping your Route Handlers in withAxiom
will add a logger to your request and automatically log exceptions:
If you’re using Next.js version 12, follow the instructions below to integrate Axiom for logging and capturing Web Vitals data.
In your pages/_app.js
or pages/_app.ts
and add the following line:
If you plan on upgrading to Next.js 13, you’ll need to make specific changes to ensure compatibility:
1.0.0
or higher:NEXT_PUBLIC_ prefix
, for example,, NEXT_PUBLIC_AXIOM_TOKEN
.useLogger
hook instead of the log
prop.Logger
and flush the logs before the component returns.reportWebVitals()
line and instead integrate the AxiomWebVitals
component into your layout.The Vercel 4KB log limit refers to a restriction placed by Vercel on the size of log output generated by serverless functions running on their platform. The 4KB log limit means that each log entry produced by your function should be at most 4 Kilobytes in size.
If your log output is larger than 4KB, you might experience truncation or missing logs. To log above this limit, you can send your function logs using next-axiom.
If you use a logging library in your Vercel project that prints JSON, your message field will contain a stringified and therefore escaped JSON object.
You can parse the JSON using the parse_json function and run queries against the values in the message field.
In May 2024, Vercel introduced higher costs for using Vercel Log Drains. Because the Axiom Vercel app depends on Log Drains, using the next-axiom library can be the cheaper option to analyze telemetry data for higher volume projects.
To migrate from the Axiom Vercel app to the next-axiom library, follow these steps:
NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT
from the environment variables of your Vercel project. For more information, see the Vercel documentation.NEXT_PUBLIC_AXIOM_DATASET
is the name of the Axiom dataset where you want to send data.NEXT_PUBLIC_AXIOM_TOKEN
is the Axiom API token you have generated.npm install --save next-axiom
to install the latest version of next-axiom.next.config.ts
file, wrap your Next.js configuration in withAxiom
:For more configuration options, see the documentation in the next-axiom GitHub repository.
To send logs from Vercel preview deployments to Axiom, enable preview deployments for the environment variable NEXT_PUBLIC_AXIOM_INGEST_ENDPOINT
. For more information, see the Vercel documentation.