Sentry(v20.12.1) K8S 雲原生架構探索, SENTRY FOR JAVASCRIPT 手動捕獲事件基本用法

itread01 2021-01-14 17:05:00
k8s Sentry 原生 v20.12.1 20.12.1


![](https://img2020.cnblogs.com/blog/436453/202101/436453-20210114131158902-1942894314.png)## 系列1. [Sentry-Go SDK 中文實踐指南](https://mp.weixin.qq.com/s/MLqRSh7D0YZzCKfG5xvsZw)2. [一起來刷 Sentry For Go 官方文件之 Enriching Events](https://mp.weixin.qq.com/s/0Ke1gozUyUVny4-7B2mw0w)3. [Snuba:Sentry 新的搜尋基礎設施(基於 ClickHouse 之上)](https://mp.weixin.qq.com/s/RKaBfEh8Dlgt_iuHt10OPg)4. [Sentry 10 K8S 雲原生架構探索,Vue App 1 分鐘快速接入](https://mp.weixin.qq.com/s/Rwwz4MJytA7va8zE8A5Y0w)5. [Sentry(v20.12.1) K8S雲原生架構探索,玩轉前/後端監控與事件日誌大資料分析,高效能高可用+可擴充套件可伸縮叢集部署](https://mp.weixin.qq.com/s/5xYtkzNx31dLsCAhoMPGrQ)6. [Sentry(v20.12.1) K8S 雲原生架構探索,Sentry JavaScript SDK 三種安裝載入方式](https://mp.weixin.qq.com/s/EV9M3Ru5rK5atAjTl1D9PA)7. [Sentry(v20.12.1) K8S 雲原生架構探索,SENTRY FOR JAVASCRIPT SDK 配置詳解](https://mp.weixin.qq.com/s/dlaejrn1kWBPiUJSmrzwow)## 基本用法Sentry 的 SDK 掛接到您的執行時環境中,並自動報告錯誤(`errors`)、異常(`exceptions`)和拒絕(`rejections`)。關鍵術語:* event 是向 Sentry 傳送資料的一個例項。通常,該資料是一個錯誤(`error`)或異常(`exception`)。* issue 是一組類似事件。* 事件的報告稱為 capturing。捕獲事件後,會將其傳送給 Sentry。最常見的捕獲形式是捕獲錯誤(`capture errors`)。可以捕獲的錯誤因平臺而異。通常,如果您有一些看起來像異常(`exception`)的東西,它可以被捕獲。對於某些 SDK,還可以省略 `capture_exception` 的引數,Sentry 將嘗試捕獲當前異常。對於向 Sentry 手動報告錯誤或訊息也很有用。在捕獲事件時,您還可以記錄導致該事件的麵包屑(`breadcrumbs`)。麵包屑與事件不同:它們不會在 Sentry 中建立事件,但會在傳送下一個事件之前被緩衝。在我們的 Breadcrumbs documentation 中瞭解更多關於麵包屑的資訊。### 捕獲錯誤在 JavaScript 中,您可以將錯誤物件傳遞給 `captureException()`,以將其捕獲為事件。可以將字串作為錯誤丟擲,在這種情況下無法記錄回溯。```jstry { aFunctionThatMightFail();} catch (err) { Sentry.captureException(err);}```### 捕獲裸訊息另一個常見操作是捕獲裸訊息(`bare message`)。訊息是應該傳送給 Sentry 的文字資訊。通常情況下,訊息不會發出,但它們對某些團隊可能很有用。```jsSentry.captureMessage("Something went wrong");```### 設定事件級別level — 類似於日誌級別 — 通常是根據整合(`integration`)預設新增的。您還可以在事件中重寫它。要在 scope 外設定 level,你可以呼叫 `captureMessage()` 每個事件:```jsSentry.captureMessage("this is a debug message", "debug");```要在作用域(scope)中設定級別,你可以呼叫 `setLevel()`:```jsSentry.configureScope(function(scope) { scope.setLevel(Sentry.Severity.Warning);});```或者每個事件:```jsSentry.withScope(function(scope) { scope.setLevel("info"); Sentry.captureException("info");});```中文文件陸續同步到:* https://getsentry.hacker-linner.com```我是為少。微信:uuhells123。公眾號:黑客下午茶。謝謝點贊支援
版权声明
本文为[itread01]所创,转载请带上原文链接,感谢
https://www.itread01.com/content/1610611562.html

  1. Rocketmq CPP client visual studio 2019 compilation
  2. Usage of data custom attribute in jquery
  3. Common decompression in Linux
  4. Upload large files in Java
  5. Sentry (v20.12.1) k8s cloud native architecture exploration, sentry for JavaScript manual capture event basic usage
  6. Sentry (v20.12.1) k8s cloud native architecture exploration, sentry for JavaScript manual capture event basic usage
  7. Docker + MySQL Cluster + read / write separation + MYCAT Management + vertical sub database + load balancing
  8. Docker + MySQL Cluster + read / write separation + MYCAT Management + vertical sub database + load balancing
  9. Java use interceptor infinite forwarding / redirection infinite loop / redirection times too many error (stack overflow error) solution
  10. Java use interceptor infinite forwarding / redirection infinite loop / redirection times too many error (stack overflow error) solution
  11. 010_ MySQL
  12. 010_ MySQL
  13. Fast integration of imsdk and Huawei offline push
  14. 消息队列之RabbitMQ
  15. Rabbitmq of message queue
  16. 初学java进制转换方面补充学习
  17. Learn java base conversion supplementary learning
  18. 了解一下RPC,为何诞生RPC,和HTTP有什么不同?
  19. 了解一下RPC,为何诞生RPC,和HTTP有什么不同?
  20. 初学java进制转换方面补充学习
  21. Learn about RPC, why RPC was born, and what's the difference between RPC and HTTP?
  22. Learn about RPC, why RPC was born, and what's the difference between RPC and HTTP?
  23. Learn java base conversion supplementary learning
  24. JDBC测试连接数据库
  25. JDBC test connection database
  26. 大厂面试官竟然这么爱问Kafka,一连八个Kafka问题把我问蒙了?
  27. The interviewers of big factories love to ask Kafka so much. I'm blinded by eight Kafka questions in a row?
  28. 安卓开发和java开发有什么区别!2021年BATJ30套大厂Android经典高频面试题,面试必问
  29. Spring Security OAuth2.0認證授權四:分散式系統認證授權
  30. What's the difference between Android development and java development! 2021 batj30 Android classic high frequency interview questions
  31. Spring security oauth2.0 authentication and authorization 4: distributed system authentication and authorization
  32. Java微服务 vs Go微服务,究竟谁更强!?
  33. 大厂面试官竟然这么爱问Kafka,一连八个Kafka问题把我问蒙了?
  34. Who is stronger, Java microservice vs go microservice!?
  35. Java微服务 vs Go微服务,究竟谁更强!?
  36. The interviewers of big factories love to ask Kafka so much. I'm blinded by eight Kafka questions in a row?
  37. Who is stronger, Java microservice vs go microservice!?
  38. springboot异常处理之404
  39. Spring boot exception handling 404
  40. Spring Boot Security 国际化 多语言 i18n 趟过巨坑
  41. springboot异常处理之404
  42. Spring boot security international multilingual I18N
  43. Spring boot exception handling 404
  44. Netty系列化之Google Protobuf编解码
  45. Netty之编解码
  46. Java编解码
  47. Netty解码器
  48. Netty与TCP粘包拆包
  49. Netty开发入门
  50. Java集合遍历时遇到的坑
  51. Spring IOC 源码解析(下)
  52. Spring IoC源码解析(上)
  53. Google protobuf codec of netty serialization
  54. Encoding and decoding of netty
  55. Java codec
  56. Netty decoder
  57. Netty and TCP packet sticking and unpacking
  58. Introduction to netty development
  59. Problems encountered in Java collection traversal
  60. Spring IOC source code analysis (2)