Skip to content

Commit

Permalink
可观测性
Browse files Browse the repository at this point in the history
  • Loading branch information
isno committed Jan 30, 2024
1 parent f0cdbbf commit aaede41
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export default defineUserConfig({
'/observability/profiles.md',
'/observability/dumps.md',
'/observability/OpenTelemetry.md',
'/observability/conclusion.md',
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions Observability/conclusion.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 小结


参考

- 《cncf 可观测性白皮书》https://github.com/cncf/tag-observability/blob/main/whitepaper.md
https://github.com/cncf/tag-observability/blob/dec82aa5bd39a8834f58da0377d1e2b8fdeeac63/whitepaper-zh.md
4 changes: 3 additions & 1 deletion Observability/dumps.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Dumps
# Crash Dumps

即使代码写得再谨慎,免不了还是会发生各种意外的事件,比如服务器内存突然飙高,又或者发生内存溢出(OOM)。当应用进程异常挂掉后会产生dump文件用于排除程序故障
4 changes: 2 additions & 2 deletions Observability/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

:::

可以看出,Profiling 是一个关于动态程序分析的术语,很多编程语言或框架也提供了丰富的 Profiling Tools,熟悉 Go 语言的朋友一定了解 pprof,当运行异常时,通过 pprof CPU profiling 或者 Memory profiling 分析函数耗时以及内存占用情况,展示形式以 Flame Graph(火焰图)表达。2021年国内某站崩溃 [^1],工程师们使用火焰图观察到到某一处 Lua 代码存在异常时,才找到问题的源头。
可以看出,Profiling 是一个关于动态程序分析的术语,很多编程语言或框架也提供了丰富的 Profiling Tools,熟悉 Go 语言的朋友一定了解 pprof,当运行异常时,通过 pprof CPU profiling 或者 Memory profiling 分析函数耗时以及内存占用情况,展示形式以 Flame Graph(火焰图)表达。2021年国内某站崩溃[^1],工程师们使用火焰图观察到到某一处 Lua 代码存在异常时,才找到问题的源头。

<div align="center">
<img src="../assets/lua-cpu-flame-graph.webp" width = "500" align=center />
Expand All @@ -29,4 +29,4 @@
Traces 让我们了解延迟问题是分布式系统的的哪个部分导致的,而 Profiles 则使我们进一步定位到具体的函数具体的代码,更加深入挖掘并理解那些导致延迟问题存在的原因,是回答从“是什么”到“为什么”的重要数据。


[^1] 参见《2021.07.13 我们是这样崩的》https://www.bilibili.com/read/cv17521097/
[^1] 参见:《2021.07.13 我们是这样崩的》https://www.bilibili.com/read/cv17521097/

0 comments on commit aaede41

Please sign in to comment.