[英]"Exception succesfully sent to server" event
I'm trying to understand if there's a way to know if a notification is correctly sent to the Sentry cloud.我试图了解是否有办法知道通知是否正确发送到 Sentry 云。 The reason is to show to the user the feedback.
原因是向用户显示反馈。
I'm using this instruction:我正在使用这个指令:
SentryId id = SentrySdk.CaptureException(ex);
and I don't see any exception or notification fired if the notification is sent or not (eg: no internet connection) to the cloud.如果通知是否发送到云(例如:没有互联网连接),我没有看到任何异常或通知被触发。
if it fails id
will be equal to Guid.Empty
.如果失败
id
将等于Guid.Empty
。 If it succeeded it will have a non-empty Guid
.如果成功,它将有一个非空的
Guid
。 SentryId
is a thin wrapper struct around Guid
and has an implicit operator to Guid
. SentryId
是围绕一个瘦包装结构Guid
并且具有一个隐含的操作者Guid
。
As for logging.至于日志。 Sentry has the concept of a Diagnostic Logger that should allow you to capture more detail on those failures
Sentry 具有诊断记录器的概念,可以让您捕获有关这些故障的更多详细信息
To add to Simon's answer: That Guid.Empty
vs SentryId
part will tell you an event was queued for submission or not.添加到西蒙的答案:
Guid.Empty
与SentryId
部分将告诉您一个事件是否已排队等待提交。 That means, if the SDK wasn't initialized, the event was dropped by your BeforeSend
hook, or the queue was full, for example, you'd get back Guid.Empty
.这意味着,如果 SDK 未初始化、事件被您的
BeforeSend
挂钩丢弃,或者队列已满,例如,您将返回Guid.Empty
。
If the SDK was correctly initialized and the event was queued for background submission, you'll get back that event's Id.如果 SDK 已正确初始化并且事件已排队等待后台提交,您将获得该事件的 Id。
Now, it's possible the event is dropped at a later point, for example due to rate limiting, out of quota, etc. It's also possible the event was received by Sentry but then dropped due to an inbound filter configured on the server or the issue of which that event groups to was marked as "discard and ignore".现在,事件可能会在稍后被丢弃,例如由于速率限制、配额不足等。也可能事件被 Sentry 接收,但由于服务器上配置的入站过滤器或问题而被丢弃其中该事件组被标记为“丢弃并忽略”。 So there's no one way in the SDK to know if for sure "the event should be in the dashboard" and if for some reason it's not, and you expect it to be, as @Simon suggested, it's best to start with the SDK diagnostic logging to check if the event is making its way through to the server in the first place.
因此,SDK 中没有一种方法可以确定“事件应该在仪表板中”,如果由于某种原因它不是,并且您希望它是,正如@Simon 建议的那样,最好从 SDK 诊断开始日志记录以检查事件是否首先到达服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.