mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-10 06:45:28 -05:00
<!-- Clearly explain the need for these changes: --> We want to be able to filter errors according to where they occur in sentry so we need to track and include that data. We also are not logging everything from app services correctly so fix that up ### Changes 🏗️ <!-- Concisely describe all of the changes made in this pull request: --> - Adds env tracking for frontend - adds sentry init in app service spawn ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: <!-- Put your test plan here: --> - [x] Tested by running and making sure all events + logs are inserted into sentry correctly
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
// This file configures the initialization of Sentry on the server.
|
|
// The config you add here will be used whenever the server handles a request.
|
|
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
|
|
|
|
import { getEnvironmentStr } from "@/lib/utils";
|
|
import * as Sentry from "@sentry/nextjs";
|
|
// import { NodeProfilingIntegration } from "@sentry/profiling-node";
|
|
|
|
Sentry.init({
|
|
dsn: "https://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288",
|
|
|
|
enabled: process.env.NODE_ENV !== "development",
|
|
environment: getEnvironmentStr(),
|
|
|
|
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
|
|
tracesSampleRate: 1,
|
|
tracePropagationTargets: [
|
|
"localhost",
|
|
"localhost:8006",
|
|
/^https:\/\/dev\-builder\.agpt\.co\/api/,
|
|
/^https:\/\/.*\.agpt\.co\/api/,
|
|
],
|
|
|
|
// Setting this option to true will print useful information to the console while you're setting up Sentry.
|
|
debug: false,
|
|
|
|
// Integrations
|
|
integrations: [
|
|
Sentry.anrIntegration(),
|
|
// NodeProfilingIntegration,
|
|
// Sentry.fsIntegration(),
|
|
],
|
|
|
|
_experiments: {
|
|
// Enable logs to be sent to Sentry.
|
|
enableLogs: true,
|
|
},
|
|
});
|