Raw
1 import { InlineIcon, Note, Table } from "docs-ui"
2 import { ArrowPath } from "@medusajs/icons"
3
4 export const metadata = {
5 title: `HTTP Monitoring`,
6 }
7
8 # {metadata.title}
9
10 In this guide, you'll learn about monitoring HTTP requests to your environment in Cloud.
11
12 ## HTTP Monitoring Overview
13
14 The HTTP monitoring dashboard provides insights into the performance of your environment's HTTP requests, allowing you to track key metrics such as request latency, error rates, and timeouts.
15
16 By monitoring these metrics, you can ensure that your environment is performing optimally or identify potential issues in your application's HTTP request handling.
17
18 ---
19
20 ## Troubleshooting Common HTTP Issues
21
22 The following table outlines common HTTP performance issues, their potential causes, and the specific metrics you can monitor to identify and troubleshoot these issues effectively.
23
24 <Table>
25 <Table.Header>
26 <Table.Row>
27 <Table.HeaderCell>
28 Issue
29 </Table.HeaderCell>
30 <Table.HeaderCell>
31 Potential Cause
32 </Table.HeaderCell>
33 <Table.HeaderCell>
34 Metric to Check
35 </Table.HeaderCell>
36 </Table.Row>
37 </Table.Header>
38 <Table.Body>
39 <Table.Row>
40 <Table.Cell>
41 Increased error rates
42 </Table.Cell>
43 <Table.Cell>
44 Specific endpoints returning 4xx or 5xx responses due to crashes or invalid logic.
45 </Table.Cell>
46 <Table.Cell>
47 [Errors by Endpoint](#monitor-errors-by-endpoint) and [HTTP Requests over Time](#monitor-http-requests-over-time)
48 </Table.Cell>
49 </Table.Row>
50 <Table.Row>
51 <Table.Cell>
52 High latency
53 </Table.Cell>
54 <Table.Cell>
55 Inefficient database queries or external API calls in specific endpoints.
56 </Table.Cell>
57 <Table.Cell>
58 [Latency by Endpoint](#monitor-latency-by-endpoint) and [Latency over Time](#monitor-latency-over-time)
59 </Table.Cell>
60 </Table.Row>
61 <Table.Row>
62 <Table.Cell>
63 Client timeouts
64 </Table.Cell>
65 <Table.Cell>
66 Endpoints taking too long to respond, often due to heavy processing or blocking operations.
67 </Table.Cell>
68 <Table.Cell>
69 [Client Timeouts by Endpoint](#monitor-client-timeouts-by-endpoint)
70 </Table.Cell>
71 </Table.Row>
72 <Table.Row>
73 <Table.Cell>
74 Unexpected traffic spikes
75 </Table.Cell>
76 <Table.Cell>
77 Sudden surge in request volume that may strain your environment's resources.
78 </Table.Cell>
79 <Table.Cell>
80 [HTTP Requests over Time](#monitor-http-requests-over-time)
81 </Table.Cell>
82 </Table.Row>
83 <Table.Row>
84 <Table.Cell>
85 High bandwidth consumption
86 </Table.Cell>
87 <Table.Cell>
88 Endpoints returning large response payloads or receiving large request bodies.
89 </Table.Cell>
90 <Table.Cell>
91 [Bytes Sent by Endpoint](#monitor-bytes-sent-by-endpoint) and [Bandwidth over Time](#monitor-bandwidth-over-time)
92 </Table.Cell>
93 </Table.Row>
94 </Table.Body>
95 </Table>
96
97 <Note>
98
99 If the metrics don't show a cause related to your application, [check the Cloud status page](../../status/page.mdx) for ongoing Cloud incidents that may be affecting your environment.
100
101 </Note>
102
103 ---
104
105 ## View HTTP Metrics
106
107 To view your project environment's HTTP metrics:
108
109 1. Go to the [environment's dashboard](../../environments/long-lived/page.mdx#open-environment-dashboard).
110 2. Click **Monitoring** > **HTTP** in the sidebar.
111
112 This opens the HTTP monitoring dashboard, where you can analyze your environment's HTTP performance across any time range.
113
114 ### Change Time Range
115
116 By default, the dashboard shows metrics for the last hour. To change the time range:
117
118 1. Click on the time range selector at the top right of the dashboard.
119 2. Either choose a preset time range (for example, last 24 hours) or set a custom time range.
120
121 The charts will update to show metrics for the selected time range, allowing you to analyze performance trends and patterns over different periods.
122
123 ### Refresh Metrics
124
125 To refresh the metrics displayed on the dashboard, click the <InlineIcon Icon={ArrowPath} alt="refresh" /> button.
126
127 The metrics will refresh to show the most up-to-date performance data for your environment's HTTP requests in the selected time range.
128
129 ---
130
131 ## Monitor HTTP Requests over Time
132
133 The HTTP Requests over Time chart shows the total number of HTTP requests received by your environment over time. It also shows error and client timeout rates.
134
135 This chart helps you identify trends in your environment's traffic, such as peak usage times or sudden spikes in requests, as well as potential issues indicated by increased error rates or timeouts.
136
137 In the [HTTP monitoring dashboard](#view-http-metrics), the HTTP Requests over Time chart shows:
138
139 - **Total Requests** (green): The total number of HTTP requests received by your environment per second.
140 - **Error Rate** (red): The percentage of HTTP requests that resulted in errors (status codes 4xx and 5xx).
141 - **Client Timeout Rate** (orange): The percentage of HTTP requests that resulted in client timeouts.
142
143 By monitoring these metrics, you can ensure that your environment is handling HTTP traffic effectively and identify potential issues in your application's request handling.
144
145 ---
146
147 ## Monitor Bandwidth over Time
148
149 The Bandwidth over Time chart shows the total bandwidth consumed by HTTP requests to your environment over time.
150
151 This chart helps you understand the data transfer patterns of your environment, identify peak bandwidth usage times, and correlate bandwidth consumption with traffic trends or performance issues.
152
153 In the [HTTP monitoring dashboard](#view-http-metrics), the Bandwidth over Time chart shows:
154
155 - **Bytes Received** (green): The total amount of data received by your environment through HTTP requests.
156 - **Bytes Sent** (blue): The total amount of data sent by your environment in HTTP responses.
157
158 By monitoring these metrics, you can ensure that your environment is efficiently handling data transfer and identify potential issues related to bandwidth consumption.
159
160 ---
161
162 ## Monitor Latency over Time
163
164 The Latency over Time chart shows the latency percentiles of HTTP requests to your environment over time.
165
166 <Note title="What is Latency?">
167
168 Latency refers to the time it takes for an HTTP request to be processed by your environment and for a response to be sent back to the client. High latency can indicate performance issues in your application or infrastructure.
169
170 </Note>
171
172 This chart helps you track the responsiveness of your environment to HTTP requests, identify trends in latency, and correlate latency patterns with traffic trends or performance issues.
173
174 In the [HTTP monitoring dashboard](#view-http-metrics), the Latency over Time chart shows:
175
176 - **P50** (green): The 50th percentile latency, meaning 50% of requests complete faster than this time.
177 - **P90** (orange): The 90th percentile latency, meaning 90% of requests complete faster than this time.
178 - **P99** (blue): The 99th percentile latency, meaning 99% of requests complete faster than this time.
179
180 You can click on any legend item to toggle that percentile line on or off, allowing you to focus on specific latency metrics.
181
182 By monitoring these percentiles, you can get detailed insights into your environment's response times and identify potential issues in your application's request handling that may be causing increased latency.
183
184 ---
185
186 ## Monitor Requests by Endpoint
187
188 The Requests by Endpoint section breaks down the total number of HTTP requests by endpoint, allowing you to identify which parts of your application are receiving the most traffic.
189
190 In the [HTTP monitoring dashboard](#view-http-metrics), the Requests by Endpoint section shows a list of your application's endpoints, along with the average number of requests they receive per second. The endpoints are listed in descending order, with the most requested endpoints at the top.
191
192 This breakdown helps you understand traffic distribution across your application's endpoints, identify popular or underutilized endpoints, and correlate traffic patterns with performance metrics to optimize your application's request handling.
193
194 ---
195
196 ## Monitor Errors by Endpoint
197
198 The Errors by Endpoint section breaks down the total number of HTTP errors (status codes 4xx and 5xx) by endpoint, allowing you to identify which parts of your application are experiencing the most issues.
199
200 In the [HTTP monitoring dashboard](#view-http-metrics), the Errors by Endpoint section shows a list of your application's endpoints, along with the total number of errors they received in the selected time range. The endpoints are listed in descending order, with the most error-prone endpoints at the top.
201
202 This breakdown helps you identify problematic endpoints in your application and prioritize debugging efforts to improve the endpoints.
203
204 ---
205
206 ## Monitor Client Timeouts by Endpoint
207
208 The Client Timeouts by Endpoint section breaks down the total number of HTTP client timeouts by endpoint, allowing you to identify which parts of your application are experiencing the most timeouts.
209
210 In the [HTTP monitoring dashboard](#view-http-metrics), the Client Timeouts by Endpoint section shows a list of your application's endpoints, along with the total number of client timeouts they received in the selected time range. The endpoints are listed in descending order, with the most timeout-prone endpoints at the top.
211
212 This breakdown helps you identify endpoints in your application that may be causing client timeouts, allowing you to investigate potential performance issues or bottlenecks in those endpoints and optimize their responsiveness.
213
214 ---
215
216 ## Monitor Bytes Sent by Endpoint
217
218 The Bytes Sent by Endpoint section breaks down the total amount of data sent in HTTP responses by endpoint, allowing you to identify which parts of your application are consuming the most bandwidth.
219
220 In the [HTTP monitoring dashboard](#view-http-metrics), the Bytes Sent by Endpoint section shows a list of your application's endpoints, along with the total size of data sent in their HTTP responses in the selected time range. The endpoints are listed in descending order, with the endpoints sending the most data at the top.
221
222 This breakdown helps you understand bandwidth consumption across your application's endpoints, identify potential issues related to large response sizes, and optimize your application's data transfer.
223
224 ---
225
226 ## Monitor Latency by Endpoint
227
228 The Latency by Endpoint section breaks down the P90 latency of HTTP requests by endpoint, allowing you to identify which parts of your application are experiencing the most latency.
229
230 In the [HTTP monitoring dashboard](#view-http-metrics), the Latency by Endpoint section shows a list of your application's endpoints, along with the P90 latency of HTTP requests they receive in the selected time range.
231
232 P90 latency represents the 90th percentile, meaning 90% of requests to each endpoint complete faster than the displayed time. Latency is measured in milliseconds (ms). The endpoints are listed in descending order, with the endpoints experiencing the highest latency at the top.
233
234 This breakdown helps you identify endpoints with high latency, understand performance bottlenecks, and optimize your application's responsiveness.