Community코딩 & 개발github.com

getsentry/sentry-cocoa-sdk

Apple 플랫폼(iOS, macOS, tvOS, watchOS, visionOS)을 위한 완전한 Sentry SDK 설정입니다. "iOS에 Sentry 추가", "Swift에 Sentry 추가", "sentry-cocoa 설치" 요청 또는 Apple 애플리케이션의 오류 모니터링, 추적, 프로파일링, 세션 리플레이, 로깅, 메트릭스 구성을 위해 사용하세요. SwiftUI 및 UIKit을 지원합니다.

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

이 스킬은 Apple 생태계(iOS, macOS, tvOS, watchOS, visionOS)를 위한 Sentry SDK(sentry-cocoa)의 완전한 설정 및 구성을 제공합니다. 개발자가 "iOS에 Sentry 추가" 또는 "Swift에 Sentry 추가"와 같은 요청을 할 때, 또는 오류 모니터링, 성능 추적, 프로파일링, 세션 리플레이, 로깅, 메트릭스와 같은 기능을 Apple 애플리케이션에 통합해야 할 때 사용됩니다. 이 스킬은 SwiftUI와 UIKit 모두를 지원하며, SDK 설치부터 초기화, 옵션 구성, 그리고 다양한 Sentry 기능 활성화까지 전 과정을 안내합니다. SKILL.md 문서를 기반으로 하여, CocoaPods, Swift Package Manager, Carthage 등 주요 의존성 관리 도구를 통한 설치 방법과 함께 Sentry SDK의 핵심 설정 항목들을 상세히 설명합니다. 이를 통해 AI 에이전트(Claude Code, Cursor 등)는 사용자의 프로젝트 환경에 맞춰 정확하고 최적화된 Sentry 통합 코드를 생성할 수 있습니다.

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

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

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

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

문서

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

Apple 플랫폼(iOS, macOS, tvOS, watchOS, visionOS)을 위한 완전한 Sentry SDK 설정입니다. "iOS에 Sentry 추가", "Swift에 Sentry 추가", "sentry-cocoa 설치" 요청 또는 Apple 애플리케이션의 오류 모니터링, 추적, 프로파일링, 세션 리플레이, 로깅, 메트릭스 구성을 위해 사용하세요. SwiftUI 및 UIKit을 지원합니다.

개요

이 SDK는 Apple 플랫폼 애플리케이션에 Sentry를 통합하여 충돌 보고, 성능 추적, 프로파일링, 세션 리플레이, 로깅 및 메트릭스를 제공합니다.

설치 방법

Swift Package Manager

Package.swift 파일에 다음을 추가하세요:

// swift-tools-version:5.5
import PackageDescription

let package = Package(
    name: "MyApp",
    dependencies: [
        .package(url: "https://github.com/getsentry/sentry-cocoa.git", from: "8.0.0")
    ],
    targets: [
        .target(
            name: "MyApp",
            dependencies: ["Sentry"])
    ]
)

CocoaPods

Podfile에 다음을 추가하세요:

platform :ios, '12.0'
use_frameworks!

target 'YourApp' do
  pod 'Sentry', '~> 8.0'
end

Carthage

Cartfile에 다음을 추가하세요:

binary "https://raw.githubusercontent.com/getsentry/sentry-cocoa/main/Sentry.json" ~> 8.0

기본 설정

초기화

앱의 AppDelegate 또는 @main 구조체에서 Sentry를 초기화하세요.

iOS 14+ / SwiftUI

import SwiftUI
import Sentry

@main
struct MyApp: App {
    init() {
        SentrySDK.start { options in
            options.dsn = "https://[email protected]/0"
            options.tracesSampleRate = 1.0 // 추적 샘플링 비율 (0.0 ~ 1.0)
            options.profilesSampleRate = 1.0 // 프로파일링 샘플링 비율
            options.enableSessionReplay = true // 세션 리플레이 활성화
            options.sessionReplayConfiguration.sessionSampleRate = 0.1
            options.sessionReplayConfiguration.errorSampleRate = 1.0
            options.attachScreenshot = true // 스크린샷 첨부
            options.attachViewHierarchy = true // 뷰 계층 첨부
            options.enableTracing = true // 추적 활성화
        }
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

UIKit (iOS 13+)

import UIKit
import Sentry

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        SentrySDK.start { options in
            options.dsn = "https://[email protected]/0"
            options.tracesSampleRate = 1.0
            options.profilesSampleRate = 1.0
            options.enableAutoPerformanceTracing = true
            options.enableUIViewControllerTracing = true
        }
        return true
    }
}

주요 기능

오류 및 예외 모니터링

// 수동 오류 보고
SentrySDK.capture(error: error)

// 메시지 로깅
SentrySDK.capture(message: "사용자 작업 실행됨")

성능 추적 (Tracing)

// 사용자 정의 트랜잭션
let transaction = SentrySDK.startTransaction(name: "장바구니 체크아웃", operation: "checkout")
// ... 작업 수행 ...
transaction.finish()

프로파일링 (Profiling)

프로파일링은 options.profilesSampleRate 설정을 통해 자동으로 활성화됩니다. 코드 변경 없이 성능 병목 지점을 식별할 수 있습니다.

세션 리플레이 (Session Replay)

사용자 세션을 녹화하여 오류 발생 시점의 정확한 사용자 동작을 재생합니다.

options.enableSessionReplay = true
options.sessionReplayConfiguration.sessionSampleRate = 0.2 // 20% 세션 샘플링

로깅 (Logging)

import Sentry

// Sentry에 로그 전송
SentrySDK.capture(message: "정보 메시지") { scope in
    scope.setLevel(.info)
}

메트릭스 (Metrics)

// 사용자 정의 메트릭 전송
SentrySDK.metrics.increment(key: "button.click")
SentrySDK.metrics.distribution(key: "response.time", value: 350.0)

고급 설정

DSN 구성

DSN은 Sentry 프로젝트의 고유 식별자입니다. 환경 변수 또는 직접 문자열로 설정할 수 있습니다.

options.dsn = ProcessInfo.processInfo.environment["SENTRY_DSN"] ?? "https://[email protected]/0"

환경 및 릴리스 설정

options.environment = "production"
options.releaseName = "[email protected]"
options.dist = "1"

사전 및 사후 이벤트 처리

options.beforeSend = { event in
    // 이벤트 필터링 또는 수정
    return event
}

options.beforeBreadcrumb = { breadcrumb in
    // Breadcrumb 필터링 또는 수정
    return breadcrumb
}

플랫폼 지원

플랫폼최소 배포 타겟
iOS12.0
macOS10.13
tvOS12.0
watchOS7.0
visionOS1.0

추가 리소스

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-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-php-sdk

Full Sentry SDK setup for PHP. Use when asked to "add Sentry to PHP", "install sentry/sentry", "setup Sentry in PHP", or configure error monitoring, tracing, profiling, logging, metrics, or crons for PHP applications. Supports plain PHP, Laravel, and Symfony.

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.

관련 스킬