Community코딩 & 개발github.com

getsentry/sentry-php-sdk

PHP용 Sentry SDK 전체 설정. 'PHP에 Sentry 추가', 'sentry/sentry 설치', 'PHP에서 Sentry 설정'과 같은 요청이나 PHP 애플리케이션의 오류 모니터링, 트레이싱, 프로파일링, 로깅, 메트릭, 크론 설정 시 사용합니다. 일반 PHP, Laravel, Symfony를 지원합니다.

sentry-php-sdk란 무엇인가요?

이 스킬은 PHP 애플리케이션에 Sentry SDK를 완전히 설정하는 방법을 제공합니다. 오류 모니터링, 성능 트레이싱, 프로파일링, 로깅, 메트릭 수집, 크론 작업 모니터링 등 Sentry가 제공하는 다양한 기능을 PHP 환경에서 바로 사용할 수 있도록 안내합니다. 일반 PHP와 함께 Laravel 및 Symfony 프레임워크를 공식 지원하며, 각 프레임워크에 최적화된 설정 방법을 포함하고 있습니다. SDK 설치부터 DSN 구성, 예외 처리, 트랜잭션 및 사용자 컨텍스트 설정까지 실제 운영 환경에 필요한 모든 단계를 다루며, 초기 설정부터 고급 기능까지 단계별로 쉽게 따라할 수 있도록 구성되어 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/getsentry/sentry-for-ai/tree/main/skills/sentry-php-sdk

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

sentry-php-sdk은(는) 무엇을 하나요?

PHP용 Sentry SDK 전체 설정입니다. 'PHP에 Sentry 추가', 'sentry/sentry 설치', 'PHP에서 Sentry 설정'과 같은 요청이나 PHP 애플리케이션의 오류 모니터링, 트레이싱, 프로파일링, 로깅, 메트릭, 크론 설정 시 사용합니다. 일반 PHP, Laravel, Symfony를 지원합니다.

시작하기

1. SDK 설치

Composer를 사용하여 Sentry PHP SDK를 설치합니다:

composer require sentry/sentry

2. 설정 구성

일반 PHP

Sentry\init(['dsn' => 'https://[email protected]/0']);

Laravel

Laravel의 경우 config/sentry.php 파일을 생성합니다:

return [
    'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),
    'breadcrumbs' => [
        'logs' => true,
        'sql_queries' => true,
        'sql_bindings' => true,
        'queue_info' => true,
    ],
];

Symfony

Symfony의 경우 .env 파일에 DSN을 추가합니다:

SENTRY_DSN=https://[email protected]/0

3. 예외 캡처

try {
    // 예외가 발생할 수 있는 코드
} catch (\Throwable $exception) {
    \Sentry\captureException($exception);
}

4. 성능 트레이싱

트랜잭션을 시작하고 완료합니다:

\Sentry\startTransaction(['name' => 'my-transaction', 'op' => 'http.server']);
// ... 작업 수행 ...
\Sentry\getCurrentHub()->getTransaction()->setHttpStatus(200);

5. 사용자 컨텍스트 설정

\Sentry\configureScope(function (\Sentry\State\Scope $scope): void {
    $scope->setUser(['email' => '[email protected]', 'id' => '123']);
});

주요 기능

  • 오류 모니터링: 자동 및 수동 예외 캡처
  • 성능 트레이싱: 트랜잭션 및 스팬 추적
  • 프로파일링: 코드 실행 프로파일 수집
  • 로깅: 컨텍스트 있는 로그 전송
  • 메트릭: 사용자 정의 메트릭 전송
  • 크론 모니터링: 크론 작업 상태 추적

환경 변수

  • SENTRY_DSN: Sentry 프로젝트 DSN (필수)
  • SENTRY_ENVIRONMENT: 환경 이름 (예: production, staging)
  • SENTRY_RELEASE: 릴리스 버전

자세한 문서

공식 문서는 Sentry PHP SDK 문서를 참조하세요.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

getsentry/sentry-android-sdk

Full Sentry SDK setup for Android. Use when asked to "add Sentry to Android", "install sentry-android", "setup Sentry in Android", or configure error monitoring, tracing, profiling, session replay, or logging for Android applications. Supports Kotlin and Java codebases.

getsentry/sentry-browser-sdk

Full Sentry SDK setup for browser JavaScript. Use when asked to "add Sentry to a website", "install @sentry/browser", or configure error monitoring, tracing, session replay, or logging for vanilla JavaScript, jQuery, static sites, or WordPress.

getsentry/sentry-cloudflare-sdk

Full Sentry SDK setup for Cloudflare Workers and Pages. Use when asked to "add Sentry to Cloudflare Workers", "install @sentry/cloudflare", or configure error monitoring, tracing, logging, crons, or AI monitoring for Cloudflare Workers, Pages, Durable Objects, Queues, Workflows, or Hono on Cloudflare.

getsentry/sentry-cocoa-sdk

Full Sentry SDK setup for Apple platforms (iOS, macOS, tvOS, watchOS, visionOS). Use when asked to "add Sentry to iOS", "add Sentry to Swift", "install sentry-cocoa", or configure error monitoring, tracing, profiling, session replay, logging, or metrics for Apple applications. Supports SwiftUI and UIKit.

getsentry/sentry-code-review

Analyze and resolve Sentry comments on GitHub Pull Requests. Use this when asked to review or fix issues identified by Sentry in PR comments. Can review specific PRs by number or automatically find recent PRs with Sentry feedback.

getsentry/sentry-create-alert

Create Sentry alerts using the workflow engine API. Use when asked to create alerts, set up notifications, configure issue priority alerts, or build workflow automations. Supports email, Slack, PagerDuty, Discord, and other notification actions.

getsentry/sentry-dotnet-sdk

Full Sentry SDK setup for .NET. Use when asked to "add Sentry to .NET", "install Sentry for C#", or configure error monitoring, tracing, profiling, logging, or crons for ASP.NET Core, MAUI, WPF, WinForms, Blazor, Azure Functions, or any other .NET application.

getsentry/sentry-elixir-sdk

Full Sentry SDK setup for Elixir. Use when asked to "add Sentry to Elixir", "install sentry for Elixir", or configure error monitoring, tracing, logging, or crons for Elixir, Phoenix, or Plug applications. Supports Phoenix, Plug, LiveView, Oban, and Quantum.

getsentry/sentry-feature-setup

Configure specific Sentry features beyond basic SDK setup. Use when asked to monitor AI/LLM calls, set up OpenTelemetry pipelines, create alerts and notifications, or enable span streaming.

getsentry/sentry-fix-issues

Find and fix issues from Sentry using MCP. Use when asked to fix Sentry errors, debug production issues, investigate exceptions, or resolve bugs reported in Sentry. Methodically analyzes stack traces, breadcrumbs, traces, and context to identify root causes.

getsentry/sentry-flutter-sdk

Full Sentry SDK setup for Flutter and Dart. Use when asked to "add Sentry to Flutter", "install sentry_flutter", "setup Sentry in Dart", or configure error monitoring, tracing, profiling, session replay, or logging for Flutter applications. Supports Android, iOS, macOS, Linux, Windows, and Web.

getsentry/sentry-go-sdk

Full Sentry SDK setup for Go. Use when asked to "add Sentry to Go", "install sentry-go", "setup Sentry in Go", or configure error monitoring, tracing, logging, metrics, or crons for Go applications. Supports net/http, Gin, Echo, Fiber, FastHTTP, Iris, Negroni, and gRPC.

getsentry/sentry-nestjs-sdk

Full Sentry SDK setup for NestJS. Use when asked to "add Sentry to NestJS", "install @sentry/nestjs", "setup Sentry in NestJS", or configure error monitoring, tracing, profiling, logging, metrics, crons, or AI monitoring for NestJS applications. Supports Express and Fastify adapters, GraphQL, microservices, WebSockets, and background jobs.

getsentry/sentry-nextjs-sdk

Full Sentry SDK setup for Next.js. Use when asked to "add Sentry to Next.js", "install @sentry/nextjs", or configure error monitoring, tracing, session replay, logging, profiling, AI monitoring, or crons for Next.js applications. Supports Next.js 13+ with App Router and Pages Router.

getsentry/sentry-node-sdk

Full Sentry SDK setup for Node.js, Bun, and Deno. Use when asked to "add Sentry to Node.js", "add Sentry to Bun", "add Sentry to Deno", "install @sentry/node", "@sentry/bun", or "@sentry/deno", or configure error monitoring, tracing, logging, profiling, metrics, crons, or AI monitoring for server-side JavaScript/TypeScript runtimes.

getsentry/sentry-otel-exporter-setup

Configure the OpenTelemetry Collector with Sentry Exporter for multi-project routing and automatic project creation. Use when setting up OTel with Sentry, configuring collector pipelines for traces and logs, or routing telemetry from multiple services to Sentry projects.

getsentry/sentry-pr-code-review

Review a project's PRs to check for issues detected in code review by Seer Bug Prediction. Use when asked to review or fix issues identified by Sentry in PR comments, or to find recent PRs with Sentry feedback.

getsentry/sentry-python-sdk

Full Sentry SDK setup for Python. Use when asked to "add Sentry to Python", "install sentry-sdk", "setup Sentry in Python", or configure error monitoring, tracing, profiling, logging, metrics, crons, or AI monitoring for Python applications. Supports Django, Flask, FastAPI, Celery, Starlette, AIOHTTP, Tornado, and more.

getsentry/sentry-react-native-sdk

Full Sentry SDK setup for React Native and Expo. Use when asked to "add Sentry to React Native", "install @sentry/react-native", "setup Sentry in Expo", or configure error monitoring, tracing, profiling, session replay, or logging for React Native applications. Supports Expo managed, Expo bare, and vanilla React Native.

getsentry/sentry-react-sdk

Full Sentry SDK setup for React. Use when asked to "add Sentry to React", "install @sentry/react", or configure error monitoring, tracing, session replay, profiling, or logging for React applications. Supports React 16+, React Router v5-v7 non-framework mode, TanStack Router, Redux, Vite, and webpack.

관련 스킬