[[["易于理解","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。"],[],[],null,["# Test and monitor A2A agent deployment\n\nAfter successfully deploying your A2A agent to Cloud Run, thoroughly\ntest its functionality. Establish strong monitoring practices to ensure\ncontinuous performance and reliability.\n\nA2A inspector: Validate agent compliance\n----------------------------------------\n\nUse the [a2a-inspector](https://github.com/a2aproject/a2a-inspector) tool to inspect, debug, and validate your deployed Google A2A agent. This tool ensures that your agent fully complies with the A2A specification and functions correctly.\n\nAfter a successful connection, the inspector performs the following actions:\n\n- **Displays the agent card:** Automatically shows your agent's card.\n- **Validates compliance:** Checks that the card meets A2A specifications.\n- **Enables live chat:** Lets you send and receive messages with the agent.\n- **Shows raw data:** Displays raw JSON-RPC 2.0 messages in a console for debugging.\n\nCLI interaction with a deployed A2A agent\n-----------------------------------------\n\nUse the command-line interface (CLI) tools from the [A2A samples repository](https://github.com/a2aproject/a2a-samples)\nto interact with your deployed service. This CLI supports bearer token-based\nauthentication.\n\nIf your service uses IAM-based authentication, export the\n`gcloud` token for successful interaction: \n\n export A2A_CLI_BEARER_TOKEN=$(gcloud auth print-identity-token)\n # From CLI directory\n uv run . --agent \u003cvar translate=\"no\"\u003eCLOUD_RUN_SERVICE_URL\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eCLOUD_RUN_SERVICE_URL\u003c/var\u003e with the URL of your deployed\nCloud Run service.\n\u003e | **Note:** Upon successful deployment and invocation, the [agent card](https://a2a-protocol.org/latest/topics/agent-discovery/#the-role-of-the-agent-card) appears, initiating a new task and prompting you for input. Each event in the CLI includes details such as the task ID, status, and timestamp.\n\nLocal testing of deployed A2A services\n--------------------------------------\n\nYou can test your deployed Cloud Run service locally. This is\nparticularly useful when implementing IAM-based authentication.\n\n### Test IAM-based authentication for Cloud Run agents\n\nClients interacting with your Identity and Access Management (IAM)-secured Cloud Run service must\npossess the `roles/run.invoker` IAM role.\n\nLocally test your deployed service\nauthentication flow using the `gcloud auth print-identity-token` command: \n\n curl -H \"Authorization: Bearer $(gcloud auth print-identity-token)\" \u003cvar translate=\"no\"\u003eCLOUD_RUN_SERVICE_URL\u003c/var\u003e/.well-known/agent.json\n\nReplace \u003cvar translate=\"no\"\u003eCLOUD_RUN_SERVICE_URL\u003c/var\u003e with the URL of your deployed\nCloud Run service."]]