标签: sentry

Sentry 请检查您的 DSN 是否在您的配置或 .env 中正确设置为“SENTRY_LARAVEL_DSN”

我已经在 Laravel 项目上安装了 Sentry,但无法运行它,每当我运行命令时,php artisan sentry:test结果是:

[Sentry] DSN discovered!
[Sentry] Generating test Event
[Sentry] Sending test Event
[Sentry] There was an error sending the test event.
[Sentry] Please check if your DSN is set properly in your config or `.env` as `SENTRY_LARAVEL_DSN`.


Run Code Online (Sandbox Code Playgroud)

但我已在 .env 文件中添加了 DSN

php exception sentry laravel

7
推荐指数
1
解决办法
3045
查看次数

如何通过 Quasar.js 使用 Sentry 应用程序监控

我将哨兵监控添加到我的类星体应用程序中,但哨兵没有收到任何错误,也没有显示在其面板中

我创建/src/boot/sentry.js并编写了这些代码:

import { boot } from "quasar/wrappers";
import * as Sentry from "@sentry/vue";
import { BrowserTracing } from "@sentry/tracing";

export default boot(({ app, router }) => {
  Sentry.init({
    app,
    dsn: "<my sentry dns>",
    integrations: [
      new BrowserTracing({
        routingInstrumentation: Sentry.vueRouterInstrumentation(router),
        tracingOrigins: ["localhost", "my-site-url.com", regex],
      }),
    ],

    trackComponents: true,
    tracesSampleRate: 1.0,
  });
});
Run Code Online (Sandbox Code Playgroud)

我的 Quasar 应用程序是 ssr。我应该如何修复它?

sentry vue.js quasar-framework vuejs3

7
推荐指数
1
解决办法
1556
查看次数

Sentry 通过 VueJS3 在 localhost 中获取 CORS 错误

我使用 http://localhost:3000 来开发我的网站,但我总是从 Sentry 收到 CROS 错误,我错过了什么?

在Sentry的设置中:我已将项目的允许域设置为*,但它看起来不起作用......

从源“http://localhost:3000”获取“my-sentry-dsn”的访问已被 CORS 策略阻止:请求的资源上不存在“Access-Control-Allow-Origin”标头。如果不透明响应满足您的需求,请将请求模式设置为“no-cors”以在禁用 CORS 的情况下获取资源。

Vue3+Vite

yarn add @sentry/tracing @sentry/vue
Run Code Online (Sandbox Code Playgroud)

在 main.ts 中

import * as Sentry from "@sentry/vue"
import { Integrations } from "@sentry/tracing"
const app = createApp(App)
// Initialize Sentry
const dsnSentry = import.meta.env.VITE_SENTRY_DSN as string
if (!!dsnSentry) {
  const env = import.meta.env.VITE_ENV
  const isDebug = env !== "production"
  Sentry.init({
    app,
    dsn: dsnSentry,
    // integrations: [new Integrations.BrowserTracing()],
    integrations: [
      new Integrations.BrowserTracing({
        routingInstrumentation: Sentry.vueRouterInstrumentation(router),
        tracingOrigins: ["localhost:3000", /^\//],
      }),
    ],
    tracesSampleRate: 1.0, …
Run Code Online (Sandbox Code Playgroud)

sentry vuejs3 vite

7
推荐指数
1
解决办法
6440
查看次数

python 应用程序的 Sentry sdk 自定义性能集成

Sentry 可以跟踪 celery 任务和 API 端点的性能 https://docs.sentry.io/product/performance/

我有一个由老太婆吃午饭的自定义脚本,并执行一组类似的任务

我想将sentry_sdk合并到我的脚本中以获取任务的性能跟踪

任何建议如何使用 https://getsentry.github.io/sentry-python/api.html#sentry_sdk.capture_event

python performance sentry

7
推荐指数
1
解决办法
732
查看次数

无法从芹菜任务向Sentry发送日志消息

我在芹菜任务中记录到Sentry有问题.任务中的错误很好.但是,当我尝试手动记录事件时,它会记录到芹菜日志中,但不会记录到哨兵服务器上.

我正在使用的代码是:

@task
def myWorker():
  logger = logging.getLogger('celery.task')
  logger.addHandler(SentryHandler())
  logger.warn("Some condition happened", exc_info=True, extra={ 'extra': 'data' })
Run Code Online (Sandbox Code Playgroud)

我在这里和网上发现了一些帖子,但它们似乎都已经过时了

python logging celery sentry raven

6
推荐指数
0
解决办法
346
查看次数

Sentry django配置 - 记录器

我正在尝试使用简单的日志记录,并希望向Sentry发送错误/异常.

我根据文档配置了Sentry并在我的dev(python manage.py raven test)上成功运行测试

我将Sentry文档中的Logging配置添加到Django设置中

当我将此代码放入我的视图中时,它根本不起作用

import logging
logger = logging.getLogger(__name__)
logger.error('There was an error, with a stacktrace!', extra={
    'stack': True,
})
Run Code Online (Sandbox Code Playgroud)

也许我错过了什么

谢谢您的帮助

LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'root': {
        'level': 'WARNING',
        'handlers': ['sentry'],
    },
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s '
                      '%(process)d %(thread)d %(message)s'
        },
    },
    'handlers': {
        'sentry': {
            'level': 'ERROR', # To capture more than ERROR, change to WARNING, INFO, etc.
            'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
            'tags': {'custom-tag': 'x'},
        }, …
Run Code Online (Sandbox Code Playgroud)

python django logging sentry

6
推荐指数
1
解决办法
2924
查看次数

Python:如何测试我的错误是否已记录在哨兵上?

我已经将我的 python 默认记录器与 raven 集成。现在我的错误记录在 sentry.io/my_app 上。但是我想问一下有没有什么方法可以为这个函数编写单元测试,它会产生一个错误,然后以某种方式确认这个错误在哨兵上存在。

python logging sentry raven

6
推荐指数
1
解决办法
669
查看次数

如何将 Docker 日志连接到 Sentry 服务

是否存在我连接docker logs到哨兵服务的情况?

例如,当 docker 由于一些意外问题而停止时,我可以在哨兵 Web 面板中看到它的日志。

logging sentry docker

6
推荐指数
0
解决办法
1155
查看次数

设置 Sentry.io 时出现问题。没有发送到哨兵面板

我打算将 Sentry 用于我正在处理的 Android 项目。我的公司正在使用自托管的 Sentry,版本 9.0.0

我遵循了Sentry.io 安装指南

这些权限已添加到清单中:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Run Code Online (Sandbox Code Playgroud)

这是我的app/build.gradle文件:

dependencies {
    ...
    implementation 'io.sentry:sentry-android:1.7.10'
    implementation 'org.slf4j:slf4j-nop:1.7.25'
}

apply plugin: 'io.sentry.android.gradle'

sentry {
    autoProguardConfig true
    autoUpload true
}
Run Code Online (Sandbox Code Playgroud)

这是我的顶级项目build.gradle

dependencies {
    ...
    classpath 'io.sentry:sentry-android-gradle-plugin:1.7.10'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
Run Code Online (Sandbox Code Playgroud)

这是主要活动:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Context ctx = this.getApplicationContext();
    String sentryDsn …
Run Code Online (Sandbox Code Playgroud)

android sentry

6
推荐指数
1
解决办法
1242
查看次数

无法生成签名的 Apk - 需要组织 slug(提供 --org)

设置Sentry.io错误跟踪后,当我尝试生成签名 Apk时收到此错误:

Java Compiler
error: An organization slug is required (provide with --org)
Run Code Online (Sandbox Code Playgroud)

单击此图像并将其打开以查看更多详细信息: 错误

我无法理解这一点:

Process 'command
'/var/folders/j4/_fzm1rks3tsc2h3j4l2qbq4w0000gn/T/.sentry-cli1369818638611304938.exe'
' finished with non-zero exit value 1
Run Code Online (Sandbox Code Playgroud)

这是错误引发的文件地址: 地址错误

如何解决此问题并生成签名的 Apk?

android minify slug sentry signed-apk

6
推荐指数
2
解决办法
2328
查看次数