java - 在 Java 中进行了 Sentry 集成,如下所示。在 Sentry 仪表板上没有收到单个事件。可能是什么原因?
问题描述
Sentry.init("https://a96e4f7079404e12823024df8367d521@o443980.ingest.sentry.io/5418440");
sentry = SentryClientFactory.sentryClient();
logWithStaticAPI();
static void logWithStaticAPI() {
// Note that all fields set on the context are optional. Context data is copied onto
// all future events in the current context (until the context is cleared).
// Record a breadcrumb in the current context. By default the last 100 breadcrumbs are kept.
Sentry.getContext().recordBreadcrumb(
new BreadcrumbBuilder().setMessage("User made an action").build()
);
// Set the user in the current context.
Sentry.getContext().setUser(
new UserBuilder().setEmail("hello@sentry.io").build()
);
// Add extra data to future events in this context.
Sentry.getContext().addExtra("extra", "thing");
// Add an additional tag to future events in this context.
Sentry.getContext().addTag("tagName", "tagValue");
/*
This sends a simple event to Sentry using the statically stored instance
that was created in the ``main`` method.
*/
Sentry.capture("This is a test");
try {
unsafeMethod();
} catch (Exception e) {
// This sends an exception event to Sentry using the statically stored instance
// that was created in the ``main`` method.
Sentry.capture(e);
}
}
解决方案
回答我自己的问题。它实际上在一天左右后开始工作。所以整合后要耐心等待。
推荐阅读
- java - 无法识别此代码的语法(哪个是类,哪个是方法)?
- google-apps-script - 谷歌表格脚本按日期隐藏列
- php - 根据 Laravel 中的路由名称返回回调
- python - 如何根据文件名组合/附加PDF?
- php - 即使为空,数组也充满了空白值
- mysql - eZ平台本地安装无法连接MySQL数据库
- amazon-s3 - Cloud Storage 客户访问最佳做法
- amazon-web-services - AWS 节点的 Docker 上是否有时间同步过程?
- python - pdoc 生成的 HTML 中的方法参数格式不正确
- go - 如何在 EC2 实例的 2 个端口上运行简单的 Go 服务器?