# Game Development Debugging and Real-time Crash Reporting

> Real-time crash reporting for real gameplay across all platforms, including any game engine on any console, PC, or mobile. Fix issues before they bring down the player experience.

**URL:** https://sentry.io/solutions/game-developers/

---

Real-time crash reporting for real gameplay across all platforms, including any game engine on any console, PC, or mobile device. See the right context on crashes and errors across your development and retail builds, so you can fix issues before they bring down the player experience.

## Supported SDKs

- Unity — [Docs](https://sentry.io/for/unity/)

- Unreal — [Docs](https://docs.sentry.io/platforms/unreal/)

- GoDot — [Docs](https://docs.sentry.io/platforms/godot/)

- Xbox — [Docs](https://docs.sentry.io/platforms/xbox/)

- PS5 — [Docs](https://docs.sentry.io/platforms/playstation/)

- Switch — [Docs](https://docs.sentry.io/platforms/nintendo-switch/)

- iOS — [Docs](https://docs.sentry.io/platforms/apple/guides/ios/)

- Windows — [Docs](https://docs.sentry.io/platforms/native/)

- Mac — [Docs](https://docs.sentry.io/platforms/native/)

- Rust — [Docs](https://docs.sentry.io/platforms/rust/)

- Linux — [Docs](https://docs.sentry.io/platforms/native/)

- C — [Docs](https://docs.sentry.io/platforms/native/)

- C++ — [Docs](https://docs.sentry.io/platforms/native/)

- Objective-C — [Docs](https://docs.sentry.io/platforms/apple/)

- Objective-C++ — [Docs](https://docs.sentry.io/platforms/apple/)

- WebGL — [Docs](https://docs.sentry.io/platforms/unity/)

- Crashpad — [Docs](https://docs.sentry.io/platforms/native/guides/crashpad/)

- Breakpad — [Docs](https://docs.sentry.io/platforms/native/guides/breakpad/)

- Meta Quest — [Docs](https://docs.sentry.io/platforms/android/)

- Vision Pro — [Docs](https://docs.sentry.io/platforms/apple/)

## Details

### Real-time crash reporting

#### Debug crashes and errors faster across all your builds

Your players know immediately when your game has a bug or crashes. So should you. 

Sentry gives you a single, unified view of crashes across Unreal, Unity, Godot, and proprietary engines, on any platform including consoles.

#### Set alerts and see every issue in one place

Triaging and investigating errors across your builds shouldn’t be an endless fetch quest. 

Sentry groups similar error events into issues and alerts you to show how frequently a problem is happening and who it’s affecting. 

Search and filter your issues by what’s most important and jump into the details to get context at a glance.

#### Get stack traces, user and device configuration, and more

If your players experience an issue— from your game failing to instantiate specific objects to simply corrupted savegames — you need to know more than ‘it’s broken’. 

Sentry gives you context on device type, orientation, battery level, GPU state, CPU info, and everything about the software and OS that your game is running on so you can reproduce the issue and fix it faster.

#### Attach screenshots, custom tags, and logs

When players report crashes during a boss fight, the stack trace doesn’t always explain what triggered it. 

Sentry gives you screenshots, logs, device, and OS events as breadcrumbs leading up to crashes. 

Including fine-grained information on game state in custom tags (like `playerHealth` or `activeWeapon)` or screenshots so you can speedrun your investigation.

### Game engine & console support

#### Unity

Capture C# exceptions, native crashes, and unhandled errors across Windows, macOS, Android, iOS, and consoles, from prototype to production—all with minimal overhead. 

Get insights into both editor-time and runtime issues, track crash-free sessions, and surface bugs with full context, including device state, logs, and user breadcrumbs. It’s lightweight, powerful debugging, purpose-built for Unity.

#### Unreal Engine

Sentry’s Unreal Engine SDK is built for the demands of C++ debugging in high-performance, visually intensive games. 

Capture native crashes, hard faults, and low-level errors across Windows, Linux, mobile, and consoles—plus game state, device info, and breadcrumbs—to keep cinematic game experiences running smoothly.

#### Godot

Sentry is the first application monitoring tool to directly support Godot, with comprehensive crash reporting and error tracking built for your Godot projects giving you lightweight, powerful Godot debugging. Capture GDScript errors and native game crashes across Windows, Linux, and macOS to get visibility into Godot projects from local dev builds to live releases.

#### Console support

Sentry supports crash reporting for Nintendo Switch, PlayStation, and Xbox. Here's what you get:

Readable stack traces to quickly identify what went wrong 

Built-in symbol server so you can upload your debug files directly to Sentry, as well as custom symbol server support. 

Tags and device context like console model, build number, region, and device state

### Better performing games and releases

#### Get crash-free rate, user adoption, and new issues associated with releases

Pushing the latest release of your RTS game into the wild shouldn’t feel like a roll of the dice. Instead of wondering whether your users are going to complain, see version adoption, crash-free sessions, failure rate, and any new issues associated with the release. 

Then use the context Sentry provides to prioritize the most impactful bugs affecting your players, and ensure overall stability improves with each update.

#### Set metric alerts to understand game stability at a glance

Instead of wondering what the player experience looks like, see critical info on the quality and amount of user sessions across your player base. 

Set metric alerts so you know the instant the player experience degrades and quickly see where updates introduced problems.

#### Pinpoint laggy code slowing your players down

Figuring out what, exactly, is making that one loading screen take forever doesn’t have to be a slog. 

Use Sentry to identify errors and latency problems in your development and retail builds. Get a breakdown of requests and operations as they happen in your game to see the exact poor-performing API call making players ragequit or slow database query that tanks your loading screens.

#### Go from issues to code fixes automatically with AI debugging

Not sure what’s at fault when your skill tree keeps glitching? 

Seer, Sentry’s AI agent, identifies the root cause of problems with 94.5% accuracy, generates code fixes and can create pull requests in GitHub to resolve issues faster.

It’s AI that can help fix everything from AAA platformers to your pet project.

## Customer Story

> If you're a Unity developer struggling with performance or haunted by unexplained ANRs, we highly recommend giving Sentry a try. It’s not just a crash logger, it’s a window into your game's real-world performance.

[Read the full story](https://blog.sentry.io/fixing-unity-anrs-with-sentry-amanotes/ )

- **50%** reduction in Unity ANRs

- **80%** improvement in scene load times

## More content for game developers

- [Using the Sentry Unity SDK for Error and Crash Reporting](https://blog.sentry.io/sentry-unity-sdk-for-error-crash-reporting/): It’s one thing to debug your game during development, but once your game is in production, visibility into errors and failures in real gameplay is harder to achieve. And when something does go wrong, players are more likely to ragequit than submit a bug ticket. 

In this post, we’ll walk through a tutorial showcasing how Sentry uncovers real issues – from runtime exceptions to misconfigured prefab references – in real gameplay for [Unity](https://sentry.io/for/unity/) developers, and give you the right context (like screenshots or line numbers for a `NullReferenceException`) to fix them faster.

- [PlayStation, Xbox, Switch, PC, or Mobile — wherever you’ve got bugs to crush, Sentry can help](https://blog.sentry.io/playstation-xbox-switch-pc-or-mobile-wherever-youve-got-bugs-to-crush-sentry/): With more than 1,500 companies in the gaming industry—including [Riot Games](https://sentry.io/customers/riot/), Epic Games, and even [Unity](https://www.youtube.com/watch?v=c98CCVAQNZc)—using Sentry to monitor their products, we continue to expand our support for game engines and console integrations. Whether you're working in Unreal Engine, Unity, Godot or your in-house engine—or shipping to PlayStation, Xbox, or Nintendo Switch—[Sentry](https://sentry.io/welcome/) helps you track down crashes, errors, and performance issues in production without digging through scattered logs or switching between platform-specific tools.

- [Fixing Elusive Unity ANRs: How Amanotes Used Sentry to Cut Errors by 50%](https://blog.sentry.io/fixing-unity-anrs-with-sentry-amanotes/): In today’s mobile-first world, users expect apps to launch instantly and respond seamlessly. For game developers, maintaining that buttery-smooth experience isn’t just a nice-to-have—it’s essential for retention and revenue. But what happens when performance starts breaking down, and there’s no clear cause?

That’s exactly where we found ourselves at Amanotes. As we continued to add new features to one of our top games, Duet Cats – a music rhythm game with over 10 million downloads on [Google Play](https://play.google.com/store/apps/details?id=com.amanotes.gs.g06) and [App Store](https://apps.apple.com/app/id6446201229) – we noticed a troubling trend: every new feature seemed to double the number of "[Application Not Responding](https://docs.sentry.io/platforms/unity/configuration/app-not-responding/)" errors (ANRs).

## Quick Start

### Python

Install the Sentry Python SDK with pip

```bash
pip install sentry-sdk
```

Configuration should happen as early as possible in your application's lifecycle.

```python
import sentry_sdk

sentry_sdk.init(
  dsn="https://examplePublicKey@o0.ingest.sentry.io/0",
  # Add data like request headers and IP for users, if applicable;
  # see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
  send_default_pii=True,
  # Set traces_sample_rate to 1.0 to capture 100%
  # of transactions for tracing.
  traces_sample_rate=1.0,
  #Enable logs to be sent to Sentry
  enable_logs=True,
  # To collect profiles for all profile sessions,
  # set profile_session_sample_rate to 1.0.
  profile_session_sample_rate=1.0,
  # Profiles will be automatically collected while
  # there is an active span.
  profile_lifecycle="trace",
)
```

### JavaScript

Install the Sentry JavaScript SDK with npm

```bash
npm install @sentry/browser --save
```

Configuration should happen as early as possible in your application's lifecycle.

```javascript
import * as Sentry from "@sentry/browser";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  // Adds request headers and IP for users, for more info visit:
  // https://docs.sentry.io/platforms/javascript/configuration/options/#sendDefaultPii
  sendDefaultPii: true,
  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for tracing.
  tracesSampleRate: 1.0,
  // Set tracePropagationTargets to control for which URLs trace propagation should be enabled
  tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
  // Enable logs to be sent to Sentry
  enableLogs: true,
  // Set profilesSampleRate to 1.0 to profile every transaction.
  // Since profilesSampleRate is relative to tracesSampleRate,
  // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate
  // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would
  // result in 25% of transactions being profiled (0.5*0.5=0.25)
  profilesSampleRate: 1.0,
  integrations: [
    Sentry.browserTracingIntegration(),
    Sentry.browserProfilingIntegration(),
  ],
});
```

### React

Run the command for your preferred package manager to add the Sentry SDK to your application:

```bash
npm install @sentry/react --save
```

To import and initialize Sentry, create a file in your project's root directory, for example, `instrument.js`, and add the following code:

```javascript
import * as Sentry from "@sentry/react";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  // Adds request headers and IP for users, for more info visit:
  // https://docs.sentry.io/platforms/javascript/guides/react/configuration/options/#sendDefaultPii
  sendDefaultPii: true,
  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for tracing.
  // Learn more at
  // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
  tracesSampleRate: 1.0,
  // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled
  tracePropagationTargets: [/^//, /^https://yourserver.io/api/],
  // Enable logs to be sent to Sentry
  enableLogs: true,
  // Set profilesSampleRate to 1.0 to profile every transaction.
  // Since profilesSampleRate is relative to tracesSampleRate,
  // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate
  // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would
  // result in 25% of transactions being profiled (0.5*0.5=0.25)
  profilesSampleRate: 1.0,
  integrations: [
    // If you're using react router, use the integration for your react router version instead.
    // Learn more at
    // https://docs.sentry.io/platforms/javascript/guides/react/features/react-router/
    Sentry.browserTracingIntegration(),
    Sentry.browserProfilingIntegration(),
  ],
});
```

Initialize Sentry as early as possible in your application. We recommend putting the import of your initialization code as the first import in your app's entry point:

```javascript
// Sentry initialization should be imported first!
import "./instrument";
import App from "./App";
import { createRoot } from "react-dom/client";

const container = document.getElementById("app");
const root = createRoot(container);
root.render(<App />);
```

To make sure Sentry captures all your app's errors, configure error handling based on your React version. 
 For React versions 19 and up:  

```javascript
import { createRoot } from "react-dom/client";
import * as Sentry from '@sentry/react';

const container = document.getElementById("app");
const root = createRoot(container, {
  // Callback called when an error is thrown and not caught by an ErrorBoundary.
  onUncaughtError: Sentry.reactErrorHandler((error, errorInfo) => {
    console.warn('Uncaught error', error, errorInfo.componentStack);
  }),
  // Callback called when React catches an error in an ErrorBoundary.
  onCaughtError: Sentry.reactErrorHandler(),
  // Callback called when React automatically recovers from errors.
  onRecoverableError: Sentry.reactErrorHandler(),
});
root.render();
```

For React versions 18 and below, use the ErrorBoundary component to automatically send errors from specific component trees to Sentry and provide a fallback UI:

```javascript
import React from "react";
import * as Sentry from "@sentry/react";

<Sentry.ErrorBoundary fallback={<p>An error has occurred</p>}>
  <Example />
</Sentry.ErrorBoundary>;
```

### Next.js

To install Sentry using the installation wizard, run thrun the following command and step through the prompts:

```bash
npx @sentry/wizard@latest -i nextjs
```

For manual installation run the following command and use the following configurations:

```bash
npm install @sentry/nextjs --save
```

Extend your app's default Next.js options by adding code with `withSentryConfig` into your `next.config.(js|mjs)` file:

```javascript
const { withSentryConfig } = require("@sentry/nextjs");
const nextConfig = {
  // Your existing Next.js configuration
};
// Make sure adding Sentry options is the last code to run before exporting
module.exports = withSentryConfig(nextConfig, {
  org: "example-org",
  project: "example-project",
  // Only print logs for uploading source maps in CI
  // Set to `true` to suppress logs
  silent: !process.env.CI,
  // Automatically tree-shake Sentry logger statements to reduce bundle size
  disableLogger: true,
});
```

#### Client-Side Configuration

```javascript
import * as Sentry from "@sentry/nextjs";
Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  // Adds request headers and IP for users, for more info visit:
  // https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#sendDefaultPii
  sendDefaultPii: true,
  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for tracing.
  // We recommend adjusting this value in production
  // Learn more at
  // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
  tracesSampleRate: 1.0,
  // Enable logs to be sent to Sentry
  enableLogs: true,
  // Set profilesSampleRate to 1.0 to profile every transaction.
  // Since profilesSampleRate is relative to tracesSampleRate,
  // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate
  // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would
  // result in 25% of transactions being profiled (0.5*0.5=0.25)
  profilesSampleRate: 1.0,
});

// This export will instrument router navigations, and is only relevant if you enable tracing.
// `captureRouterTransitionStart` is available from SDK version 9.12.0 onwards
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
```

#### Server-Side Configuration

```javascript
import * as Sentry from "@sentry/nextjs";
Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  // Adds request headers and IP for users, for more info visit:
  // https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/options/#sendDefaultPii
  sendDefaultPii: true,
  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for tracing.
  // We recommend adjusting this value in production
  // Learn more at
  // https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
  tracesSampleRate: 1.0,
  // Enable logs to be sent to Sentry
  enableLogs: true,
});
```

#### Register Sentry Server-Side SDK Initialization

Create a Next.js Instrumentation file named `instrumentation.(js|ts)` in your project root or inside the `src` folder if you have one. Import your server and edge configurations, making sure that the imports point to your specific files:

```javascript
export async function register() {
  if (process.env.NEXT_RUNTIME === "nodejs") {
    await import("./sentry.server.config");
  }
  if (process.env.NEXT_RUNTIME === "edge") {
    await import("./sentry.edge.config");
  }
}
```

### Go

Grab the Sentry Go SDK:

```bash
go get "github.com/getsentry/sentry-go"
```

Configuration should happen as early as possible in your application's lifecycle.

```text
err := sentry.Init(sentry.ClientOptions{
  Dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  // Enable printing of SDK debug messages.
  // Useful when getting started or trying to figure something out.
  Debug: true,
  // Adds request headers and IP for users,
  // visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
  SendDefaultPII: true,
  EnableTracing: true,
  // Set TracesSampleRate to 1.0 to capture 100%
  // of transactions for tracing.
  TracesSampleRate: 1.0,
})
if err != nil {
  log.Fatalf("sentry.Init: %s", err)
}
// Flush buffered events before the program terminates.
// Set the timeout to the maximum duration the program can afford to wait.
defer sentry.Flush(2 * time.Second)
```

### Ruby

Add the sentry-ruby gem to your Gemfile:

```ruby
gem "sentry-ruby"
```

Configuration should happen as early as possible in your application's lifecycle.

```ruby
require 'sentry-ruby'

Sentry.init do |config|
  config.dsn = 'https://examplePublicKey@o0.ingest.sentry.io/0'

  # get breadcrumbs from logs
  config.breadcrumbs_logger = [:sentry_logger, :http_logger]

  # Add data like request headers and IP for users, if applicable;
  # see https://docs.sentry.io/platforms/ruby/data-management/data-collected/ for more info
  config.send_default_pii = true
  # enable tracing
  # we recommend adjusting this value in production
  config.traces_sample_rate = 1.0
  # Enable logs to be sent to Sentry
  config.enable_logs = true
  # enable profiling
  # this is relative to traces_sample_rate
  config.profiles_sample_rate = 1.0
end
```

### PHP

Install the Sentry SDK using Composer:

```bash
composer require sentry/sentry
```

To use Profiling, you'll also need to install the Excimer extension via PECL:

```bash
pecl install excimer
```

To capture all errors, even the one during the startup of your application, you should initialize the Sentry PHP SDK as soon as possible.

```php
\Sentry\init([
  'dsn' => 'https://examplePublicKey@o0.ingest.sentry.io/0',
  // Add request headers, cookies and IP address,
  // see https://docs.sentry.io/platforms/php/data-management/data-collected/ for more info
  'send_default_pii' => true,
  // Specify a fixed sample rate
  'traces_sample_rate' => 1.0,
  // Enable logs to be sent to Sentry
  'enable_logs' => true,
  // Set a sampling rate for profiling - this is relative to traces_sample_rate
  'profiles_sample_rate' => 1.0,
]);
```

### .NET

Install the NuGet package to add the Sentry dependency:

```shell
dotnet add package Sentry -v 5.16.2
```

To use Profiling, you'll also need to install the Sentry.Profiling package:

```shell
dotnet add package Sentry.Profiling -v 5.16.2
```

To capture all errors, even the one during the startup of your application, you should initialize the Sentry .NET SDK as soon as possible.

```csharp
SentrySdk.Init(options =>
{
    options.Dsn = "https://examplePublicKey@o0.ingest.sentry.io/0";
    options.Debug = true;
    // Adds request URL and headers, IP and name for users, etc.
    options.SendDefaultPii = true;
    // A fixed sample rate of 1.0 - 100% of all transactions are getting sent
    options.TracesSampleRate = 1.0f;
    // A sample rate for profiling - this is relative to TracesSampleRate
    options.ProfilesSampleRate = 1.0f;
});
```

---

*Source: [sentry.io/solutions/game-developers/](https://sentry.io/solutions/game-developers/)*
