docs: add sentry neon functions guide - #5465
Conversation
|
@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"> |
There was a problem hiding this comment.
@danieltprice you may want to update or remove this note as needed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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-skillsrepo shorthand here and include theneon-ai-gatewayskill 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.
| ✔ 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. |
|
|
||
| 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: |
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
@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."
| import * as Sentry from "@sentry/node"; | ||
|
|
||
| Sentry.init({ | ||
| dsn: process.env.SENTRY_DSN, |
There was a problem hiding this comment.
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");
sergical
left a comment
There was a problem hiding this comment.
two minor comments, otherwise LGTM, thanks for doing this <3
| }), | ||
| }, | ||
| stopWhen: isStepCount(5), | ||
| experimental_telemetry: { isEnabled: true }, |
There was a problem hiding this comment.
I think both v6 and for sure v7 of AI SDK use telemetry as it's no longer experimental
There was a problem hiding this comment.
sure @sergical checking it.
I was following the sentry.md file here: https://github.com/neondatabase/agent-skills/blob/main/skills/neon-functions/references/sentry.md
There was a problem hiding this comment.
have verified using telemetry, it works the same. updated the guide.
| enableLogs: true, | ||
| tracesSampleRate: Number(process.env.SENTRY_TRACES_SAMPLE_RATE ?? 1), | ||
| traceLifecycle: "stream", // [!code ++] | ||
| streamGenAiSpans: true, // [!code ++] |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
sure @sergical checking it.
I was following the sentry.md file here: https://github.com/neondatabase/agent-skills/blob/main/skills/neon-functions/references/sentry.md
There was a problem hiding this comment.
thanks for pointing out, will update all the placements in the future, this will work as is
There was a problem hiding this comment.
have verified by removing streamGenAiSpans and using telemetry, it works the same.
Co-authored-by: Isaac
https://neon-next-git-fork-dhanushreddy291-add-docs-730336-neondatabase.vercel.app/guides/sentry-neon-functions