Skip to content

Commit 6526410

Browse files
committed
fix: kitex observability trace event diagram
1 parent f63ff55 commit 6526410

File tree

2 files changed

+92
-4
lines changed

2 files changed

+92
-4
lines changed

content/en/docs/kitex/Tutorials/observability/instrumentation.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,52 @@ Timeline:
8080

8181
client stats events timeline:
8282

83-
![client_tracing_timeline](/img/docs/client_tracing_timeline.png)
83+
{{<mermaid>}}
84+
%%{init: {'theme': 'base', 'flowchart': {'nodeSpacing': 10, 'rankSpacing': 20}}}%%
85+
flowchart TD
86+
A[Start Invocation] --> B[RPCStart]
87+
B --> C[Middlewares]
88+
C --> D[ClientConnStart]
89+
D --> E[ClientConnFinish]
90+
E --> F[WriteStart]
91+
F --> G[Marshal Request]
92+
G --> H[WriteFinish]
93+
H --> I[Wait for Response]
94+
I --> J[ReadStart]
95+
J --> K[WaitReadStart]
96+
K --> L[WaitReadFinish]
97+
L --> M[Unmarshal Response]
98+
M --> N[ReadFinish]
99+
N --> O[Middlewares]
100+
O --> P[RPCFinish]
101+
classDef event fill:#fff,stroke:#ff0000,stroke-width:2px,color:#000
102+
classDef process fill:#fff,stroke:#000000,stroke-width:2px,color:#000
103+
class B,D,E,F,H,J,K,L,N,P event
104+
class A,C,G,I,M,O process
105+
{{</mermaid>}}
84106

85107
server stats events timeline:
86108

87-
![server_tracing_timeline](/img/docs/server_tracing_timeline.png)
109+
```mermaid
110+
%%{init: {'theme': 'base', 'flowchart': {'nodeSpacing': 10, 'rankSpacing': 20}}}%%
111+
flowchart TD
112+
A[Invocation Started] --> B[RPCStart]
113+
B --> C[ReadStart]
114+
C --> D[WaitReadStart]
115+
D --> E[WaitReadFinish]
116+
E --> F[Unmarshal Request]
117+
F --> G[ReadFinish]
118+
G --> H[Middlewares]
119+
H --> I[ServerHandleStart]
120+
I --> J[Handler Process]
121+
J --> K[ServerHandleFinish]
122+
K --> L[Middlewares]
123+
L --> M[WriteStart]
124+
M --> N[Marshal Response]
125+
N --> O[WriteFinish]
126+
O --> P[RPCFinish]
127+
classDef event fill:#fff,stroke:#ff0000,stroke-width:2px,color:#000
128+
classDef process fill:#fff,stroke:#000000,stroke-width:2px,color:#000
129+
class B,C,D,E,G,I,K,M,O,P event
130+
class A,F,H,J,L,N process
131+
```

content/zh/docs/kitex/Tutorials/observability/instrumentation.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,52 @@ if err := svr.Run(); err != nil {
8080

8181
客户端埋点时序图
8282

83-
![client_tracing_timeline](/img/docs/client_tracing_timeline.png)
83+
```mermaid
84+
%%{init: {'theme': 'base', 'flowchart': {'nodeSpacing': 10, 'rankSpacing': 20}}}%%
85+
flowchart TD
86+
A[发起调用] --> B[RPCStart]
87+
B --> C[中间件]
88+
C --> D[ClientConnStart]
89+
D --> E[ClientConnFinish]
90+
E --> F[WriteStart]
91+
F --> G[请求编码]
92+
G --> H[WriteFinish]
93+
H --> I[等待响应]
94+
I --> J[ReadStart]
95+
J --> K[WaitReadStart]
96+
K --> L[WaitReadFinish]
97+
L --> M[响应解码]
98+
M --> N[ReadFinish]
99+
N --> O[中间件]
100+
O --> P[RPCFinish]
101+
classDef event fill:#fff,stroke:#ff0000,stroke-width:2px,color:#000
102+
classDef process fill:#fff,stroke:#000000,stroke-width:2px,color:#000
103+
class B,D,E,F,H,J,K,L,N,P event
104+
class A,C,G,I,M,O process
105+
```
84106

85107
服务端埋点时序图
86108

87-
![server_tracing_timeline](/img/docs/server_tracing_timeline.png)
109+
```mermaid
110+
%%{init: {'theme': 'base', 'flowchart': {'nodeSpacing': 10, 'rankSpacing': 20}}}%%
111+
flowchart TD
112+
A[调用开始] --> B[RPCStart]
113+
B --> C[ReadStart]
114+
C --> D[WaitReadStart]
115+
D --> E[WaitReadFinish]
116+
E --> F[请求解码]
117+
F --> G[ReadFinish]
118+
G --> H[中间件]
119+
H --> I[ServerHandleStart]
120+
I --> J[handler处理]
121+
J --> K[ServerHandleFinish]
122+
K --> L[中间件]
123+
L --> M[WriteStart]
124+
M --> N[响应编码]
125+
N --> O[WriteFinish]
126+
O --> P[RPCFinish]
127+
classDef event fill:#fff,stroke:#ff0000,stroke-width:2px,color:#000
128+
classDef process fill:#fff,stroke:#000000,stroke-width:2px,color:#000
129+
class B,C,D,E,G,I,K,M,O,P event
130+
class A,F,H,J,L,N process
131+
```

0 commit comments

Comments
 (0)