Sentry (v20.12.1) k8s cloud native architecture exploration, sentry for JavaScript manual capture event basic usage

For less 2021-01-14 14:26:47
sentry v20.12.1 20.12.1 k8s cloud


series

  1. Sentry-Go SDK Chinese Practice Guide
  2. Let's brush together Sentry For Go Official document Enriching Events
  3. Snuba:Sentry New search infrastructure ( be based on ClickHouse above )
  4. Sentry 10 K8S Cloud native architecture exploration ,Vue App 1 Minutes fast access
  5. Sentry(v20.12.1) K8S Cloud native architecture exploration , Before you play / Back end monitoring and event log big data analysis , High performance and high availability + Scalable cluster deployment
  6. Sentry(v20.12.1) K8S Cloud native architecture exploration ,Sentry JavaScript SDK Three ways to install and load
  7. Sentry(v20.12.1) K8S Cloud native architecture exploration ,SENTRY FOR JAVASCRIPT SDK Configuration details

Basic usage

Sentry Of SDK Hook into your runtime environment , And automatically report errors (errors)、 abnormal (exceptions) And refuse to (rejections).

Key terms :

  • event Is to Sentry An example of sending data . Usually , The data is an error (error) Or abnormal (exception).
  • issue It's a set of similar events .
  • The report of the incident is called capturing. After capturing the event , It will be sent to Sentry.

The most common form of capture is capture errors (capture errors). The errors that can be caught vary from platform to platform . Usually , If you have something that looks like an exception (exception) Things that are , It can be captured . For certain SDK, You can also omit capture_exception Parameters of ,Sentry Will attempt to catch the current exception . To Sentry It's also useful to report errors or messages manually .

When capturing Events , You can also record the crumbs that caused the event (breadcrumbs). Breadcrumbs are different from events : They won't be Sentry Create events in , But it will be buffered before sending the next event . In our Breadcrumbs documentation Learn more about crumbs in .

Capture the error

stay JavaScript in , You can pass the error object to captureException(), To capture it as an event . You can throw a string as an error , In this case, backtracking cannot be recorded .

try {
aFunctionThatMightFail();
} catch (err) {
Sentry.captureException(err);
}

Capture naked messages

Another common operation is to capture naked messages (bare message). The message should be sent to Sentry The text message of . Usually , The message won't go out , But they can be useful for some teams .

Sentry.captureMessage("Something went wrong");

Set the event level

level — Similar to log level — It's usually based on Integration (integration) Default added . You can also override it in an event .

To be in scope External settings level, You can call captureMessage() Every event :

Sentry.captureMessage("this is a debug message", "debug");

To be in scope (scope) Set levels in , You can call setLevel()

Sentry.configureScope(function(scope) {
scope.setLevel(Sentry.Severity.Warning);
});

Or every event :

Sentry.withScope(function(scope) {
scope.setLevel("info");
Sentry.captureException("info");
});

Chinese documents are synchronized to :

 I'm for less .
WeChat :uuhells123.
official account : Hacker afternoon tea .
Thank you for your support !
版权声明
本文为[For less]所创,转载请带上原文链接,感谢
https://javamana.com/2021/01/20210114131749772d.html

  1. Redis basic command
  2. Summary of MySQL articles
  3. 2、 Create k8s cluster in 5 seconds
  4. data自定义属性在jQuery中的用法
  5. Linux常见解压缩
  6. Detailed explanation of HBase basic principle
  7. 1、 Why and how to learn k8s
  8. Java advanced (29) -- HashMap set
  9. java中大文件上传
  10. Weblogic 2017-3248 analysis of Java Security
  11. Kubernetes official java client 8: fluent style
  12. Explain the function of thread pool and how to use it in Java
  13. Programming software tutorial video Encyclopedia: C + + / Java / Python / assembly / easy language (with tutorial)
  14. Description of dependency problem after javacv is updated to 1.5. X and how to reduce the size of dependency package
  15. Java reflection & dynamic agent
  16. Building Apache 2.4 + php7 + mysql8 in centos7 environment
  17. Summary of Java multithreading (1)
  18. Oracle AWR report generation
  19. Four magic functions of mybatis, don't step on the pit!
  20. A 16-year-old high school student successfully transplanted Linux to iPhone and posted a detailed guide
  21. Centos7 one click installation of JDK1.8 shell script
  22. Mounting of file system in Linux (centos7)
  23. How does serverless deal with the resource supply demand of k8s in the offline scenario
  24. Detailed explanation of HBase basic principle
  25. Spring security oauth2.0 authentication and authorization 4: distributed system authentication and authorization
  26. Redis performance Part 5 redis buffer
  27. JavaScript this keyword
  28. Summary of Java multithreading (3)
  29. Sentry(v20.12.1) K8S 云原生架构探索, SENTRY FOR JAVASCRIPT 手动捕获事件基本用法
  30. Sentry(v20.12.1) K8S 云原生架构探索, SENTRY FOR JAVASCRIPT 手动捕获事件基本用法
  31. (10) Spring from the beginning to the end
  32. Summary of Java multithreading (2)
  33. Spring source notes! From the introduction to the source code, let you really understand the source code
  34. A stormy sunny day
  35. Zookeeper (curator), the implementation of distributed lock
  36. Show the sky! Tencent T4's core Java Dictionary (framework + principle + Notes + map)
  37. Spring boot project, how to gracefully replace the blank value in the interface parameter with null value?
  38. Spring boot project, how to gracefully replace the blank value in the interface parameter with null value?
  39. docker+mysql集群+读写分离+mycat管理+垂直分库+负载均衡
  40. docker+mysql集群+读写分离+mycat管理+垂直分库+负载均衡
  41. To what extent can I go out to work?
  42. Java 使用拦截器无限转发/重定向无限循环/重定向次数过多报错(StackOverflowError) 解决方案
  43. Implementation of rocketmq message sending based on JMeter
  44. How to choose the ticket grabbing app in the Spring Festival? We have measured
  45. Implementation of rocketmq message sending based on JMeter
  46. My programmer's Road: self study java
  47. My programmer's Road: self study java
  48. All in one, one article talks about the use of virtual machine VirtualBox and Linux
  49. All in one, one article talks about the use of virtual machine VirtualBox and Linux
  50. Java 使用拦截器无限转发/重定向无限循环/重定向次数过多报错(StackOverflowError) 解决方案
  51. [Java training project] Java ID number recognition system
  52. How does serverless deal with the resource supply demand of k8s in the offline scenario
  53. Detailed explanation of HBase basic principle
  54. Explain the function of thread pool and how to use it in Java
  55. Kubernetes official java client 8: fluent style
  56. 010_MySQL
  57. Vibrant special purchases for the Spring Festival tiktok section, hundreds of good things to make the year more rich flavor.
  58. 010_MySQL
  59. Of the 4 million docker images, 51% have high-risk vulnerabilities
  60. Rocketmq CPP client visual studio 2019 compilation