Commit a5d360ca by liimin

fix: 更新Sentry DSN配置并优化Sentry初始化逻辑

更新了.env.example文件中的Sentry DSN配置,并移除了Sentry初始化逻辑中的开发环境检查,确保在生产环境中始终启用Sentry监控。
1 parent d8c12b29
......@@ -16,7 +16,7 @@ NEXT_PUBLIC_MARKETPLACE_API_PREFIX=https://marketplace.dify.ai/api/v1
NEXT_PUBLIC_MARKETPLACE_URL_PREFIX=https://marketplace.dify.ai
# SENTRY
NEXT_PUBLIC_SENTRY_DSN=
NEXT_PUBLIC_SENTRY_DSN=https://90ddfaad2eac44f3b25cd4298ae7af14@sentry.glsx.com.cn/45
# Disable Next.js Telemetry (https://nextjs.org/telemetry)
NEXT_TELEMETRY_DISABLED=1
......
/*
* @Author: liimin 17653212@qq.com
* @Date: 2025-04-16 18:17:34
* @LastEditors: liimin 17653212@qq.com
* @LastEditTime: 2025-05-15 19:04:27
* @FilePath: \ai-assistant\app\components\sentry-initor.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
'use client'
import { useEffect } from 'react'
......@@ -5,18 +13,13 @@ import * as Sentry from '@sentry/react'
const isDevelopment = process.env.NODE_ENV === 'development'
const SentryInit = ({
children,
}: { children: React.ReactNode }) => {
const SentryInit = ({ children }: { children: React.ReactNode }) => {
useEffect(() => {
const SENTRY_DSN = document?.body?.getAttribute('data-public-sentry-dsn')
if (!isDevelopment && SENTRY_DSN) {
if (SENTRY_DSN) {
Sentry.init({
dsn: SENTRY_DSN,
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration(),
],
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
tracesSampleRate: 0.1,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!