もう、エラーの再現に時間を費やす必要はありません。エラー発生時のコード行やユーザーの操作、関数呼び出しの履歴まで詳細に把握。一瞬で原因を特定し、迅速なデバッグを可能にします。
エラーモニタリング
あらゆる言語やフレームワークに対応。エラーの追跡からデバッグ、解決までをスムーズに行えます。詳細なコンテキストから根本原因を素早く特定し、コードの課題解決を強力にバックアップします。
400万人の開発者に選ばれています。
- GitHub
- Disney
- Atlassian
- Linear
- Vercel
- Cloudflare
- Slack
- Metronome
- Autodesk
- Microsoft
- Instacart
- Lyft
- Bolt
- Monday
- Cursor
- Anthropic
- Factory AI
- Sentry
- Baseten
- Runlayer
- Convex
Sentryの導入は簡単です。
あらゆるテクノロジーをサポート。(※サポートしていないもの以外は、ですが)
たった数行のコードで始められます。
サインアップして、たった1行のコードでSentryをインストール:
npx @sentry/wizard@latest -i nextjsSentry Go SDKを取得:
go get "github.com/getsentry/sentry-go"アプリケーションのライフサイクルのできるだけ早い段階で設定を行います:
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,
TracesSampleRate: 1.0,
TracesSampler: sentry.TracesSampler(func(ctx sentry.SamplingContext) float64 {
if ctx.Span.Name == "GET /health" {
return 0.0
}
return 1.0
}),
})
if err != nil {
log.Fatalf("sentry.Init: %s", err)
}
defer sentry.Flush(2 * time.Second)
}サインアップして、たった1行のコードでSentryをインストール:
npx @sentry/wizard@latest -i angularSentryの依存関係を追加:
dotnet add package Sentry.AspNetCoreappsettings.jsonでSentryを設定:
"Sentry": {
"Dsn": "https://examplePublicKey@o0.ingest.sentry.io/0",
"Debug": true,
},UseSentryを呼び出すだけでSDKを追加できます:
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
// 以下の行を追加:
webBuilder.UseSentry();
});以下のコマンドを実行して、SentryのAstroインテグレーションをインストール・登録します:
npx astro add @sentry/astroastro.config.mjsファイルにDSNとプロジェクト設定を追加:
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,
}),
],
});NuGetパッケージをインストールしてSentryの依存関係を追加:
dotnet add package SentryProgram.cs/Program.fsのMainメソッドなど、できるだけ早い段階でSDKを初期化します:
using (SentrySdk.Init(o => {
o.Dsn = "https://<key>@sentry.io/<project>";
o.Debug = true;
o.TracesSampleRate = 1.0; }))
{
// アプリケーションコードをここに記述 - Disposeでイベントがフラッシュされます
}Sentry JavaScript SDKを取得:
<script src="https://browser.sentry-cdn.com/<VERSION>/bundle.min.js"></script>DSNを設定:
Sentry.init({ dsn: 'https://<key>@sentry.io/<project>',
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 1.0,
tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/],
});Composerでsentry/sentry-laravelパッケージをインストール:
composer require sentry/sentry-laravelbootstrap/app.phpにSentryレポートを追加:
<?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(...)
->withMiddleware(function (Middleware $middleware) { })
->withExceptions(function (Exceptions $exceptions) {
Integration::handles($exceptions);
})->create();config/sentry.phpでSentry Tracingを有効化:
'traces_sample_rate' => 0.2,
'traces_sampler' => function (\Sentry\Tracing\SamplingContext $context): float {
// 0から1の間の数値を返す
},以下のArtisanコマンドを実行してSentry DSNを設定:
php artisan sentry:publish --dsn=<paste-your-DSN-here>Composerでsentry/sentryパッケージをインストール:
composer require sentry/sentryアプリケーション起動時のエラーも含めてすべてのエラーをキャプチャするため、Sentry PHP SDKをできるだけ早く初期化します:
\Sentry\init(['dsn' => 'https://<key>@sentry.io/<project>',
'traces_sample_rate' => 0.2,
'traces_sampler' => function (\Sentry\Tracing\SamplingContext $context): float {
// 0から1の間の数値を返す
}, ]);Sentry Python SDKを取得:
pip install --upgrade sentry-sdkDSNを設定:
import sentry_sdk
sentry_sdk.init(
"https://<key>@sentry.io/<project>",
enable_tracing=True,
traces_sample_rate=1.0,
)Sentry React SDKを取得:
npm install @sentry/reactDSNを設定:
import React from "react";
import ReactDOM from "react-dom";
import * as Sentry from "@sentry/react";
import App from "./App";
Sentry.init({
dsn: "https://<key>@sentry.io/<project>",
integrations: [
Sentry.browserTracingIntegration(),
Sentry.reactRouterV6BrowserTracingIntegration({...}),
],
tracesSampleRate: 1.0,
tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/],
});
ReactDOM.render(<App />, document.getElementById("root"));Gemfileにsentry-ruby gemを追加:
gem "sentry-ruby"DSNを設定:
Sentry.init do |config|
config.dsn = 'https://<key>@sentry.io/<project>'
config.traces_sample_rate = 1.0
config.traces_sampler = lambda do |sampling_context|
true
end
endSDKを使用するには、Solidアプリケーションをレンダリングする前に、エントリーポイントindex.jsxでSentryを初期化します:
import * as Sentry from "@sentry/solid";
import { render } from "solid-js/web";
import App from "./app";
Sentry.init({
dsn: "__DSN__",
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 1.0,
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)Sentry Java SDKを取得:
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-spring-boot-starter</artifactId>
<version><VERSION></version>
</dependency>application.propertiesでDSNを設定:
sentry.dsn=https://<key>@sentry.io/<project>
sentry.traces-sample-rate=1.0SDKを使用するには、Svelteアプリケーションを起動する前に、エントリーポイントmain.jsでSentryを初期化します:
import App from "./App.svelte";
import * as Sentry from "@sentry/svelte";
Sentry.init({
dsn: "__DSN__",
release: "my-project-name@2.3.12",
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 1.0,
tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/],
});
const app = new App({ target: document.getElementById("app") });
export default app;SentryをXcodeプロジェクトに統合するには、Podfileに指定してpod installを実行します:
platform :ios, '9.0'
use_frameworks!
target 'YourApp' do
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '<VERSION>'
endアプリケーションのライフサイクルのできるだけ早い段階でSDKを初期化します:
import Sentry
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [...]) -> Bool {
SentrySDK.start { options in
options.dsn = "https://<key>@sentry.io/<project>"
options.debug = true
options.tracesSampleRate = 1.0
}
return true
}Sentry Vue SDKを取得:
npm install @sentry/vueDSNを設定:
import { createApp } from "vue";
import * as Sentry from "@sentry/vue";
const app = createApp({ });
Sentry.init({
app,
dsn: "https://<key>@sentry.io/<project>",
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 1.0,
tracePropagationTargets: ['localhost', /^https:\/\/yourserver\.io\/api/],
});
app.mount("#app");サインアップして、たった1行のコードでSentryをインストール:
brew install getsentry/tools/sentry-wizard && sentry-wizard -i android一番驚いたのは、もしSentryがなかったら、このバグに何ヶ月も気づかず放置していただろうということです。
自分では気づけないような些細な問題を数多く修正できるので、結果としてUXの向上に直結するんだな、と実感し始めています。
@getsentry のイシューで見れる詳細情報、マジでヤバすぎる。
- ブラウザ情報
- 特定のコード行への参照
- バックエンドまで追跡可能なトレース情報
これ、セッションリプレイなしでこの情報量だからね。凄すぎる!
個人サイトの @getsentry 連携、やっと直した!もっと早くやればよかった…これめちゃくちゃ便利。感動してる。