이 페이지에서는 Google App Engine에서 증가한 지연 시간을 모니터링하고 알림을 받는 방법을 설명합니다.
App Engine 앱의 지연 시간이 길어지는 이유에는 여러 가지가 있을 수 있습니다. 예를 들어 앱에 최적화된 코드가 없거나 리소스가 부족하거나 머신의 사용량이 많은 경우가 있습니다. 이 가이드에서는 이유에 관계없이 App Engine에서 생성된 지연 시간을 중점적으로 설명합니다.
지연 시간이 길어지면 5xx 오류가 발생할 수 있다는 점을 이해하는 것이 중요합니다.
따라서 긴 지연 시간을 빠르게 감지할 수 있으므로 제시간에 조치를 취하여 애플리케이션 오류를 해결할 수 있습니다.
모니터링 및 알림 설정
모니터링
앱의 응답 지연 시간을 모니터링할 맞춤설정된 그래프를 만들려면 Cloud Monitoring > 측정항목 탐색기를 사용하여 자체 그래프를 빌드합니다.
Cloud Logging에서 요청 로그와 애플리케이션 로그의 두 가지 로그 카테고리를 찾을 수 있습니다. 요청 로그는 애플리케이션에 대한 각 요청마다 App Engine에서 자동으로 작성되며, HTTP 메서드, 응답 코드 등을 포함합니다. 애플리케이션 로그는 애플리케이션에 대해 작성하는 로그입니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThis page explains how to monitor and receive alerts for high latency in Google App Engine applications, which can prevent potential 5xx errors.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a custom latency graph in Cloud Monitoring's Metrics Explorer by selecting "GAE Application" as the resource type and "Response latency" as the metric.\u003c/p\u003e\n"],["\u003cp\u003eTo receive alerts for elevated latency, you can configure an alerting policy in Cloud Monitoring's Alerting section, setting "GAE Application" and the desired latency metric.\u003c/p\u003e\n"],["\u003cp\u003eThe App Engine dashboard provides a general overview of application latency, allowing you to filter by service, version, and interval.\u003c/p\u003e\n"],["\u003cp\u003eCloud Logging and Cloud Trace can be used to understand specific request latencies and how the request propagate respectively, with both allowing filtering by App Engine service and version.\u003c/p\u003e\n"]]],[],null,["# Monitoring and alerting latency\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis page describes how to monitor and get alerts from elevated latency in\nGoogle App Engine.\n\nHigh latency for App Engine apps can occur for various reasons. For\nexample, the app does not have optimized code, there aren't enough resources,\nthere are busy machines, and so forth. This guide focuses on the latency\ngenerated by App Engine regardless of the reason.\n\nIt is important to understand that high latency can often lead to 5xx errors.\nTherefore, rapid detection of high latency can help you act in time and thus\nresolve application errors.\n\nSetting up Monitoring and Alerting\n----------------------------------\n\n### Monitoring\n\nIf you want to create a customized graph to monitor your app's response latency,\nuse **Cloud Monitoring** \\\u003e **Metrics Explorer** to build your own graph.\n\n[Go to Metrics Explorer page](https://console.cloud.google.com/monitoring/metrics-explorer)\n\nIn the **Resource Type** , select *GAE Application* and select *Response latency*\nin the **Metric** filter. If you have a specific service to check, you can also\nuse **Filters** to filter by the specific module to see the response latency\nchart.\n\nNow that you've set up your customized graph, let's take a look at the next\nsection and learn how to set up notifications for latencies over a certain\namount of seconds.\n\n### Alerting\n\nTo create an alerting policy, do the following:\n\n1. Set up notifications, create an alerting policy in **Cloud Monitoring** \\\u003e **Alerting** and click on **+ CREATE POLICY**.\n2. Add a condition to your alert by clicking **ADD CONDITION**.\n\n [Go to Alerting page](https://console.cloud.google.com/monitoring/alerting)\n3. Select GAE Application as a target:\n\nFor example, if you wanted to get alerts for response latency, such as how long\nyour App Engine app is taking to respond, select response latency.\n\nYou can also select the module ID if it's appropriate, and add a threshold and a\nnotification channel. See\n[Managing notification channels](https://cloud.google.com/monitoring/support/notification-options)\nfor instructions.\n\nAfter you have finished creating the policy, you will see the policy in a list\nin the Alerting page. Click on the created policy to see the details, as shown\nin the following image:\n\nCongratulations, you just created your first App Engine latency policy!\nAfter you create your policy, the app will send an alert to the selected channel\nif it detects an incident.\n\nDebugging latency\n-----------------\n\n### Checking the App Engine latency dashboard\n\nIn general, when you want to see the latency of App Engine applications,\ngo to **App Engine** \\\u003e **Dashboard** and select the **Latency** graph.\n\n[Go to App Engine dashboard](https://console.cloud.google.com/appengine)\n\nIn the latency graph, you can drill into the data by filtering the graphs by\nservice, version, and interval.\n\nIn the previous image, notice how the application latency varies from a few\nmilliseconds to almost 25s.\n\n### Understanding app latency\n\nTo understand now how long a particular request has taken, go to:\n\n- [Cloud Logging](/logging) to view request logs and application logs.\n- [Cloud Trace](/trace) to track how requests propagate.\n\n#### Cloud Logging\n\nIn Cloud Logging you can find two categories of logs, request logs and\napplication logs. Request logs are automatically written by App Engine\nfor each request to your application and contains the HTTP method, response\ncode, and so forth. Application logs are those that you write for your\napplication.\n\nTo view request logs or application logs, see\n[Viewing logs](/appengine/docs/flexible/writing-application-logs#viewing_logs).\n\n#### Cloud Trace\n\nCloud Trace is useful for understanding how requests propagate through your\napplication. You can inspect detailed latency information for a single request\nor view aggregate latency for your entire application.\n\nTo view trace details in Cloud Trace, you can follow\n[Find and explore traces](/trace/docs/finding-traces).\nIn the [Trace explorer](https://console.cloud.google.com/traces/list), as shown in the following\nimage, you can use the filters to filter by your specific App Engine\nservice and version."]]