标签: sentry

在 Django 中排除某些 URL 以进行 Sentry 性能跟踪

我有一个 Django 应用程序,其运行状况检查端点使用django-health-check

url_patterns我添加了以下行:

  url(r'^ht/', include('health_check.urls')),
Run Code Online (Sandbox Code Playgroud)

问题在于健康检查正在满足所有 Sentry 事务限制。

如何排除 Sentry 中的健康检查端点?

django sentry

2
推荐指数
1
解决办法
1699
查看次数

如何在同一个webapp中运行Sentry客户端和服务器会影响性能?

我正在考虑为我的Django项目设置Sentry,但我想知道是否要将Sentry服务器与我的主webapp一起安装,或者在单独的Web实例中安装.

我可以想到让Sentry在同一个webapp中的好处是:

  • 易于设置和维护(一个webapp而不是两个,不需要安装eventlet等)
  • 易于管理员使用(例如使用与webapp管理员相同的帐户登录Sentry)

Sentry文档在这里这里建议,在同一个webapp中运行它会降低webapp服务质量,但具体如何?

  • 如果没有错误发生,Sentry会减慢webapp的速度吗?
  • 如果发生许多错误(例如,每分钟10次),webapp会变得非常慢吗?

django sentry

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

带有第 3 方附加程序的 log4j2

我正在尝试在 Java 应用程序(这是一个 Web API)中设置一些第三方 appender - appender 是作为依赖项添加的库。这是一个 Maven 应用程序,这些库是 Raven(通过 Sentry)和 Logentries。他们接受日志并提供图形用户界面来查看它们。

本地工作正常 - 当整个应用程序在本地运行时,日志成功显示在 Logentries 和 Sentry 中。在两种环境中都成功找到并解析了配置。我log4j2.xml在为两种环境启动服务器时的配置和输出包含在下面。

在登台环境中,我看到日志说 CLASS_NOT_FOUND,所以这可能是一个类路径问题?有任何想法吗?

配置

<?xml version="1.0" encoding="utf-8"?>
<configuration status="all">
    <properties>
        <property name="pattern">%d{hh:mm:ss.sss} [mode=${env:MODE}] [%t] %-5level %logger{36} - %msg%n</property>
    </properties>
    <appenders>
        <console name="console" target="system_out">
            <patternlayout pattern="${pattern}"/>
        </console>
        <raven name="sentry">
            <dsn>[dsn_here]</dsn>
            <patternlayout pattern="${pattern}"/>
            <!--to turn down the noise-->
            <!--<ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>-->
        </raven>
        <logentries name="le">
            <token>[token_here]</token>
            <patternlayout pattern="${pattern}"/>
            <!--to turn down the noise-->
            <!--<ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>-->
        </logentries>
    </appenders> …
Run Code Online (Sandbox Code Playgroud)

java sentry logentries log4j2

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

基数为 10 的 int() 的无效文字:'

我最近在我的项目中添加了用于错误跟踪的哨兵,并根据此处的文档配置了 raven,但出现如下所示的错误。

设置.py

import raven


INSTALLED_APPS = [    
    # 3rd party app
    'raven.contrib.django.raven_compat',
]    

RAVEN_CONFIG = {
    'dsn': 'https://*****@sentry.io/224093',
    'release': raven.fetch_git_sha(os.path.dirname(os.pardir)),
}
Run Code Online (Sandbox Code Playgroud)

错误日志

System check identified no issues (0 silenced).
October 02, 2017 - 11:31:58
Django version 1.10, using settings 'FoodCham.settings.development'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Sending message of length 2240 to https://sentry.io/api/224093/store/
Internal Server Error: /
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", …
Run Code Online (Sandbox Code Playgroud)

django python-2.7 sentry raven django-logging

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

将错误报告发送到Laravel队列中的哨兵

我在Laravel项目中设置了Sentry.io。我也在使用队列。

我想知道是否可以将失败的队列发送到Sentry?因为它们在失败时不会自动发送。

php sentry laravel laravel-5 laravel-queue

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

Rspec测试Sentry的Raven capture_exception

假设我有这段代码...

  Raven.capture_exception(error, {
    extra: {
      error_message: message
    }
  })
end
Run Code Online (Sandbox Code Playgroud)

我已经尝试使用expect(Raven).to receive(:capture_exception).with(...),无论如何切片,我似乎都无法将期望绑定到Raven,因此可以验证它是否已发送日志通信。它一直告诉我capture_exception没有定义。我都尝试过expect并且expect_any_instance_of没有运气。现在,我已经跳过了,但是我知道有办法。有什么想法吗?

ruby rspec ruby-on-rails sentry

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

从 IBM Cloud Functions 调用时,PHP SDK 不会向 Sentry 发送错误

我正在使用无服务器框架将 PHP 代码部署为 IBM Cloud Function。

以下是操作 PHP 文件中的代码:

function main($args): array {

    Sentry\init(['dsn' => 'SENTRY_DSN' ]);

    try {
        throw new \Exception('Some error')
    } catch (\Throwable $exception) {
        Sentry\captureException($exception);
    }
}
Run Code Online (Sandbox Code Playgroud)

这是 serverless.yml 文件:

service: cloudfunc

provider:
  name: openwhisk
  runtime: php

package:
  individually: true
  exclude:
    - "**"
  include:
    - "vendor/**"

functions:
    test-sentry:
    handler: actions/test-sentry.main
    annotations:
        raw-http: true
    events:
        - http:
            path: /test-sentry
            method: post
            resp: http
    package:
        include:
        - actions/test-sentry.php

plugins:
  - serverless-openwhisk
Run Code Online (Sandbox Code Playgroud)

当我从本地环境(NGINX/PHP Docker 容器)测试操作处理程序时,错误将被发送到 Sentry。

但是,当我尝试从 IBM Cloud …

php sentry serverless-framework openwhisk ibm-cloud

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

在 gitlab ci 中验证 docker 内的sentry-cli

我想在我的 docker 镜像中运行sentry-cli,如下所示:

sentry-frontend:
  stage: sentry
  services:
    - docker:18-dind
  before_script:
    - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" registry.xxx.xx
  script:
    - export SENTRY_AUTH_TOKEN=xxxxxxxxxxxxxxxxxx
    - export IMAGE=$CI_REGISTRY_IMAGE/frontend-builder:$CI_COMMIT_REF_NAME
    - export RELEASE_VERSION=$CI_COMMIT_REF_NAME
    - docker pull getsentry/sentry-cli
    - docker run --rm -v $(pwd):/work getsentry/sentry-cli releases -o org -p frontend new $RELEASE_VERSION

  tags:
    - dind
Run Code Online (Sandbox Code Playgroud)

然而工作失败了,因为

error: API request failed caused by: sentry reported an error: Authentication credentials were not provided. (http status: 401)

我试过:

- docker run --rm -v $(pwd):/work getsentry/sentry-cli --auth-token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

但是之后我收到了与跑步时相同的消息

docker …

sentry gitlab docker gitlab-ci gitlab-ci-runner

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

Sentry 错误日志记录在 React Native 应用程序中未按预期工作

也许我误解了目的。我正在寻找一种解决方案来替换我的应用程序中的 console.log(errors),因为我已准备好进行生产。我完成了将 Sentry 功能添加到我的 expo 托管工作流程项目中的步骤。它似乎工作,它连接,它运行 Sentry.init() 很好。但是,当我尝试使用 Sentry.captureException('some exception') 代替 console.log 时,应用程序崩溃,并且我得到“Sentry.captureException 不是函数”。它在我的哨兵控制台中记录了该错误。所以错误正在传递到我的哨兵项目。但从我关注的文档来看,Sentry.captureException 应该是一个有效的函数?我缺少什么?我也尝试过 Sentry.captureMessage ,结果相同。

应用程序.js

import * as Sentry from 'sentry-expo';

Sentry.init({
  dsn: 'xxxx',
  enableInExpoDevelopment: true,
  debug: true, // Sentry will try to print out useful debugging information if something goes wrong with sending an event. Set this to `false` in production.
});

enableScreens();

export default function App() {
  return (
    <NavigationContainer>
      <AuthNavigator />
    </NavigationContainer>
  )
}
Run Code Online (Sandbox Code Playgroud)

app.json 博览会挂钩

"hooks": {
      "postPublish": [
        {
          "file": "sentry-expo/upload-sourcemaps",
          "config": …
Run Code Online (Sandbox Code Playgroud)

sentry expo

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

如何从 Symfony 中的 Sentry 中排除异常?

我安装了 Symfony 4.3 并将其升级到 4.4.19。在我的旧安装中,Sentry 与 exclude_exception 运行良好。我像这样使用它sentry.yaml

sentry:
    dsn: "https://key@sentry.io/id"
    options:
        excluded_exceptions:
            - App\Exception\BadArgumentException
            - App\Exception\BadFilterException
            - App\Exception\BadRequestException
Run Code Online (Sandbox Code Playgroud)

但是当我升级到 4.4.19 时,symfony 日志告诉我excluded_exceptions不存在。Sentry 在我的项目中获取每个异常。它运行良好,所以我不明白为什么它不能识别此选项。(我已经看到它被添加到 v2.1 的哨兵中)。

我试过做一个,composer update sentry/sentry-symfony但没有任何改变。在我的composer.json 上,我有这个需要部分: "sentry/sentry": "^3.1", "sentry/sentry-symfony": "^4.0",

所以我现在不知道该怎么做才能解决这个问题。也许我必须忘记一些事情。

php symfony sentry symfony4

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