SE

sentry-hello-world

Captures and confirms test errors in Sentry to verify successful SDK initialization and dashboard integration.

Install

mkdir -p .claude/skills/sentry-hello-world && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/7750" && unzip -o skill.zip -d .claude/skills/sentry-hello-world && rm skill.zip

Installs to .claude/skills/sentry-hello-world

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Capture your first test error with Sentry and verify it appears in the
70 charsno explicit “when” trigger
Beginner

Key capabilities

  • Send a test message to Sentry to verify basic connectivity
  • Capture a test exception with a stack trace
  • Attach user identity to events for filtering
  • Add searchable tags to events
  • Include structured context data in event details
  • Record a trail of events as breadcrumbs

How it works

The skill sends various test events, including messages, exceptions, and enriched errors, to the Sentry dashboard. It uses Sentry SDK functions like captureMessage, captureException, setUser, setTag, setContext, and addBreadcrumb.

Inputs & outputs

You give it
Sentry SDK configuration and test event data
You get back
Test events visible in the Sentry dashboard with event IDs

When to use sentry-hello-world

  • Testing Sentry integration
  • Verifying error capturing
  • Testing SDK setup

About this skill

Sentry Hello World

Overview

Send your first test events to Sentry — a captured message, a captured exception, and a fully-enriched error with user context, tags, and breadcrumbs — then verify each one appears in the Sentry dashboard. This skill covers both Node.js (@sentry/node) and Python (sentry-sdk).

Prerequisites

  • Completed sentry-install-auth setup (SDK installed, DSN configured)
  • Valid SENTRY_DSN in environment variables
  • instrument.mjs loaded before app code (Node.js) or sentry_sdk.init() called (Python)
  • Network access to *.ingest.sentry.io

Instructions

Step 1 — Verify the SDK Is Active

Before sending test events, confirm the SDK initialized correctly. If getClient() returns undefined, the SDK was never initialized — go back to sentry-install-auth.

TypeScript (Node.js):

import * as Sentry from '@sentry/node';

const client = Sentry.getClient();
if (!client) {
  console.error('Sentry SDK not initialized. Ensure instrument.mjs is loaded first.');
  console.error('Run with: node --import ./instrument.mjs your-script.mjs');
  process.exit(1);
}
console.log('Sentry SDK active — DSN configured');

Python:

import sentry_sdk

client = sentry_sdk.Hub.current.client
if client is None or client.dsn is None:
    print("Sentry SDK not initialized. Call sentry_sdk.init() first.")
    exit(1)
print("Sentry SDK active — DSN configured")

Step 2 — Capture a Test Message

captureMessage sends an informational event without a stack trace. Use it to verify basic connectivity between your app and Sentry.

TypeScript:

import * as Sentry from '@sentry/node';

// captureMessage returns the event ID (a 32-char hex string)
const eventId = Sentry.captureMessage('Hello Sentry! SDK verification test.', 'info');
console.log(`Message sent — Event ID: ${eventId}`);

// Also test 'warning' level — appears with yellow indicator in dashboard
Sentry.captureMessage('Warning-level test message', 'warning');

// IMPORTANT: flush before process exits or events may be lost
await Sentry.flush(2000);

Python:

import sentry_sdk

event_id = sentry_sdk.capture_message("Hello Sentry! SDK verification test.", level="info")
print(f"Message sent — Event ID: {event_id}")

sentry_sdk.capture_message("Warning-level test message", level="warning")

# Flush to ensure delivery before process exits
sentry_sdk.flush()

Step 3 — Capture a Test Exception

captureException sends a full error with stack trace. Always pass an actual Error object (not a string) so Sentry generates a proper stack trace.

TypeScript:

import * as Sentry from '@sentry/node';

try {
  throw new Error('Hello Sentry! This is a test exception.');
} catch (error) {
  const eventId = Sentry.captureException(error);
  console.log(`Exception sent — Event ID: ${eventId}`);
}

await Sentry.flush(2000);

Python:

import sentry_sdk

try:
    raise ValueError("Hello Sentry! This is a test exception.")
except Exception as e:
    event_id = sentry_sdk.capture_exception(e)
    print(f"Exception sent — Event ID: {event_id}")

sentry_sdk.flush()

Step 4 — Add User Context and Tags

Enrich events with identity and metadata so you can filter and search in the dashboard. setUser attaches to all subsequent events in the current scope. setTag creates indexed, searchable key-value pairs.

TypeScript:

import * as Sentry from '@sentry/node';

// Attach user identity — appears in the "User" section of every event
Sentry.setUser({
  id: 'test-user-001',
  email: '[email protected]',
  username: 'developer',
});

// Tags are indexed and searchable — use for filtering in Issues view
Sentry.setTag('test_run', 'hello-world');
Sentry.setTag('team', 'platform');

// setContext adds structured data (not indexed, but visible in event detail)
Sentry.setContext('test_metadata', {
  ran_at: new Date().toISOString(),
  node_version: process.version,
  purpose: 'SDK verification',
});

// This event will carry user, tags, and context
Sentry.captureMessage('Test event with full context attached', 'info');

await Sentry.flush(2000);

Python:

import sentry_sdk
from datetime import datetime, timezone
import sys

sentry_sdk.set_user({"id": "test-user-001", "email": "[email protected]", "username": "developer"})

sentry_sdk.set_tag("test_run", "hello-world")
sentry_sdk.set_tag("team", "platform")

sentry_sdk.set_context("test_metadata", {
    "ran_at": datetime.now(timezone.utc).isoformat(),
    "python_version": sys.version,
    "purpose": "SDK verification",
})

sentry_sdk.capture_message("Test event with full context attached", level="info")

sentry_sdk.flush()

Step 5 — Add Breadcrumbs

Breadcrumbs record a trail of events leading up to an error. They appear in the event detail view, giving you the chronological context of what happened before the crash.

TypeScript:

import * as Sentry from '@sentry/node';

Sentry.addBreadcrumb({
  category: 'auth',
  message: 'User authenticated successfully',
  level: 'info',
});

Sentry.addBreadcrumb({
  category: 'http',
  message: 'GET /api/users returned 200',
  level: 'info',
  data: { status_code: 200, url: '/api/users', method: 'GET' },
});

Sentry.addBreadcrumb({
  category: 'ui',
  message: 'User clicked "Submit Order" button',
  level: 'info',
});

// This exception will carry all three breadcrumbs above
try {
  throw new Error('Order processing failed — breadcrumb trail attached');
} catch (error) {
  Sentry.captureException(error);
}

await Sentry.flush(2000);

Python:

import sentry_sdk

sentry_sdk.add_breadcrumb(category="auth", message="User authenticated successfully", level="info")
sentry_sdk.add_breadcrumb(category="http", message="GET /api/users returned 200", level="info",
                          data={"status_code": 200, "url": "/api/users"})
sentry_sdk.add_breadcrumb(category="ui", message="User clicked Submit Order button", level="info")

try:
    raise RuntimeError("Order processing failed — breadcrumb trail attached")
except Exception as e:
    sentry_sdk.capture_exception(e)

sentry_sdk.flush()

Step 6 — Verify in the Sentry Dashboard

  1. Open https://sentry.io and select your project
  2. Navigate to the Issues tab — test errors appear as grouped issues
  3. Click an issue to inspect the event detail:
    • Stack Trace — file path, line number, and surrounding code context
    • User section — id, email, username from setUser()
    • Tags sidebar — test_run: hello-world, team: platform
    • Breadcrumbs tab — chronological trail of events before the error
    • Additional Data — custom context from setContext()
  4. Use the search bar to filter: test_run:hello-world narrows to your test events
  5. Confirm Environment matches your SENTRY_ENVIRONMENT value
  6. Confirm Release matches your SENTRY_RELEASE value (if set)
  7. Delete test issues when done: select issues > Resolve or Delete

Examples

Complete Verification Script (TypeScript)

Save as test-sentry.mjs and run with node --import ./instrument.mjs test-sentry.mjs to exercise all capabilities at once.

// Run with: node --import ./instrument.mjs test-sentry.mjs
import * as Sentry from '@sentry/node';

async function main() {
  console.log('--- Sentry Hello World Verification ---\n');

  // 1. Verify SDK
  const client = Sentry.getClient();
  if (!client) {
    console.error('ERROR: Sentry SDK not initialized.');
    console.error('Run with: node --import ./instrument.mjs test-sentry.mjs');
    process.exit(1);
  }
  console.log('[OK] Sentry SDK active');

  // 2. Set user context and tags
  Sentry.setUser({ id: 'test-001', email: '[email protected]', username: 'developer' });
  Sentry.setTag('test_run', 'hello-world');
  Sentry.setTag('environment', process.env.SENTRY_ENVIRONMENT || 'test');
  console.log('[OK] User context and tags set');

  // 3. Capture a message
  const msgId = Sentry.captureMessage('Hello Sentry — SDK verification', 'info');
  console.log(`[OK] Message captured — Event ID: ${msgId}`);

  // 4. Capture an exception with breadcrumbs
  Sentry.addBreadcrumb({ category: 'test', message: 'Starting verification script', level: 'info' });
  Sentry.addBreadcrumb({ category: 'test', message: 'About to throw test error', level: 'warning' });

  try {
    throw new Error('Hello Sentry! Verification test exception.');
  } catch (error) {
    const errId = Sentry.captureException(error);
    console.log(`[OK] Exception captured — Event ID: ${errId}`);
  }

  // 5. Flush and report
  await Sentry.flush(5000);
  console.log('\n[DONE] All events flushed — check your Sentry dashboard at https://sentry.io');
  console.log('Navigate to Issues tab, filter by tag: test_run:hello-world');
}

main();

Complete Verification Script (Python)

Save as test_sentry.py and run with python test_sentry.py (after calling sentry_sdk.init() in your setup).

# Run with: python test_sentry.py (after sentry_sdk.init() in your setup)
import sentry_sdk
import os
import sys

def main():
    print("--- Sentry Hello World Verification ---\n")

    # 1. Verify SDK
    client = sentry_sdk.Hub.current.client
    if client is None or client.dsn is None:
        print("ERROR: Sentry SDK not initialized.")
        print("Ensure sentry_sdk.init(dsn=...) is called before this script.")
        sys.exit(1)
    print("[OK] Sentry SDK active")

    # 2. Set user context and tags
    sentry_sdk.set_user({"id": "test-001", "email": "[email protected]", "username": "developer"})
    sentry_sdk.set_tag("test_run", "hello-world")
    sentry_sdk.set_tag("environment", os.environ.get("SENTRY_ENVIRONMENT", "test"))
    print("[OK] User context and tags set")

    # 3. Capture a message
    msg_id = sentry_sdk.capture_message("Hello Sentry — SDK verification", level="info")
    pri

---

*Content truncated.*

When not to use it

  • When the Sentry SDK is not initialized
  • When network access to *.ingest.sentry.io is unavailable

Prerequisites

Completed sentry-install-auth setup (SDK installed, DSN configured)Valid SENTRY_DSN in environment variablesinstrument.mjs loaded before app code (Node.js) or sentry_sdk.init() called (Python)Network access to *.ingest.sentry.io

Limitations

  • Events may be lost if flush is not called before process exits
  • Missing stack traces if errors are captured as strings instead of Error objects
  • User context may be missing if setUser is called after captureException

How it compares

This workflow systematically tests Sentry's event capture and enrichment capabilities, unlike manually sending individual test events.

Compared to similar skills

sentry-hello-world side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
sentry-hello-world (this skill)126dCautionBeginner
langfuse76moNo flagsIntermediate
adk-engineer326dReviewAdvanced
sentry-rate-limits126dCautionIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

langfuse

davila7

Expert in Langfuse - the open-source LLM observability platform. Covers tracing, prompt management, evaluation, datasets, and integration with LangChain, LlamaIndex, and OpenAI. Essential for debugging, monitoring, and improving LLM applications in production. Use when: langfuse, llm observability, llm tracing, prompt management, llm evaluation.

743

adk-engineer

jeremylongshore

Execute software engineer specializing in creating production-ready ADK agents with best practices, code structure, testing, and deployment automation. Use when asked to "build ADK agent", "create agent code", or "engineer ADK application". Trigger with relevant phrases based on skill purpose.

326

sentry-rate-limits

jeremylongshore

Manage Sentry rate limits and quota optimization. Use when hitting rate limits, optimizing event volume, or managing Sentry costs. Trigger with phrases like "sentry rate limit", "sentry quota", "reduce sentry events", "sentry 429".

120

lint-and-validate

davila7

Automatic quality control, linting, and static analysis procedures. Use after every code modification to ensure syntax correctness and project standards. Triggers onKeywords: lint, format, check, validate, types, static analysis.

68

optimizing-performance

CloudAI-X

Analyzes and optimizes application performance across frontend, backend, and database layers. Use when diagnosing slowness, improving load times, optimizing queries, reducing bundle size, or when asked about performance issues.

113

sentry-multi-env-setup

jeremylongshore

Configure Sentry across multiple environments. Use when setting up Sentry for dev/staging/production, managing environment-specific configurations, or isolating data. Trigger with phrases like "sentry environments", "sentry staging setup", "multi-environment sentry", "sentry dev vs prod".

210

Search skills

Search the agent skills registry