# Error Monitoring

Get actionable insights to resolve the most important code-related issues. Track, debug, and resolve errors across any language or framework with tailored context to get to the root cause every time.

[ Try Sentry for Free ](https://sentry.io/signup/) [ Get a Demo ](https://sentry.io/demo/)

## Understand what your code is thinking. Really.

Don't waste cycles reproducing errors. Trace errors across your entire stack and act fast with all the context you need to fix the root cause - like the line of code, user actions and functions leading up to when it occurred.

[ Enable stack traces ](https://docs.sentry.io/product/sentry-basics/integrate-frontend/upload-source-maps/)

## Prioritize issues that matter most.

Know when your code breaks and who can help fix it. Quickly know how many real users experienced the error, auto-assign issues to who committed the broken code, and alert your team over communication channels like Slack when an error happens the first time, regresses or escalates.

[ Read the Docs ](https://docs.sentry.io/product/issues/ownership-rules/)

## Maintain quality and stability with Release Health

Get real-time visibility across releases to see core metrics like crash-free sessions, version adoption, and failure rate so you can see the moment a release starts to degrade and quickly take action.

[ View sample release ](https://sandbox.sentry.io/explore/releases/)

## How Sentry helps

[ ### Alerts Receive alerts for errors to quickly address issues.  ](https://docs.sentry.io/product/alerts/)[ ### Stacktrace and Local Variables View detailed stacktraces with local variables for context. ](https://docs.sentry.io/product/sentry-basics/integrate-frontend/upload-source-maps/)[ ### Breadcrumbs Track events leading to errors for better debugging. ](https://docs.sentry.io/product/error-monitoring/breadcrumbs/)[ ### Frequency Monitor how frequently errors occur to detect trends. ](https://docs.sentry.io/product/issues/#how-to-sort-issues)[ ### User Impact See the user impact of each error. ](https://docs.sentry.io/product/issues/issue-details/)

Sentry’s high-quality tooling helps Disney+ maintain high-quality service to its tens of millions of global subscribers.

Andrew Hay

Director of Streaming Services,

Disney+

[ Read MoreDisney+ testimonial ](https://sentry.io/customers/disney-plus/)

Think about our 150+ developers and multiply that by the number of issues we see across our services and clients - it’s insane the amount of developer time we’ve saved.

Roni Avidov

R&D Team Lead,

Monday.com

[ Read MoreMonday.com testimonial ](https://sentry.io/customers/monday-dot-com/)

## Getting started with Sentry is simple

We support every technology (except the ones we don't).
Get started with just a few lines of code.

Android.NETGoSwiftJavaScriptPythonReactRubyNext.jsPHPLaravelASP.NET CoreSpring BootVueAngularSolidSvelteAstro

Just run this command to sign up for and install Sentry.

Copied!Click to Copy

    brew install getsentry/tools/sentry-wizard && sentry-wizard -i android

Install the **NuGet** package to add the Sentry dependency:

Copied!Click to Copy

    dotnet add package Sentry

Initialize the SDK as early as possible, like in the `Main` method in `Program.cs/Program.fs`:

Copied!Click to Copy

    using (SentrySdk.Init(o => {
      // Tells which project in Sentry to send events to:
      o.Dsn = "https://<key>@sentry.io/<project>";
      // When configuring for the first time, to see what the SDK is doing:
      o.Debug = true;
      // Set TracesSampleRate to 1.0 to capture 100% of transactions for Tracing.
      // We recommend adjusting this value in production.
      o.TracesSampleRate = 1.0; }))
      // App code goes here - Disposing will flush events out

Grab the [Sentry Go SDK](https://github.com/getsentry/sentry-go):

Copied!Click to Copy

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

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

Copied!Click to Copy

    package main

    import (
        "log"
        "time"

        "github.com/getsentry/sentry-go"
    )

    func main() {
        err := sentry.Init(sentry.ClientOptions{
            Dsn: "https://<key>@sentry.io/<project>",
        EnableTracing: true,
            // Specify a fixed sample rate:
            // We recommend adjusting this value in production
            TracesSampleRate: 1.0,
            // Or provide a custom sample rate:
            TracesSampler: sentry.TracesSampler(func(ctx sentry.SamplingContext) float64 {
                // As an example, this does not send some
                // transactions to Sentry based on their name.
                if ctx.Span.Name == "GET /health" {
                    return 0.0

                return 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)

To integrate Sentry into your Xcode project, specify it in your `Podfile`, then run `pod install`:

Copied!Click to Copy

    platform :ios, '9.0'
    use_frameworks! # This is important

    target 'YourApp' do
      pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '<VERSION>'
    end

Initialize the SDK as soon as possible in your application lifecycle, such as in your AppDelegate `application:didFinishLaunchingWithOptions` method:

Copied!Click to Copy

    import Sentry // Make sure you import Sentry

    func application(_ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

        SentrySDK.start { options in
            options.dsn = "https://<key>@sentry.io/<project>"
            options.debug = true // Enabled debug when first installing is always helpful
            // Example uniform sample rate: capture 100% of transactions for Tracing
            options.tracesSampleRate = 1.0

        return true

Grab the [Sentry JavaScript SDK](https://github.com/getsentry/sentry-javascript/):

Copied!Click to Copy

    <script src="https://browser.sentry-cdn.com/<VERSION>/bundle.min.js"></script>

Configure your DSN:

Copied!Click to Copy

    Sentry.init({ dsn: 'https://<key>@sentry.io/<project>',
      // This enables automatic instrumentation (highly recommended),
      // but is not necessary for purely manual usage
      // If you only want to use custom instrumentation:
      // * Remove the BrowserTracing integration
      // * add Sentry.addTracingExtensions() above your Sentry.init() call
      integrations: [Sentry.browserTracingIntegration()],

      // We recommend adjusting this value in production, or using tracesSampler
      // for finer control
      tracesSampleRate: 1.0,

      // Set tracePropagationTargets to control for which URLs distributed tracing should be enabled
      tracePropagationTargets: ['localhost', /^https://yourserver.io/api/],
    });

Grab the [Sentry Python SDK](https://github.com/getsentry/sentry-python):

Copied!Click to Copy

    pip install --upgrade sentry-sdk

Configure your DSN:

Copied!Click to Copy

    import sentry_sdk

    sentry_sdk.init(
        "https://<key>@sentry.io/<project>",

        # Set traces_sample_rate to 1.0 to capture 100%
        # of transactions for Tracing.
        # We recommend adjusting this value in production.
        enable_tracing=True,
        traces_sample_rate=1.0,
    )

Grab the [Sentry React SDK](https://github.com/getsentry/sentry-javascript/):

Copied!Click to Copy

    npm install @sentry/react

We recommend putting the Sentry initialization code into its own file and including that file as the first import in your application entry point as shown in the example below:

Copied!Click to Copy

    import { useEffect } from "react";
    import * as Sentry from "@sentry/react";

    Sentry.init({
      dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
      integrations: [
      ],
      // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled
      tracePropagationTargets: [/^\//, /^https:\/\/yourserver\.io\/api/],
    });

Include the Sentry initialization file as the first import statement:

Copied!Click to Copy

    // 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 />);

Add the `sentry-ruby` gem to your `Gemfile`:

Copied!Click to Copy

    gem "sentry-ruby"

Configure your DSN:

Copied!Click to Copy

    Sentry.init do |config|
      config.dsn = 'https://<key>@sentry.io/<project>'

      # Set a uniform sample rate between 0.0 and 1.0
      # We recommend adjusting the value in production:
      config.traces_sample_rate = 1.0

      # or control sampling dynamically
      config.traces_sampler = lambda do |sampling_context|
        # sampling_context[:transaction_context] contains the information about the transaction
        # sampling_context[:parent_sampled] contains the transaction's parent's sample decision
        true # return value can be a boolean or a float between 0.0 and 1.0
      end
    end

See -- it's really just one command.

Copied!Click to Copy

    npx @sentry/wizard@latest -i nextjs

Install the `sentry/sentry` package with Composer:

Copied!Click to Copy

    composer require sentry/sentry

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

Copied!Click to Copy

    \Sentry\init(['dsn' => 'https://<key>@sentry.io/<project>',
        // Specify a fixed sample rate:
        'traces_sample_rate' => 0.2,
        // Or provide a custom sampler:
        'traces_sampler' => function (SentryTracingSamplingContext $context): float {
            // return a number between 0 and 1
        }, ]);

Install the `sentry/sentry-laravel` package with Composer:

Copied!Click to Copy

    composer require sentry/sentry-laravel

Add Sentry reporting to `bootstrap/app.php`:

Copied!Click to Copy

    <?php

    use Illuminate\Foundation\Application;
    use Illuminate\Foundation\Configuration\Exceptions;
    use Illuminate\Foundation\Configuration\Middleware;
    use Sentry\Laravel\Integration;

    return Application::configure(basePath: dirname(__DIR__))
        ->withRouting(
            web: __DIR__.'/../routes/web.php',
            commands: __DIR__.'/../routes/console.php',
            health: '/up',
        )
        ->withMiddleware(function (Middleware $middleware) {
        })
        ->withExceptions(function (Exceptions $exceptions) {
            Integration::handles($exceptions);
        })->create();

Enable Sentry Tracing in `config/sentry.php`:

Copied!Click to Copy

    // Specify a fixed sample rate:
    'traces_sample_rate' => 0.2,
    // Or provide a custom sampler:
    'traces_sampler' => function (SentryTracingSamplingContext $context): float {
        // return a number between 0 and 1
    },

Run this `Artisan` command to configure the Sentry DSN:

Copied!Click to Copy

    php artisan sentry:publish --dsn=<paste-your-DSN-here>

Add the Sentry dependency:

Copied!Click to Copy

    dotnet add package Sentry.AspNetCore

Configure Sentry in `appsettings.json`.

Copied!Click to Copy

    "Sentry": {
      "Dsn": "https://examplePublicKey@o0.ingest.sentry.io/0",
      "Debug": true,
    },

Then add the SDK by simply calling `UseSentry`:

Copied!Click to Copy

    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webBuilder =>
                // Add the following line:
                webBuilder.UseSentry();
            });

Grab the [Sentry Java SDK](https://github.com/getsentry/sentry-java/):

Copied!Click to Copy

    <dependency>
      <groupId>io.sentry</groupId>
      <artifactId>sentry-spring-boot-starter</artifactId>
      <version><VERSION></version>
    </dependency>

Configure your DSN in `application.properties`:

Copied!Click to Copy

    sentry.dsn=https://<key>@sentry.io/<project>
    # Set traces_sample_rate to 1.0 to capture 100%
    # of transactions for performance monitoring.
    # We recommend adjusting this value in production.
    sentry.traces-sample-rate=1.0

Grab the [Sentry Vue SDK](https://github.com/getsentry/sentry-javascript/):

Copied!Click to Copy

    npm install @sentry/vue

Configure your DSN:

Copied!Click to Copy

    import { createApp } from "vue";
    import * as Sentry from "@sentry/vue";

    const app = createApp({
      // ...
    });

    Sentry.init({
      app,
      dsn: "https://<key>@sentry.io/<project>"",
      // This enables automatic instrumentation (highly recommended),
      // but is not necessary for purely manual usage
      // If you only want to use custom instrumentation:
      // * Remove the BrowserTracing integration
      // * add Sentry.addTracingExtensions() above your Sentry.init() call
      integrations: [Sentry.browserTracingIntegration()],

      // We recommend adjusting this value in production, or using tracesSampler
      // for finer control
      tracesSampleRate: 1.0,
      // Set tracePropagationTargets to control for which URLs distributed tracing should be enabled
      tracePropagationTargets: ['localhost', /^https://yourserver.io/api/],
    });

    app.mount("#app");

Get started with just one line of code:

Copied!Click to Copy

    npx @sentry/wizard@latest -i angular

To use the SDK, initialize Sentry in your Solid entry point index.jsx before you render your Solid app:

Copied!Click to Copy

    // index.jsx / index.tsx

    import * as Sentry from "@sentry/solid";
    import { useBeforeLeave, useLocation } from "@solidjs/router";
    import { render } from "solid-js/web";
    import App from "./app";

    // Initialize the Sentry SDK here
    Sentry.init({
      dsn: "__DSN__",
      integrations: [Sentry.browserTracingIntegration()],

      // Performance Monitoring
      tracesSampleRate: 1.0, //  Capture 100% of the transactions
      // Set 'tracePropagationTargets' to control for which URLs trace propagation should be enabled
      tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
    });

    const app = document.getElementById("app");

    if (!app) throw new Error("No #app element found in the DOM.");

    render(() => <App />, app)

To use the SDK, initialize Sentry in your Svelte entry point main.js before you bootstrap your Svelte app:

Copied!Click to Copy

    // main.js / main.ts

    import App from "./App.svelte";

    import * as Sentry from "@sentry/svelte";
    import { BrowserTracing } from "@sentry/tracing";

    // Initialize the Sentry SDK here
    Sentry.init({
      dsn: "__DSN__",
      release: "my-project-name@2.3.12",
      integrations: [new BrowserTracing()],

      // This enables automatic instrumentation (highly recommended),
      // but is not necessary for purely manual usage
      // If you only want to use custom instrumentation:
      // * Remove the BrowserTracing integration
      // * add Sentry.addTracingExtensions() above your Sentry.init() call
      integrations: [Sentry.browserTracingIntegration()],

      // We recommend adjusting this value in production, or using tracesSampler
      // for finer control
      tracesSampleRate: 1.0,

      // Set tracePropagationTargets to control for which URLs distributed tracing should be enabled
      tracePropagationTargets: ['localhost', /^https://yourserver.io/api/],
    });

    // Then bootstrap your Svelte app
    const app = new App({
      target: document.getElementById("app"),
    });

    export default app;

Just run this command to install and register Sentry's Astro integration.

Copied!Click to Copy

    npx astro add @sentry/astro

And add your DSN and project config to your `astro.config.mjs` file:

Copied!Click to Copy

    import { defineConfig } from "astro/config";
    import sentry from "@sentry/astro";

    export default defineConfig({
      integrations: [
        sentry({
          dsn: "__DSN__",
          sourceMapsUploadOptions: {
            project: "your-project-slug",
            authToken: process.env.SENTRY_AUTH_TOKEN,
          },
          tracesSampleRate: 1.0,
        }),
      ],
    });

That's it. Check out our [documentation](https://sentry.io/platforms) to ensure you have the latest instructions.

[ Create a Sentry Account ](https://sentry.io/signup/) [ See All Platforms ](https://sentry.io/platforms)

## Of course we have more content

[ ### Reproduce Errors Without User Feedback Sentry Breadcrumbs show you the events your app and users took prior to an error. View events like user interactions, API calls, network requests befo... ](https://sentry.io/features/breadcrumbs/)

[ ### Common NextJS errors Whether it’s on the client or server, errors are bound to happen. Checkout how to solve some of the most common Next.js errors. ](https://blog.sentry.io/common-errors-in-next-js-and-how-to-resolve-them/)

[ ### Debugging context Understand the conditions of each error by viewing the associated release, environment, tags and more. ](https://sentry.io/features/context/)

## Get monthly product updates from Sentry

Sign up for our newsletter.

And yes, it really is monthly. Ok, maybe the occasional twice a month, but for sure not like one of those daily ones that you just tune out after a while.

Your Email:

I want to receive the monthly newsletter and other updates from Sentry. You may unsubscribe at any time.

By filling out this form, you agree to our [privacy policy](https://sentry.io/privacy/). This form is protected by reCAPTCHA and Google's [Privacy Policy](https://policies.google.com/privacy) and [Terms of Service](https://policies.google.com/terms) apply.

Subscribe

## Fix It

Get started with the only application monitoring platform that empowers developers to fix application problems without compromising on velocity.

[ Try Sentry for Free ](https://sentry.io/signup/) [ Get a Demo ](https://sentry.io/demo/)