[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eThis tutorial teaches you how to use the Apigee Debug view to examine API proxy request and response flows, including headers, variables, objects, and response time.\u003c/p\u003e\n"],["\u003cp\u003eYou will learn to identify error messages, specifically when the SpikeArrest policy rate is exceeded, by observing the HTTP 429 status code in transactions within the Debug view.\u003c/p\u003e\n"],["\u003cp\u003eThe guide includes steps for configuring the SpikeArrest policy's rate to 1pm, enabling you to observe both successful (200) and rate-exceeded (429) responses in the debug session.\u003c/p\u003e\n"],["\u003cp\u003eDebug sessions can be downloaded as single documents for later review, but note that sessions are automatically deleted after 24 hours.\u003c/p\u003e\n"],["\u003cp\u003eThe Debug Tool is available in the Google Cloud console, Classic UI, with different versions and some actions can be performed using the API.\u003c/p\u003e\n"]]],[],null,["# View message data with the Debug view\n\n*This page\napplies to **Apigee** and **Apigee hybrid**.*\n\n\n*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*\n\n**What you'll learn**\n\nIn this tutorial, you'll learn to:\n\n- See the response message's headers and body content.\n- See error messages.\n\n**What you'll need**\n\nBefore you begin this tutorial, do the following:\n\n- Ensure that [`curl`](https://curl.haxx.se/) is installed on your machine to make API calls from the command line.\n- Complete the steps in [Before you begin](/apigee/docs/api-platform/get-started/overview).\n- Add a [SpikeArrest policy to your proxy](/apigee/docs/api-platform/tutorials/add-spike-arrest). The SpikeArrest policy is a policy that restricts the number of requests that can be sent to your API proxy. Your proxy must have at least one [policy](/apigee/docs/api-platform/get-started/add-policy).\n\nView message data\n-----------------\n\n\nThe Debug view in the Apigee Proxy Editor lets you view headers, variables,\nobjects, and other details such as response time in the API proxy request\nand response flow. The Debug view also lets you see how a request or\nresponse changes as it is processed by an API proxy. For a more detailed\ndescription of the debug view, see\n[Using Debug](/apigee/docs/api-platform/debug/trace).\n\n\nThis page describes how to use the Debug view to see what happens when the\nSpikeArrest policy rate is exceeded.\n**Note:** The Debug Tool is available in the Google Cloud console, the Classic UI, and some debug actions can be performed using the API as described in the following tabs. The Google Cloud console options are Debug v2 (new) and Debug v1 (released [07/01/2022](/apigee/docs/api-platform/release-notes#July_01_2022)). You can switch between versions of the Debug Tool in the Google Cloud console and the Classic UI. \n\n### Cloud Console UI\n\n### Debug v2 (new)\n\n\nTo use the Debug view in the Cloud Console UI to see what happens\nwhen the SpikeArrest policy rate is exceeded:\n\n1. Open the [Cloud Console UI](https://console.cloud.google.com/apigee).\n2. Select your project.\n3. Click **Proxy development \\\u003e API Proxies**.\n4. Click the name of the API proxy you want to debug.\n5. Click the **Develop** tab.\n6. Click the **Policies \\\u003e SpikeArrest** policy.\n7. In the edit pane, change **Rate** to **1pm**.\n8. Click **Save**.This will allow you to see both successful and failed (over the limit) API calls.\n9. [Deploy](/apigee/docs/api-platform/deploy/ui-deploy-new) the updated proxy.\n10. Click the **Debug** tab.\n11. Click **Start Debug Session** .\n\n In the dialog:\n 1. Select the **Environment** in which you want to run the debug session.\n 2.\n (Optional) From the **Filter** drop-down list, select a\n filter to apply to all transactions in the debug session you\n are creating. The default is `None (All\n transactions)`, which includes all transactions in the\n debug data.\n\n\n For information on using filters, see\n [Using filters in a debug session](/apigee/docs/api-platform/debug/trace#debugsession-filter).\n For information about the built-in filters, see\n [Using predefined filters](/apigee/docs/api-platform/debug/trace#predefined-filters).\n 3. Click **Start**.\n12.\n [Call the API](/apigee/docs/api-platform/get-started/test-proxy) proxy using `curl` (or with the URL in a web\n browser) several times until you see at least one `200`\n response and one `429` response in the\n **Transactions** pane.\n\n | **Note:** The HTTP status code for exceeding the rate limit is `429 Too many requests`.\n13.\n Click a `429` transaction. In the **Transaction map**\n pane, this displays a flow diagram including a SpikeArrest policy\n with an error icon.\n\n14.\n Click the error\n **error** icon. The **Error Properties** pane is displayed.\n\n\nYou can click the\nnavigate_before\n**Previous** and\nnavigate_next\n**Next** buttons to move between steps in the flow and see the\ndetails of each step.\n\n\nTo download the entire debug session as a single document, click\n**Download Session**. A debug session is deleted within 24 hours\nof the time it is completed, so if you want to view the session after\nthat time, you need to download it before then.\n\n### Debug v1\n\n1. On the **Develop** tab of the API Proxy, edit the Spike Arrest policy's **\u003cRate\u003e** to be **1pm** again, then **Save** the proxy. This will allow you to see both successful and failed (over the limit) API calls.\n2. In the Proxy Editor, click the **Debug** tab.\n3. Click **Start Debug Session**.\n4. In the dialog:\n 1. Select the **Environment** in which you want to run the debug session.\n 2. (Optional) From the **Filter** drop-down list, select a filter to apply to all transactions in the debug session you are creating. The default is `None (All transactions)`, which includes all transactions in the debug data.\n\n For information on using filters, see [Using filters in a debug session](#debugsession-filter).\n For information about the built-in filters, see [Using predefined filters](#predefined-filters).\n 3. Click **Start**.\n5. [Call the API](/apigee/docs/api-platform/get-started/test-proxy)\n proxy again using `curl` (or with the URL in a web browser) several times\n until you see\n at least one `200` response and one `429` response in the left-hand pane.\n\n | **Note:** The HTTP status code for exceeding the rate limit is `429 Too many requests`.\n6. Click the `429` transaction in the left-hand pane. This displays a [Gantt chart](https://en.wikipedia.org/wiki/Gantt_chart) for the transaction in the right-hand pane.\n\n Note that there is a row for the Spike Arrest policy, which is displayed with an error icon.\n7. Click the row labeled **Error** . This displays the error details to the\n right of the chart. The picture below shows the **Properties** section of the error details:\n\nYou can click the **Back** and **Next** buttons below the Gannt\nchart to move between steps in the flow and see the details of each step.\n\nTo download the entire debug session as a single document, click\n**Download Session**.\nA debug session is deleted within 24 hours of the time it is completed, so if\nyou want to view the session after that time, you need to download it before then.\n\n### Classic UI\n\n1. On the **Develop** tab of the API proxy, edit the Spike Arrest policy's **\u003cRate\u003e** to be **1pm** again, then **Save** the proxy. This will allow you to see both successful and failed (over the limit) API calls.\n2. In the Proxy Editor, click the **Debug** tab.\n3. Under **Start a debug session**, select the environment to which your proxy is deployed.\n4. Click **Start Debug Session**.\n5. Call the API proxy again using `curl` (or with the URL in a web browser) until you see\n at least one `200` response and one `429` response in the **Debug Transactions** pane.\n\n ```\n curl -v https://YOUR_ENV_GROUP_HOSTNAME/my-proxy\n ```\n\n where \u003cvar translate=\"no\"\u003eYOUR ENV_GROUP_HOSTNAME\u003c/var\u003e is the environment group hostname. See\n [Find the environment group hostname](/apigee/docs/api-platform/get-started/test-proxy#find-the-environment-group-hostname).\n\n A `200` response and a `429` response are shown below.\n\n | **Note:** The default HTTP status code for exceeding the rate limit is `429 Too many requests`.\n |\n | If you want the status code to be different (`500`, for example) for all Spike Arrest policies used in an\n | organization, a property needs to be set on your organization. If you're a Cloud customer,\n | contact [Google Cloud Customer Care](https://cloud.google.com/support-hub/) to set that property.\n6. Click the `200` transaction in the left **Transactions** pane. Its Debug detail is loaded in the main window under **Transaction Map**, which shows a request/response diagram. The Spike Arrest icon is in the request flow.\n7. In the flow diagram, click the **circle icon** in the response, the furthest one to the right (shown in the following diagram).\n\n The **Phase Details** pane shows the data available at that point in the\n flow. If you scroll through that pane, you'll see the HTTP response headers and body\n content.\n8. Now look at an error in Debug. Click the `429` transaction in the Transactions pane. In the main editor\n window, you see a flow diagram with items in the request only, including a Spike Arrest\n icon with a red exclamation point indicating an error.\n\n Click the small tube-shaped **error icon** to the right of the Spike Arrest icon, and\n look at the spike arrest violation details in the **Phase Details** pane.\n\nYou can click the **Back** and **Next** buttons in the flow\ndiagram to move between points in the flow and see the Debug details.\n\nIf you want to see the entire Debug session as a single document, download it by clicking\n**Download Debug Session**.\n\nFor more information, see [Using Debug](/apigee/docs/api-platform/debug/trace)."]]