You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 49ed282
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -43,26 +48,12 @@ Gateway observability is not the same as service observability, and treating it
43
48
The fundamental difference is scope: every request passes through the gateway. When a backend service has a problem, its own metrics show the issue clearly — error rate spikes, latency increases, throughput drops. But the gateway sees that same problem diluted across all the traffic it handles. If one of ten backends is failing, the gateway's aggregate error rate increases by 10%, which might not even trigger an alert.
44
49
45
50
<Diagram
51
+
src={apiGatewayDiagram}
46
52
title="API gateway as the central observation point for all traffic"
47
53
description={
48
54
`Flowchart showing the API gateway positioned between a consumer and multiple downstream components. A Consumer sends requests to the API Gateway. From the gateway, traffic can go to an Auth Service, a Rate Limiter, Backend A, and Backend B. A grouped region labeled Gateway Boundary contains the API Gateway, Auth Service, and Rate Limiter, emphasizing that these components sit at the control point through which all requests pass. The diagram shows why the gateway is a unique observation point: it sees every request before it reaches the backend services and can record both control-plane decisions, such as authentication and rate limiting, and routing decisions to different backends.`
49
55
}
50
-
>
51
-
```mermaid
52
-
flowchart LR
53
-
A[Consumer] --> B[API Gateway]
54
-
B --> C[Auth Service]
55
-
B --> D[Rate Limiter]
56
-
B --> E[Backend A]
57
-
B --> F[Backend B]
58
-
59
-
subgraph gatewayBoundary[Gateway Boundary]
60
-
B
61
-
C
62
-
D
63
-
end
64
-
```
65
-
</Diagram>
56
+
/>
66
57
67
58
The gateway also adds its own latency that frequently gets blamed on backends. Authentication checks, rate limit lookups, request transformation, response transformation, TLS termination — these all take time. When users complain about slow APIs, the default assumption is that backends are slow, but I have seen gateway overhead account for 200ms+ on requests where the backend responded in 50ms.
68
59
@@ -176,39 +167,12 @@ Be thoughtful about histogram buckets (predefined latency ranges like 0-10ms, 10
176
167
The single most useful gateway metric is not total request duration — it is the breakdown of where time went. When someone reports "the API is slow," you need to immediately answer: is the gateway slow, or is the backend slow?
177
168
178
169
<Diagram
170
+
src={requestLifecycleDiagram}
179
171
title="Request lifecycle showing gateway vs. backend latency components"
180
172
description={
181
173
`Flowchart showing a request moving left to right through ten stages. The sequence begins with Request Received, then passes through TLS Handshake, Request Parse, Auth Check, Rate Limit Check, Route Match, Upstream Request, Backend Processing, Response Transform, and Response Sent. Two grouped regions separate where time is spent. A Gateway Time group contains TLS Handshake, Request Parse, Auth Check, Rate Limit Check, Route Match, Upstream Request, Response Transform, and Response Sent, representing work performed or coordinated by the gateway. A separate Backend Time group contains only Backend Processing, representing the actual time spent inside the upstream service. The diagram emphasizes that total latency is a combination of gateway-side work and backend execution, and that debugging requires measuring those components separately.`
182
174
}
183
-
>
184
-
```mermaid
185
-
graph LR
186
-
A[Request Received] --> B[TLS Handshake]
187
-
B --> C[Request Parse]
188
-
C --> D[Auth Check]
189
-
D --> E[Rate Limit Check]
190
-
E --> F[Route Match]
191
-
F --> G[Upstream Request]
192
-
G --> H[Backend Processing]
193
-
H --> I[Response Transform]
194
-
I --> J[Response Sent]
195
-
196
-
subgraph gatewayTime[Gateway Time]
197
-
B
198
-
C
199
-
D
200
-
E
201
-
F
202
-
G
203
-
I
204
-
J
205
-
end
206
-
207
-
subgraph backendTime[Backend Time]
208
-
H
209
-
end
210
-
```
211
-
</Diagram>
175
+
/>
212
176
213
177
At minimum, instrument these separately:
214
178
@@ -391,29 +355,12 @@ Code: W3C Trace Context header propagation through API gateway.
391
355
The gateway creates its own span as a child of the incoming span, then creates new child spans for each outbound request. The trace ID stays the same throughout — that is what connects all the spans into a single trace. The span IDs change at each hop to distinguish different operations.
392
356
393
357
<Diagram
358
+
src={traceContextDiagram}
394
359
title="Trace context propagation creating connected spans across gateway boundary"
395
360
description={
396
361
`Sequence diagram showing how a single distributed trace continues across a client, gateway, auth service, and backend. The client sends a request to the gateway with a traceparent header containing trace ID abc and span ID 123. The gateway creates its own span as a child of that incoming request. The gateway then calls the auth service with the same trace ID but a new span ID 456, receives the auth response, and forwards the request to the backend with the same trace ID and another new span ID 789. The backend returns a response to the gateway, which then responds to the client. A note across the full diagram states that all spans share the same trace ID abc, emphasizing that the trace remains connected even though each hop creates a new span.`
397
362
}
398
-
>
399
-
```mermaid
400
-
sequenceDiagram
401
-
participant Client
402
-
participant Gateway
403
-
participant Auth
404
-
participant Backend
405
-
406
-
Client->>Gateway: Request (traceparent: abc-123)
407
-
Gateway->>Gateway: Create span (parent: 123)
408
-
Gateway->>Auth: Auth check (traceparent: abc-456)
409
-
Auth-->>Gateway: Auth response
410
-
Gateway->>Backend: Forward (traceparent: abc-789)
411
-
Backend-->>Gateway: Response
412
-
Gateway-->>Client: Response
413
-
414
-
Note over Client,Backend: All spans share trace ID abc
415
-
```
416
-
</Diagram>
363
+
/>
417
364
418
365
Common propagation failures I have seen:
419
366
@@ -825,39 +772,12 @@ The overview dashboard answers three questions that operations teams ask constan
825
772
The layout matters. Arrange panels so that related information is grouped and the eye naturally flows from high-level health to specific details:
826
773
827
774
<Diagram
775
+
src={gatewayDashboardDiagram}
828
776
title="Gateway dashboard layout with logical panel grouping"
829
777
description={
830
778
`Top-to-bottom flowchart showing a dashboard organized into four rows. The first row, labeled Row 1 Health Overview, contains Request Rate, Error Rate, and P99 Latency panels for immediate high-level status. The second row, labeled Row 2 Upstream Status, contains Upstream Health Map and Circuit Breaker States panels to show backend health. The third row, labeled Row 3 Traffic Breakdown, contains Top Routes, Top Consumers, and Error Distribution panels for traffic analysis. The fourth row, labeled Row 4 Latency Analysis, contains Gateway vs Backend Latency, Latency by Route, and Slow Request Percent panels for performance investigation. Arrows connect row 1 to row 2, row 2 to row 3, and row 3 to row 4, showing an intended reading order from broad health signals to detailed diagnostic panels.`
831
779
}
832
-
>
833
-
```mermaid
834
-
graph TB
835
-
subgraph row1[Row 1 Health Overview]
836
-
A[Request Rate]
837
-
B[Error Rate]
838
-
C[P99 Latency]
839
-
end
840
-
841
-
subgraph row2[Row 2 Upstream Status]
842
-
D[Upstream Health Map]
843
-
E[Circuit Breaker States]
844
-
end
845
-
846
-
subgraph row3[Row 3 Traffic Breakdown]
847
-
F[Top Routes]
848
-
G[Top Consumers]
849
-
H[Error Distribution]
850
-
end
851
-
852
-
subgraph row4[Row 4 Latency Analysis]
853
-
I[Gateway vs Backend Latency]
854
-
J[Latency by Route]
855
-
K[Slow Request %]
856
-
end
857
-
858
-
row1 --> row2 --> row3 --> row4
859
-
```
860
-
</Diagram>
780
+
/>
861
781
862
782
Row 1 gives you immediate health status — if everything is green, you can stop looking. Row 2 shows backend status, helping you quickly identify if a problem is gateway-side or upstream-side. Rows 3 and 4 provide the detail needed to narrow down issues to specific routes or consumers.
0 commit comments