Index of every page on this site: llms.txt
All skills
brianlovin avatar

/sentry

@1a9819e official
by Brian Lovinbrianlovin/agent-config377 stars
33
Run it yourself

Sentry error monitoring and performance tracing patterns for Next.js applications.

Use this Skill: https://skilld.dev/gh/brianlovin/agent-config/sentry

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈23 tokens for metadata: the name and description. ≈505 when used: this file.

Description uses 1.1% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈91 characters, or 1.1%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Sentry Integration

Guidelines for using Sentry for error monitoring and performance tracing.

Exception Catching

Use Sentry.captureException(error) in try/catch blocks:

try {
  await riskyOperation();
} catch (error) {
  Sentry.captureException(error);
  throw error;
}

Performance Tracing

Create spans for meaningful actions like button clicks, API calls, and function calls.

UI Actions

function handleClick() {
  Sentry.startSpan(
    { op: "ui.click", name: "Submit Form" },
    (span) => {
      span.setAttribute("formId", formId);
      submitForm();
    }
  );
}

API Calls

async function fetchData(id) {
  return Sentry.startSpan(
    { op: "http.client", name: `GET /api/items/${id}` },
    async () => {
      const response = await fetch(`/api/items/${id}`);
      return response.json();
    }
  );
}

Configuration (Next.js)

Sentry initialization files:

  • sentry.client.config.ts - Client-side
  • sentry.server.config.ts - Server-side
  • sentry.edge.config.ts - Edge runtime

Import with import * as Sentry from "@sentry/nextjs" - no need to initialize in other files.

Basic Setup

import * as Sentry from "@sentry/nextjs";

Sentry.init({
  dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
  enableLogs: true,
});

With Console Logging

Sentry.init({
  dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
  integrations: [
    Sentry.consoleLoggingIntegration({ levels: ["log", "warn", "error"] }),
  ],
});

Structured Logging

Use logger.fmt for template literals with variables:

const { logger } = Sentry;

logger.trace("Starting connection", { database: "users" });
logger.debug(logger.fmt`Cache miss for: ${userId}`);
logger.info("Updated profile", { profileId: 345 });
logger.warn("Rate limit reached", { endpoint: "/api/data" });
logger.error("Payment failed", { orderId: "order_123" });
logger.fatal("Connection pool exhausted", { activeConnections: 100 });

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill provides safe, standard documentation and reference code snippets for integrating Sentry error monitoring and performance tracing into Next.js applications.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at 1a9819e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Dormantupdated 9 months ago
  • Next.js
  • sentry
  • error-monitoring
  • performance-tracing
  • observability
  • logging
  • javascript
  • exception-handling

README badge

README badge for brianlovin/agent-config/sentry

Configures Sentry error monitoring and performance tracing for Next.js applications, with patterns for exception catching, span creation, and structured logging. Covers client-side, server-side, and edge runtime initialization via separate config files.

Generated from the current SKILL.md.

Does this skill cover both client and server-side Sentry setup?
Yes. It includes configuration patterns for client-side, server-side, and edge runtime using separate config files (sentry.client.config.ts, sentry.server.config.ts, sentry.edge.config.ts) in Next.js applications.
What frameworks does this skill target?
This skill is specific to Next.js applications using @sentry/nextjs.
Does this cover performance tracing?
Yes. It includes patterns for tracing UI actions, API calls, and other meaningful operations using Sentry.startSpan with operation types like ui.click and http.client.
Can I use structured logging with this skill?
Yes. The skill includes Sentry's logger with support for trace, debug, info, warn, error, and fatal levels, plus logger.fmt for template literal logging with variables.

Generated from the current SKILL.md. These answers refresh after source changes.