简体   繁体   English

“异常成功发送到服务器”事件

[英]"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.EmptySentryId部分将告诉您一个事件是否已排队等待提交。 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.

相关问题 SignalR使用Chrome上的服务器发送事件 - SignalR using server-sent event on Chrome C#ASP服务器发送事件的问题 - Problems with C# ASP server sent event 如何为服务器发送的事件添加重试事件? - How to add retry event for server sent events? C# winform捕获服务器如何发送事件 - C# How a winform capture server sent event 在将数据发送到服务器之前捕获任何触发回发的事件并触发一个事件 - Capturing ANY event that triggers a postback and firing an event before the data is sent to the server 在 System.Threading.Timers TimerCallback 事件处理程序中捕获异常,然后重新抛出未发送回主线程 - Exception caught in System.Threading.Timers TimerCallback event handler and then re-thrown not sent back to main thread Outlook中“已发送邮件”上的事件 - Event on “Item Sent” in Outlook VSTO邮件发送事件 - VSTO mail sent event C#,UserPrincipal.FindByIdentity始终抛出异常:“服务器发送了引荐来源”或未知0x80005000 - C#, UserPrincipal.FindByIdentity always throw exception: “Server sent a referer” or unknown 0x80005000 我可以从多个异步任务写入同一服务器发送的事件 stream 吗? - Can I write to the same server sent event stream from multiple async tasks?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM