【问题标题】:How can I make sure sentry is capturing my exception?如何确保哨兵正在捕获我的异常?
【发布时间】:2019-11-12 09:06:50
【问题描述】:

我在一个新的 laravel 项目中实现了哨兵。发送测试异常似乎可以正常工作:

root@d816d48eed86:/app# php artisan sentry:test
[sentry] Client DSN discovered!
[sentry] Generating test event
[sentry] Sending test event
[sentry] Event sent with ID: d88ff2add86342989da27a8c75ec0562

我还可以看到哨兵网络服务器收到了它:

sentry_1     | 10.10.65.1 - - [12/Nov/2019:09:05:12 +0000] "POST /api/35/store/ HTTP/1.0" 200 366 "-" "sentry.php.laravel/1.4.1"

但是,异常永远不会出现在哨兵中。

我正在使用sentry/sentry-laravel v1.4.1 包。

如何调试?

【问题讨论】:

  • 您的意思是:test artisan 命令抛出的异常,没有显示在 Sentry 仪表板中?
  • 没错。
  • 我想我现在遇到了同样的问题。你在码头托管哨兵吗?我有一种预感,即哨兵的 DSN 解析器不接受 docker 的 sentry_1 作为有效主机名。当我设置具有完整主机名的代理时,例如sentry.example.com 然后就可以了。

标签: laravel sentry


【解决方案1】:

事实证明,仅仅启动一个哨兵容器是不够的。您还必须启动运行 cron 和工作容器的容器:

  sentry:
    image: sentry:9
    restart: unless-stopped
    environment:
      <<: *sentry-config
    links:
      - postgres
      - memcached
      - redis
    ports:
      - "9000"
  cron:
    image: sentry:9
    links:
     - redis
     - postgres
    command: "sentry run cron"
    environment:
      <<: *sentry-config
  worker:
    image: sentry
    links:
     - redis
     - postgres
    command: "sentry run worker"
    environment:
      <<: *sentry-config
    postgres:
    image: postgres:11
    restart: unless-stopped
    environment:
      - POSTGRES_USER=sentry
      - POSTGRES_DB=sentry
      - POSTGRES_PASSWORD=sentry
  redis:
    image: redis:5-alpine
    restart: unless-stopped
  memcached:
    image: memcached:1.5-alpine
    restart: unless-stopped

【讨论】:

    猜你喜欢
    • 2019-03-17
    • 2016-10-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-16
    相关资源
    最近更新 更多