<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-export-next-js-traces-with-opentelemetry-z5ziwvlmf" -->

---
title: How to Export Next.js Traces with OpenTelemetry | daily.dev
description: Next.js ships with built-in OpenTelemetry tracing for incoming requests, fetch calls, middleware, and SSR, but traces go nowhere without an exporter...
canonical: https://daily.dev/posts/how-to-export-next-js-traces-with-opentelemetry-z5ziwvlmf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Export Next.js Traces with OpenTelemetry | daily.dev
og:description: Next.js ships with built-in OpenTelemetry tracing for incoming requests, fetch calls, middleware, and SSR, but traces go nowhere without an exporter...
og:url: https://daily.dev/posts/how-to-export-next-js-traces-with-opentelemetry-z5ziwvlmf
og:image: https://api.daily.dev/og/posts/z5ZIWVlmF.png
og:image:alt: How to Export Next.js Traces with OpenTelemetry
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Export Next.js Traces with OpenTelemetry

**[Sentry Engineering](https://daily.dev/sources/sentry)** · 10 min read · 0 upvotes · 0 comments

## Summary

Next.js ships with built-in OpenTelemetry tracing for incoming requests, fetch calls, middleware, and SSR, but traces go nowhere without an exporter configured. Using the @vercel/otel library, you can wire up trace export to any OTLP-compatible backend — including Sentry — with just a few lines of code and two environment variables. The post covers how to add custom spans for business-critical operations (with naming conventions and attribute guidance), explains the Node vs. Edge runtime limitations, and provides a feature comparison between using @vercel/otel with direct OTLP ingestion versus the full @sentry/nextjs SDK. The recommendation is to use the SDK for full-stack observability (browser tracing, error monitoring, session replay) and direct OTLP only when you already have an existing OpenTelemetry pipeline or need a leaner server-only setup.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.sentry.io/nextjs-export-traces-opentelemetry>

## Similar posts on daily.dev

- [OpenTelemetry tutorial for Node.js: traces and metrics from scratch](https://daily.dev/posts/opentelemetry-tutorial-for-node-js-traces-and-metrics-from-scratch-lyccljggd) · Flavio Copes · 2 upvotes · 0 comments
- [Always-on tracing for production and preview traffic](https://daily.dev/posts/always-on-tracing-for-production-and-preview-traffic-ukisadoby) · Vercel · 1 upvotes · 0 comments
- [How OpenTelemetry Works: A Complete Guide](https://daily.dev/posts/how-opentelemetry-works-a-complete-guide-56tcccdpu) · freeCodeCamp · 6 upvotes · 0 comments
- [Use OpenTelemetry-native observability with Datadog from ingestion to investigation](https://daily.dev/posts/use-opentelemetry-native-observability-with-datadog-from-ingestion-to-investigation-lgdb8qeve) · Datadog · 4 upvotes · 0 comments
- [OTel spans \+ Sentry errors: Connected in one trace](https://daily.dev/posts/otel-spans-sentry-errors-connected-in-one-trace-ey5pv6uyl) · Sentry Engineering · 1 upvotes · 1 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#nextjs](https://daily.dev/tags/nextjs), [#observability](https://daily.dev/tags/observability), [#opentelemetry](https://daily.dev/tags/opentelemetry)

[View this post on daily.dev](https://daily.dev/posts/how-to-export-next-js-traces-with-opentelemetry-z5ziwvlmf)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Export Next.js Traces with OpenTelemetry","url":"https://daily.dev/posts/how-to-export-next-js-traces-with-opentelemetry-z5ziwvlmf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-export-next-js-traces-with-opentelemetry-z5ziwvlmf"},"datePublished":"2026-07-09T06:35:55.257Z","dateModified":"2026-07-09T06:36:18.333Z","description":"Next.js ships with built-in OpenTelemetry tracing for incoming requests, fetch calls, middleware, and SSR, but traces go nowhere without an exporter...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e417877ed8b2d4f616c37054e19125db?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e417877ed8b2d4f616c37054e19125db?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Sentry Engineering","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Sentry Engineering","logo":"https://media.daily.dev/image/upload/s--qqXwMThM--/f_auto/v1710505439/logos/sentry","url":"https://daily.dev/sources/sentry"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-export-next-js-traces-with-opentelemetry-z5ziwvlmf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devops,nextjs,observability,opentelemetry","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sentry Engineering","item":"https://daily.dev/sources/sentry"},{"@type":"ListItem","position":3,"name":"How to Export Next.js Traces with OpenTelemetry"}]}
```

