<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/vercel-observability-tutorial-debug-a-slow-or-failing-function-gftwq6nxk" -->

---
title: Vercel Observability tutorial: debug a slow or failing...
description: A hands-on tutorial for debugging slow or failing Vercel Functions using Vercel Observability tools. It walks through creating a Next.js Route Handler with two...
canonical: https://daily.dev/posts/vercel-observability-tutorial-debug-a-slow-or-failing-function-gftwq6nxk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Vercel Observability tutorial: debug a slow or failing Function | daily.dev
og:description: A hands-on tutorial for debugging slow or failing Vercel Functions using Vercel Observability tools. It walks through creating a Next.js Route Handler with two...
og:url: https://daily.dev/posts/vercel-observability-tutorial-debug-a-slow-or-failing-function-gftwq6nxk
og:image: https://api.daily.dev/og/posts/GfTWq6NxK.png
og:image:alt: Vercel Observability tutorial: debug a slow or failing Function
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.

# Vercel Observability tutorial: debug a slow or failing Function

**[Flavio Copes](https://daily.dev/sources/flaviocopes)** · 8 min read · 0 upvotes · 0 comments

## Summary

A hands-on tutorial for debugging slow or failing Vercel Functions using Vercel Observability tools. It walks through creating a Next.js Route Handler with two deliberate defects — a 500 error and a 1.5-second artificial delay — then uses Runtime Logs, the Vercel CLI, route metrics, and Session Tracing to locate each problem. The tutorial covers structured JSON logging with correlation IDs, CLI log filtering commands, the Observability dashboard's Functions view, and Session Tracing via the Vercel Toolbar. It concludes with fixing both defects, deploying a new Preview, and verifying the fix through telemetry comparison. A practical incident workflow checklist is included.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://flaviocopes.com/vercel-observability>

## Questions this post answers

### How do I find a 500 error from a specific Vercel Function using the CLI?

Use the vercel logs command with filters for environment, status code, and time range, for example npx vercel logs --environment preview --status-code 500 --since 30m --expand. You can also search log message content with --query, isolate a single request with --request-id, or request JSON output for scripts with --json.

_developers chasing down a failing serverless function can compare logging workflows like this on daily.dev._

### How long does Vercel retain runtime logs on the Hobby versus Pro plan?

Runtime Logs are kept for one hour on the Hobby plan and one day on the Pro plan, with longer retention available on plans or add-ons with extended retention options. Runtime Logs are available on every Vercel plan, unlike some Observability features such as detailed latency breakdowns which require Observability Plus.

_teams weighing hosting plans against log retention needs can track these platform details on daily.dev._

### How can I trace where time went in a single slow serverless request on Vercel?

Use Session Tracing through the Vercel Toolbar on a deployed Preview or Production environment: start a tracing session, visit the slow route, then view session traces to inspect spans for framework, middleware, cache, and function execution. Session Tracing is available on all plans but requires the toolbar and does not work against localhost.

_developers debugging latency in production functions can follow tracing workflows like this via daily.dev._

## Similar posts on daily.dev

- [How to Use NestJS Observe: An Observability Handbook for Devs](https://daily.dev/posts/how-to-use-nestjs-observe-an-observability-handbook-for-devs-flfhkypu6) · freeCodeCamp · 5 upvotes · 0 comments
- [The 3.5-Second Lie: How a Blind Spot in My Telemetry Hid Two Production Bugs](https://daily.dev/posts/the-3-5-second-lie-how-a-blind-spot-in-my-telemetry-hid-two-production-bugs-pzo1aofwi) · Medium · 0 upvotes · 0 comments
- [Use code-level analysis to cut MTTR before you push to production](https://daily.dev/posts/use-code-level-analysis-to-cut-mttr-before-you-push-to-production-txf2yfibz) · Dynatrace · 0 upvotes · 0 comments
- [Cloudflare Workers observability: logs and traces](https://daily.dev/posts/cloudflare-workers-observability-logs-and-traces-ppiwatjqn) · Flavio Copes · 1 upvotes · 0 comments
- [Query observability metrics using the Vercel CLI](https://daily.dev/posts/query-observability-metrics-using-the-vercel-cli-ksviy7mcp) · Vercel · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/vercel-observability-tutorial-debug-a-slow-or-failing-function-gftwq6nxk)

```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":"Vercel Observability tutorial: debug a slow or failing Function","url":"https://daily.dev/posts/vercel-observability-tutorial-debug-a-slow-or-failing-function-gftwq6nxk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/vercel-observability-tutorial-debug-a-slow-or-failing-function-gftwq6nxk"},"datePublished":"2026-08-07T13:17:32.753Z","dateModified":"2026-09-14T06:53:19.765Z","description":"A hands-on tutorial for debugging slow or failing Vercel Functions using Vercel Observability tools. It walks through creating a Next.js Route Handler with two...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7219243bb6b6113ecc90bd933965a4ef?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7219243bb6b6113ecc90bd933965a4ef?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Flavio Copes","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":"Flavio Copes","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/1f2dbd275797411bbd37bfdaaf0951a9","url":"https://daily.dev/sources/flaviocopes"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/vercel-observability-tutorial-debug-a-slow-or-failing-function-gftwq6nxk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"nextjs,observability,serverless,vercel","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Flavio Copes","item":"https://daily.dev/sources/flaviocopes"},{"@type":"ListItem","position":3,"name":"Vercel Observability tutorial: debug a slow or failing Function"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/vercel-observability-tutorial-debug-a-slow-or-failing-function-gftwq6nxk#faq","mainEntity":[{"@type":"Question","name":"How do I find a 500 error from a specific Vercel Function using the CLI?","acceptedAnswer":{"@type":"Answer","text":"Use the vercel logs command with filters for environment, status code, and time range, for example npx vercel logs --environment preview --status-code 500 --since 30m --expand. You can also search log message content with --query, isolate a single request with --request-id, or request JSON output for scripts with --json. developers chasing down a failing serverless function can compare logging workflows like this on daily.dev."}},{"@type":"Question","name":"How long does Vercel retain runtime logs on the Hobby versus Pro plan?","acceptedAnswer":{"@type":"Answer","text":"Runtime Logs are kept for one hour on the Hobby plan and one day on the Pro plan, with longer retention available on plans or add-ons with extended retention options. Runtime Logs are available on every Vercel plan, unlike some Observability features such as detailed latency breakdowns which require Observability Plus. teams weighing hosting plans against log retention needs can track these platform details on daily.dev."}},{"@type":"Question","name":"How can I trace where time went in a single slow serverless request on Vercel?","acceptedAnswer":{"@type":"Answer","text":"Use Session Tracing through the Vercel Toolbar on a deployed Preview or Production environment: start a tracing session, visit the slow route, then view session traces to inspect spans for framework, middleware, cache, and function execution. Session Tracing is available on all plans but requires the toolbar and does not work against localhost. developers debugging latency in production functions can follow tracing workflows like this via daily.dev."}}]}
```

