Check and configure Sentry error tracking for FVH standards
Validates and configures Sentry error tracking against FVH standards for frontend, Python, or Node.js projects.
/plugin marketplace add laurigates/claude-plugins/plugin install configure-plugin@lgates-claude-plugins[--check-only] [--fix] [--type <frontend|python|node>]configure/Check and configure Sentry error tracking integration against FVH (Forum Virium Helsinki) standards.
This command validates Sentry SDK integration and configuration against FVH standards.
Skills referenced: sentry (MCP server for Sentry API)
CRITICAL: Before configuring Sentry SDKs, verify latest versions:
Use WebSearch or WebFetch to verify current SDK versions before configuring Sentry.
Determine project type to select appropriate SDK and configuration:
.fvh-standards.yaml with project_type fieldpackage.json with vue/react dependenciespackage.json with Node.js backend (express, fastify, etc.)pyproject.toml or requirements.txt--type flagCheck for Sentry SDK installation:
Frontend (Vue/React):
@sentry/vue or @sentry/react in package.json dependencies@sentry/vite-plugin for source mapsNode.js Backend:
@sentry/node in package.json dependencies@sentry/profiling-node (recommended)Python:
sentry-sdk in pyproject.toml or requirements.txtEnvironment Variable Checks:
SENTRY_DSN - Required, must be set via environmentSENTRY_ENVIRONMENT - Recommended (development, staging, production)SENTRY_RELEASE - Recommended (auto-set by build)Frontend Configuration Checks:
| Check | Standard | Severity |
|---|---|---|
| DSN from env | import.meta.env.VITE_SENTRY_DSN | FAIL if hardcoded |
| Source maps | Vite plugin configured | WARN if missing |
| Tracing | tracesSampleRate set | WARN if missing |
| Session replay | Replay integration | INFO (optional) |
| Release | Auto-injected by build | WARN if missing |
Node.js Configuration Checks:
| Check | Standard | Severity |
|---|---|---|
| DSN from env | process.env.SENTRY_DSN | FAIL if hardcoded |
| Init location | Before other imports | WARN if late |
| Tracing | tracesSampleRate set | WARN if missing |
| Profiling | Profiling integration | INFO (optional) |
| Release | Auto-set by CI/CD | WARN if missing |
Python Configuration Checks:
| Check | Standard | Severity |
|---|---|---|
| DSN from env | os.getenv('SENTRY_DSN') | FAIL if hardcoded |
| Framework | Correct integration enabled | WARN if missing |
| Tracing | traces_sample_rate set | WARN if missing |
| Release | Auto-set by CI/CD | WARN if missing |
Critical Security Checks:
FVH Sentry Compliance Report
============================
Project Type: frontend (detected)
SDK: @sentry/vue v8.30.0
Installation Status:
@sentry/vue v8.30.0 ✅ PASS
@sentry/vite-plugin v2.22.0 ✅ PASS
Configuration Checks:
DSN from environment ✅ PASS
Source maps enabled ✅ PASS
Tracing configured ⚠️ WARN (sample rate 0.0)
Session replay ⏭️ SKIP (optional)
Release auto-injection ✅ PASS
Security Checks:
No hardcoded DSN ✅ PASS
No DSN in git history ✅ PASS
Sample rates reasonable ⚠️ WARN (0.0 in production)
Missing Configuration:
- tracesSampleRate should be > 0 for tracing
Recommendations:
- Set tracesSampleRate: 0.1 for 10% sampling
Overall: 2 warnings
If --fix flag or user confirms:
@sentry/vite-plugin for source mapsFrontend initialization template (Vue):
// src/sentry.ts
import * as Sentry from '@sentry/vue'
import type { App } from 'vue'
export function initSentry(app: App) {
Sentry.init({
app,
dsn: import.meta.env.VITE_SENTRY_DSN,
environment: import.meta.env.MODE,
release: import.meta.env.VITE_SENTRY_RELEASE,
integrations: [
Sentry.browserTracingIntegration(),
],
tracesSampleRate: import.meta.env.PROD ? 0.1 : 1.0,
})
}
Python initialization template:
# sentry_init.py
import os
import sentry_sdk
def init_sentry():
sentry_sdk.init(
dsn=os.getenv('SENTRY_DSN'),
environment=os.getenv('SENTRY_ENVIRONMENT', 'development'),
release=os.getenv('SENTRY_RELEASE'),
traces_sample_rate=0.1 if os.getenv('SENTRY_ENVIRONMENT') == 'production' else 1.0,
)
Node.js initialization template:
// instrument.js (must be first import)
import * as Sentry from '@sentry/node'
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
release: process.env.SENTRY_RELEASE,
tracesSampleRate: process.env.NODE_ENV === 'production' ? 0.1 : 1.0,
})
Verify Sentry integration in CI/CD:
GitHub Actions checks:
SENTRY_AUTH_TOKEN secret configuredRecommended workflow addition:
- name: Create Sentry Release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: your-org
SENTRY_PROJECT: your-project
with:
environment: production
sourcemaps: './dist'
Update or create .fvh-standards.yaml:
standards_version: "2025.1"
project_type: "frontend"
last_configured: "2025-11-30"
components:
sentry: "2025.1"
| Flag | Description |
|---|---|
--check-only | Report status without offering fixes |
--fix | Apply all fixes automatically without prompting |
--type <type> | Override project type detection (frontend, python, node) |
# Check compliance and offer fixes
/configure:sentry
# Check only, no modifications
/configure:sentry --check-only
# Auto-fix all issues
/configure:sentry --fix
# Force Python project type
/configure:sentry --type python
Required environment variables for Sentry:
| Variable | Description | Required |
|---|---|---|
SENTRY_DSN | Sentry Data Source Name | Yes |
SENTRY_ENVIRONMENT | Environment name | Recommended |
SENTRY_RELEASE | Release version | Recommended |
SENTRY_AUTH_TOKEN | Auth token for CI/CD | For source maps |
Important: Never commit DSN or auth tokens. Use environment variables or secrets management.
/configure:all - Run all FVH compliance checks/configure:status - Quick compliance overview/configure:workflows - GitHub Actions integrationsentry MCP server - Sentry API access for project verification