Skip to content

docs: add sentry neon functions guide - #5465

Merged
danieltprice merged 9 commits into
neondatabase:mainfrom
dhanushreddy291:add-docs/sentry-neon-functions
Aug 13, 2026
Merged

docs: add sentry neon functions guide#5465
danieltprice merged 9 commits into
neondatabase:mainfrom
dhanushreddy291:add-docs/sentry-neon-functions

Conversation

@dhanushreddy291

@dhanushreddy291 dhanushreddy291 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

@dhanushreddy291 is attempting to deploy a commit to the neondatabase Team on Vercel.

A member of the Team first needs to authorize it.


</Steps>

<Admonition type="note" title="Source map support">

@dhanushreddy291 dhanushreddy291 Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danieltprice you may want to update or remove this note as needed.

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
neon-next Ready Ready Preview Aug 13, 2026 2:51pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Neon Functions guide that walks readers through instrumenting a Neon Function with Sentry (errors, structured logs, and tracing), including an optional section for tracing a streaming AI agent via the Neon AI Gateway. It also updates a few existing Neon Functions guides with refreshed updatedOn metadata and a skills-installation note.

Changes:

  • Add content/guides/sentry-neon-functions.md (end-to-end Sentry instrumentation guide for Neon Functions, plus AI Gateway/agent tracing).
  • Update three existing Neon Functions guides to add an agent-skills install snippet and bump updatedOn.

Reviewed changes

Copilot reviewed 4 out of 9 changed files in this pull request and generated 3 comments.

File Description
content/guides/sentry-neon-functions.md New guide covering Sentry setup for Neon Functions (errors/logs/traces) and AI agent tracing via AI Gateway.
content/guides/llm-proxy-neon-functions.md Adds an agent-skills install note and updates updatedOn.
content/guides/durable-workflow-on-neon-functions.md Adds an agent-skills install note and updates updatedOn.
content/guides/discord-bot-on-neon-functions.md Adds an agent-skills install note and updates updatedOn.
Suppressed comments (1)

content/guides/sentry-neon-functions.md:66

  • For consistency with the other Neon Functions guides, prefer the neondatabase/agent-skills repo shorthand here and include the neon-ai-gateway skill since the guide later uses the AI Gateway.
npx skills add https://github.com/neondatabase/agent-skills --skill neon-functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread content/guides/sentry-neon-functions.md Outdated
✔ Manage this project's Neon setup as code? Adds a neon.ts you can edit and apply with `neon config apply`. … yes
✔ Which Neon services should neon.ts declare? (space to toggle, enter to confirm) › Functions
INFO: Created neon.ts declaring functions.
INFO: Created hello.ts — the source of the hello function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

Comment thread content/guides/sentry-neon-functions.md Outdated
Comment thread content/guides/sentry-neon-functions.md Outdated

Use the default setup options for all prompts: this includes enabling AI skills, configuring the MCP server, and installing the VS Code extension. These steps ensure AI agents such as Claude Code and Cursor can assist you in building with Neon.

During initialization, the **Neon Postgres** skills are installed automatically. You'll also need the **Neon Functions** skills so AI agents have the context to help you build and deploy your function. Install it with the following command:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
During initialization, the **Neon Postgres** skills are installed automatically. You'll also need the **Neon Functions** and **Neon AI Gateway** skills so AI agents have the context to help you build and deploy your Discord bot. Install them with the following command:

```bash
npx skills add neondatabase/agent-skills --skill neon-ai-gateway --skill neon-functions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @dhanushreddy291 - always install neon and neon-postgres skills and then per used service the gateway, functions, and/or object-storage skills as well.

  • neon -> core skill
  • neon-postgres -> postgres skill

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrelandgraf neon init is already adding them so didn't add it in steps again.

Its mentioned here: "the Neon Postgres skills are installed automatically."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah perfect!

Comment thread content/guides/sentry-neon-functions.md Outdated
import * as Sentry from "@sentry/node";

Sentry.init({
dsn: process.env.SENTRY_DSN,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably manage those env vars in neon.ts as well!

Check out the env property on a function + maybe look into parseEnv from @neon/env!

import { parseEnv } from "@neon/env";
import { config } from "./neon";

const env = parseEnv(config, "func-name");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@dhanushreddy291
dhanushreddy291 marked this pull request as draft August 7, 2026 12:34
@dhanushreddy291
dhanushreddy291 marked this pull request as ready for review August 7, 2026 15:10

@sergical sergical left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two minor comments, otherwise LGTM, thanks for doing this <3

Comment thread content/guides/sentry-neon-functions.md Outdated
}),
},
stopWhen: isStepCount(5),
experimental_telemetry: { isEnabled: true },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both v6 and for sure v7 of AI SDK use telemetry as it's no longer experimental

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have verified using telemetry, it works the same. updated the guide.

Comment thread content/guides/sentry-neon-functions.md Outdated
enableLogs: true,
tracesSampleRate: Number(process.env.SENTRY_TRACES_SAMPLE_RATE ?? 1),
traceLifecycle: "stream", // [!code ++]
streamGenAiSpans: true, // [!code ++]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a default in 10.61.0, without knowing which versions get installed, it's hard to say but i believe we can remove this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for pointing out, will update all the placements in the future, this will work as is

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have verified by removing streamGenAiSpans and using telemetry, it works the same.

@dhanushreddy291
dhanushreddy291 marked this pull request as draft August 7, 2026 16:14
@danieltprice
danieltprice merged commit 0082975 into neondatabase:main Aug 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants