이 페이지는 Cloud Endpoints가 자동으로 유지관리하는 로그와 측정항목을 사용하여 개발자가 소유한 API의 상태를 모니터링하는 방법을 설명합니다. 사용자가 개발자 API를 요청하면 Endpoints가 요청과 응답에 대한 정보를 로깅합니다. 또한 Endpoints는 모니터링의 4가지 황금 신호 중 3가지인 지연 시간, 트래픽, 오류를 추적합니다. 이러한 사용 및 성능 측정항목은 API를 모니터링하는 데 유용합니다.
시작하기 전에
보기용 로그와 측정항목을 생성하려면 API를 배포하고 해당 API에 요청을 보내야 합니다. 아직 아무 것도 설정하지 않았다면 Endpoints 빠른 시작을 사용해 보세요.
증가나 감소를 바로 확인할 수 있도록 일부 측정항목의 그래프가 위쪽에 표시됩니다. 다음과 같은 작업을 수행할 수 있습니다.
첫 번째 그래프의 오른쪽 위에서 그래프 선택 드롭다운 목록을 사용하여 관심이 있는 측정항목에 대한 그래프를 표시하고, 보고 싶지 않은 항목은 삭제할 수 있습니다. 드롭다운 목록에 있는 각 항목에는 물음표가 있습니다. 물음표 위로 마우스 포인터를 가져가면 해당 항목이 표시하는 측정항목에 대한 설명이 나타납니다.
개요의 오른쪽 위에서는 여러 시간 범위를 선택하여 그래프를 조정할 수 있습니다. 그래프에 표시되는 값의 시간 범위가 조정되며 점 단위도 변경됩니다.
메서드 표
더 상세히 볼 준비가 되었으면 그래프 아래로 스크롤하여 API에 있는 개별 메서드에 대한 측정항목 표를 확인합니다.
표 오른쪽 위에서 열 선택 드롭다운 목록을 사용하여 관심 있는 측정항목을 표시하고, 보고 싶지 않은 항목은 삭제합니다. 또한 항목에는 물음표가 있습니다. 물음표 위로 마우스 포인터를 가져가면 설명이 표시됩니다.
개요 오른쪽 상단에서 기간 선택도구를 사용해서 표에 있는 측정항목-값에 대한 기간을 선택합니다. 그러면 그래프와 표 모두에 대해 하나의 기간이 선택됩니다.
로그
측정항목에서 문제를 발견하면Google Cloud 콘솔의 로그 탐색기 페이지로 이동하여 API에 대한 요청 및 응답 로그를 확인합니다.
API의 개별 메서드에 대한 로그를 확인하려면 표에서 로그 보기를 클릭합니다.
API의 모든 메서드에 대한 로그를 확인하려면 오른쪽 하단에서 모든 로그 보기를 클릭합니다.
대기 시간이 300밀리초를 초과하는 모든 요청 가져오기 등 확인하려는 로그 항목 집합을 지정하도록 쿼리를 빌드합니다.
로그를 지원되는 대상으로 라우팅하도록 싱크를 구성하고 관리합니다. 이렇게 하면 추가 분석을 위해 로그를 BigQuery로 스트리밍하거나, 원시 로그를 Cloud Storage에 저장하거나, Pub/Sub 메시징 주제로 전송할 수 있습니다.
특정 소비자 프로젝트를 위한 필터
특정 소비자 프로젝트의 측정항목을 확인하려면 API 소비자가 요청 시 API 키를 보내야 합니다. Endpoints는 API 키를 사용하여 호출하는 애플리케이션이 연결된 프로젝트를 식별하므로 API 소비자의Google Cloud 프로젝트에 API 키가 생성되어 있어야 합니다. API 키를 사용하여 API에 대한 액세스를 제한하는 방법은 API 키로 API 액세스 제한을 참고하세요.
특정 소비자 프로젝트의 측정항목을 필터링하려면 다음 단계를 따르세요.
API 소비자 프로젝트의 프로젝트 번호를 가져옵니다. API 소비자 프로젝트에 액세스할 권한이 없는 경우 해당 권한이 있는 사용자에게 프로젝트 번호 확인을 요청하세요.
Google Cloud 콘솔에서 프로젝트에 대한 엔드포인트 > 서비스 페이지로 이동합니다.
Endpoints에서 수집한 측정항목은 Cloud Monitoring에서도 사용할 수 있습니다. Monitoring을 사용하여 지연 시간, 트래픽, 오류에 대한 알림을 설정할 수 있습니다. Endpoints 측정항목을 사용하여 알림을 설정할 수 없는 골든 신호는 포화도뿐입니다. 포화도를 모니터링하는 데 필요한 측정항목은 애플리케이션에 따라 다릅니다. 포화도에 대한 알림을 설정하는 데 사용할 수 있는 측정항목에 대해서는 Cloud Monitoring에서 사용할 수 있는 측정항목 목록을 참고하세요.
알림을 설정하려면 다음 안내를 따르세요.
Google Cloud 콘솔에서 계정과 연결된 Endpoints에서 모니터링되는 API가 포함된 Google Cloud 프로젝트를 선택합니다.
[[["이해하기 쉬움","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\u003eCloud Endpoints automatically logs request and response information, tracking latency, traffic, and errors to help monitor API health.\u003c/p\u003e\n"],["\u003cp\u003eThe Endpoints Services page provides an overview with graphs and tables to visualize API performance and identify issues quickly.\u003c/p\u003e\n"],["\u003cp\u003eYou can filter metrics for specific consumer projects by entering the project number in the "Filter by Project Number" field on the Overview page.\u003c/p\u003e\n"],["\u003cp\u003eAlerts can be set up in Cloud Monitoring for latency, traffic, and error metrics, using the "Produced API" resource type.\u003c/p\u003e\n"],["\u003cp\u003eThe logs collected can be viewed and analyzed in Logs Explorer, and can be routed to other destinations like BigQuery, Cloud Storage, or Pub/Sub for further analysis.\u003c/p\u003e\n"]]],[],null,["# Monitoring your API\n\nOpenAPI \\| [gRPC](/endpoints/docs/grpc/monitoring-your-api \"View this page for the Cloud Endpoints gRPC docs\")\n\n\u003cbr /\u003e\n\nThis page describes how you can monitor the health of APIs you own by using the\nlogs and metrics Cloud Endpoints maintains for you automatically. When\nusers make requests to your API, Endpoints logs information about\nthe requests and responses. Endpoints also tracks three of the\n[four golden signals of monitoring](https://landing.google.com/sre/book/chapters/monitoring-distributed-systems.html#xref_monitoring_golden-signals):\nlatency, traffic, and errors. These usage and performance metrics help you monitor\nyour API.\n\nBefore you begin\n----------------\n\nYou must deploy your API and send requests to it in order to generate logs and\nmetrics for viewing. If you don't have anything set up yet, try the\n[Endpoints quickstart](/endpoints/docs/deploy-api).\n\nAPI overview\n------------\n\nWhen you are debugging an issue with your service or just want to ensure that\neverything is running fine, go to your API's overview:\n\n1. In the Google Cloud console, go to the **Endpoints** \\\u003e **Services** page for\n your project:\n\n\n [Go to the Endpoints Services page](https://console.cloud.google.com/endpoints)\n\n \u003cbr /\u003e\n\n2. If you have more than one API, click the one you want to monitor.\n\n3. Ensure you are on the **Overview** tab.\n\n### Graphs\n\nAt the top are graphs for some of the metrics, so you can spot any spikes\nand drops right away. You can:\n\n- In the top-right of the first graph, use the **Select graphs** drop-down list\n to show graphs for metrics you are interested in, and remove the ones you\n don't want to view. Each entry in the drop-down list has a question-mark\n that you can hold your pointer over to to see a description of the metric\n it displays.\n\n- In the top-right corner of the overview, adjust the graphs by selecting from\n the various time spans. This adjusts the time range of values displayed in\n these graphs, which also alters the point granularity.\n\n### Methods table\n\nWhen you are ready to drill down further, scroll below the graphs for a table\nwith metrics for individual methods in your API. You can:\n\n- In the top-right of the table, use the **Select columns** drop-down list to\n show the metrics you are interested in and remove the ones you don't want\n displayed. Entries here also have the question-mark that you can hold your\n pointer over to see a description.\n\n- In the top-right corner of the overview, select a time span for the\n metric values in the table by using the time span picker. This picks a time\n span for both the graphs and the table.\n\n### Logs\n\nWhen you spot an issue in the metrics, go to the **Logs Explorer** page in the\nGoogle Cloud console to see logs of the requests and responses for your API.\n\n- To see logs for individual methods of your API, in the table click\n **View logs**.\n\n- To see logs for all methods in your API, in the bottom-right corner click\n **View all logs**.\n\n- To locate Endpoints logs directly from the Logs Explorer page:\n\n 1. In the Google Cloud console, go to the **Stackdriver** \\\u003e **Logging**\n page:\n\n\n [Go to the Logs Explorer page](https://console.cloud.google.com/logs/query)\n\n \u003cbr /\u003e\n\n 2. Select **Produced API, \u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e** , where\n \u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e is the name of the\n Endpoints service.\n\nSee the\n[Endpoints logs reference](/endpoints/docs/openapi/ref-endpoints-logs)\nfor details on the structure of the logs in the Logs Explorer.\n\nLearn what else you can do with the logs:\n\n- Get started using the\n [Logs Explorer](/logging/docs/view/logs-explorer-interface).\n\n Build queries to specify the set of log entries that you want to view, such\n as getting all requests with a latency greater than 300 milliseconds.\n- [Configure and manage sinks](/logging/docs/export/configure_export_v2) to\n route your logs to supported destinations\n This lets you stream logs to BigQuery for further analysis, save the\n raw logs to Cloud Storage, or send them to Pub/Sub messaging\n topics.\n\n### Filter for a specific consumer project\n\n|\n| **Alpha**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nTo see metrics for a specific consumer project, your API consumers must send an\nAPI key when making a request. Because Endpoints uses the API key\nto identify the project that the calling application is associated\nwith, the API key must have been created in the API consumer's\nGoogle Cloud project. To learn how to restrict access to your API by using\nan API key, see\n\n[Restricting API access with API keys](/endpoints/docs/openapi/restricting-api-access-with-api-keys).\n\n\nTo filter metrics for a specific consumer project:\n\n1. Get the\n [project number](/resource-manager/docs/creating-managing-projects#identifying_projects)\n of the API consumer's project. If you don't have permission to access the\n API consumer's project, ask someone who has permission to get the project\n number for you.\n\n2. In the Google Cloud console, go to the **Endpoints** \\\u003e **Services** page\n for your project.\n\n\n [Go to the Endpoints Services page](https://console.cloud.google.com/endpoints)\n\n \u003cbr /\u003e\n\n3. In the top-left corner of the **Overview** page, enter the project number in\n the **Filter by Project Number** field.\n\n4. Click **Filter**.\n\nThe metrics on the page update to reflect traffic only from the specified\nproject.\n\nAlerting\n--------\n\n|\n| **Beta**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nMetrics collected by Endpoints are also available in\nCloud Monitoring. You can use Monitoring to set up alerting\non latency, traffic, and errors. The only\n[golden signal](https://landing.google.com/sre/book/chapters/monitoring-distributed-systems.html#xref_monitoring_golden-signals)\nthat you cannot set up an alert for using Endpoints metrics is\nsaturation. The metrics that you need to monitor for saturation depend on your\napplication. See the list of\n[metrics](/monitoring/api/metrics)\navailable in Cloud Monitoring for metrics that you can use to set up alerting\non saturation.\n\nTo set up alerting:\n\n1. In the Google Cloud console, select the Google Cloud project\n with your Endpoints monitored API which is associated with the\n account.\n\n [Go to Google Cloud console](https://console.cloud.google.com/)\n2. By using the navigation pane, select **Monitoring**.\n\n3. Create an [alerting policy](/monitoring/alerts)\n to set up alerts for the\n [golden signals](https://landing.google.com/sre/book/chapters/monitoring-distributed-systems.html#xref_monitoring_golden-signals)\n by using the following:\n\n - Latency\n\n 1. For **Condition Type** , enter `Metric Threshold`.\n 2. For **Resource Type** , enter `Produced API`.\n 3. For the metric, enter `Request latencies`.\n 4. Enter the threshold you want to alert on and follow the rest of the [Alerts guide](/monitoring/alerts).\n - Traffic\n\n 1. For **Condition Type** , enter `Metric Threshold`.\n 2. For **Resource Type** , enter `Produced API`.\n 3. For the metric, enter `Request count`.\n 4. Enter the threshold you want to alert on and follow the rest of the [Alerts guide](/monitoring/alerts).\n - Errors\n\n 1. For **Condition Type** , enter `Metric Threshold`.\n 2. For **Resource Type** , enter `Produced API`.\n 3. For the metric, enter `Request count`.\n 4. For response-code-class, enter `5xx`.\n 5. Enter the threshold you want to alert on and follow the rest of the [Alerts guide](/monitoring/alerts).\n\n| **Note:** If your API hasn't logged a 5xx response yet, the alerting policy form doesn't offer it as a response-code-class.\n| **Note:** If the critical constraint for your service is network IO, you might be able to use one of the Endpoints's metrics to set up an alert. All Endpoints logs are under the **Resource Type** of `Produced API`.\n\nWhat's next\n-----------\n\n- [Endpoints logs](/endpoints/docs/openapi/ref-endpoints-logs)\n- [Endpoints metrics](/monitoring/api/metrics_gcp_p_z#gcp-serviceruntime)"]]