Implementing synthetic monitoring using Amazon Nova Act
https://aws.amazon.com/blogs/machine-learning/implementing-synthetic-monitoring-using-amazon-nova-act/📌 用Nova Act做網站監控:讓AI看畫面而不是抓DOM選擇器
TL;DR:Amazon Nova Act搭配Bedrock AgentCore,用多模態視覺理解取代傳統選擇器,做出更耐用的synthetic monitoring。
Selenium或Playwright腳本最讓人頭痛的,不是寫的時候,而是維護的時候:前端一改CSS class,測試就整套壞掉。這篇AWS部落格提出了另一種做法,讓監控agent像人一樣「看畫面」而不是去抓DOM節點。
🤔 問題:使用者旅程失敗,後端訊號卻看不出來
多數團隊透過metrics、logs、traces與API層級的檢查來監控基礎設施健康度,但高影響力的故障往往發生在使用者旅程層級,這些後端訊號未必能即時反映問題。常見情境包括:前端部署把結帳按鈕弄壞了、第三方登入頁面悄悄改版、或是UI回歸讓關鍵元素失去反應。傳統瀏覽器自動化框架依賴明確的DOM定位器與選擇器,一有小改動就容易整套失效,團隊往往花更多時間在維護選擇器、處理時序不穩定,而不是打造新的自動化測試。這類需求橫跨電商(商品搜尋、價格庫存顯示、購物車、結帳確認)、金融服務(帳戶存取、交易流程)、旅遊訂房、SaaS訂閱升級,以及醫療掛號系統。
🧩 架構設計:Nova Act看畫面,AgentCore管生命週期
Amazon Nova Act使用多模態大型語言模型直接處理UI截圖,而不是解析DOM選擇器,這讓它對UI變動更有韌性,因為模型是根據畫面上實際看到的東西做推理,而不是依賴CSS class或元素ID,樣式改變時不需要更新腳本。文章指出,在早期的企業客戶案例中,Amazon Nova Act在瀏覽器工作流程上展現出超過90%的準確率,比選擇器一有元素變動就直接失效的傳統做法有明顯改善,但作者也提醒團隊應該在自己的網站上實測,並為適應失敗的情況設計重試邏輯。整體架構結合Amazon Nova Act與Amazon Bedrock AgentCore:agent的動作透過act()以自然語言驅動UI操作,驗證則透過act_get()搭配布林值schema在關鍵檢查點做斷言;部署到AgentCore Runtime後,執行環境會透過Browser工具管理瀏覽器session的生命週期。當旅程失敗時,agent會發布旅程類型、目標URL、耗時、已完成步驟與失敗步驟,詳細的例外資訊則保留在runtime日誌中。
🧩 怎麼用:從定義旅程到排程執行
實作的第一步是定義最重要、必須驗證的顧客旅程。以電商應用為例,通常包括首頁載入、商品搜尋、商品詳情頁瀏覽、加入購物車驗證與結帳準備。重點是明確驗證結果,例如確認搜尋結果正確顯示、購物車確實包含商品、頁面上沒有出現錯誤橫幅,而不是只驗證流程有沒有跑完,這能同時降低「檢查不完整導致的假陽性」與「斷言過於寬鬆導致的假陰性」。部署上,需要先用Nova Act CLI的act workflow指令把agent打包、推送容器映像檔到Amazon ECR並佈建runtime;部署完成後端點ARN維持不變,之後的更新只會建立新的runtime版本,不需要更改Scheduler的目標設定。範例程式庫中的deploy.py腳本把這些指令包裝起來,並加入前置檢查(Docker、AWS憑證)、建立SNS警示主題、串接Amazon EventBridge排程,讓一行python deploy.py就能完成端到端部署;若要更正式的可重複部署流程,範例也提供CDK stack作為替代方案,內建最小權限IAM、SNS警示主題,以及用來捕捉失敗InvokeAgentRuntime呼叫的SQS死信佇列,並設置兩個CloudWatch警示:一個監控死信佇列深度,一個監控排程是否有漏跑(利用AWS/Scheduler的InvocationAttemptCount指標,把資料缺失視為異常)。實測中,一個六步驟的旅程通常在2到4分鐘內完成,實際時間依頁面載入速度而定。
⚠️ 限制與最佳實務
文章特別提醒一個容易忽略的盲點:這些CloudWatch警示只能偵測基礎設施層級的故障,例如排程沒有觸發或呼叫沒有送達agent;如果顧客旅程在功能上已經壞掉、但HTTP層級仍回傳200,這種情況會透過agent的SNS發布訊息被發現,而不會觸發CloudWatch警示。另外,建議監控重點應放在3到5個高價值的關鍵旅程(登入、結帳、帳戶存取),而不是追求頁面覆蓋率,過度監控反而會製造雜訊,讓團隊對真正的故障失去敏感度;斷言也應該針對有意義的結果,而不是逐一檢查每個DOM元素,過度細緻的斷言只會增加假陽性卻不會提升故障偵測能力。範例程式碼採用單次嘗試執行每個步驟,用意是把Browser session的成本降到最低。
🎯 實務啟示
如果你的團隊正被選擇器維護成本壓得喘不過氣,這個架構提供了一個值得評估的方向:用視覺推理取代DOM定位,把監控重心從「頁面覆蓋率」轉移到「關鍵旅程的結果驗證」。但既然準確率是90%而非100%,落地前務必在自家網站上實測,並設計好重試與例外處理機制,而不是直接假設AI一定能像人一樣穩定地完成每一步操作。
🔗 來源
- 標題:Implementing synthetic monitoring using Amazon Nova Act
- 作者/機構:Sarath Krishnan, AWS ML
- 連結:https://aws.amazon.com/blogs/machine-learning/implementing-synthetic-monitoring-using-amazon-nova-act/
#AmazonNovaAct #BedrockAgentCore #SyntheticMonitoring #AWS #AIAgent #BrowserAutomation #MultimodalAI #DevOps #Observability #CloudMonitoring
原始資料 AWS ML · 收集於 2026-09-28
摘要原文
Synthetic monitoring emulates real user journeys through automated transactions. Rather than waiting for customers to encounter problems, teams continuously validate critical workflows (logins, purchases, form submissions) on a scheduled basis. With this approach, you detect problems faster when performance degrades or UI interactions break. For customer-facing businesses, especially in ecommerce, synthetic monitoring safeguards interactions that matter most. Organizations validate that product search works correctly, pricing and inventory display as expected, cart operations succeed, and checkout confirmations complete without error. Continuous testing identifies problems before customers encounter them. The same approach applies across industries. Financial services organizations make sure account access and transaction flows remain functional. Travel and hospitality providers monitor booking and reservation journeys. Software as a service (SaaS) companies validate signup and subscription upgrade paths. Healthcare organizations monitor appointment scheduling portals where availability and transaction health are essential. This post walks through an agent-driven approach to synthetic monitoring using Amazon Nova Act and Amazon Bedrock AgentCore . Together, with these services you can move beyond brittle UI scripts toward resilient, managed journey validation. The post describes the architecture and patterns for agent-driven synthetic monitoring, with a sample repository containing the complete implementation. Most organizations monitor infrastructure health through metrics, logs, traces, and API-level checks. However, high-impact failures often occur at the user journey level, where backend signals may not immediately reveal the problem. Common examples: a frontend deployment breaks a checkout button, a third-party login page changes unexpectedly, or a UI regression makes critical elements unresponsive. Traditional browser automation frameworks like Selenium and Playwright rely on explicit Document Object Model (DOM) locators and selectors, which creates brittleness. Even small UI changes can break tests and require constant maintenance. Teams invest significant ongoing effort managing selectors, handling timing-related instability, and updating scripts as applications evolve, often spending more time on maintenance than on building new automations. Amazon Nova Act uses a multimodal large language model (LLM) that processes UI screenshots rather than DOM selectors, making it significantly more resilient to UI changes. Because the model reasons from what it sees on screen (not from CSS classes or element IDs), it adapts when styling changes without requiring script updates. In early enterprise customer use cases, Amazon Nova Act has demonstrated over 90% accuracy on browser workflows. This is a meaningful improvement over selector-based approaches that fail immediately on any element change. Teams should test on their own sites and design monitors with retry logic for cases where adaptation does not succeed. Enterprise monitoring platforms compound the maintenance challenge by pricing browser checks as premium add-ons. This forces teams to choose between monitoring breadth and budget, all separate from the real goal of validating critical customer journeys. This solution combines the following AWS services, each handling a distinct responsibility: The architecture follows this flow: The following diagram illustrates the architecture. Figure 1: Synthetic monitoring architecture with Amazon Nova Act and Amazon Bedrock AgentCore This architecture provides fully managed synthetic monitoring. Teams avoid maintaining brittle scripts or browser infrastructure. The following sections walk through setup requirements, journey definition, agent deployment, and scheduling infrastructure. Before implementing, confirm the following: Implementation begins by defining the most important customer journeys to validate. For ecommerce applications, these typically include homepage load, product search, product detail navigation, add-to-cart validation, and checkout readiness. Rather than focusing only on workflow completion, validate outcomes explicitly. The monitor should confirm that search results appear correctly, the cart contains items, and no error banners display. Explicit outcome validation reduces false positives from incomplete checks and false negatives from overly permissive assertions. The agent groups natural-language actions into logical journey steps and uses assertions at key checkpoints. Actions use act() to drive the UI through natural language. Assertions use act_get() with a boolean schema to validate outcomes. When a journey fails, the agent publishes the journey type, target URL, duration, completed steps, and failed steps. Detailed exception information remains in the runtime logs. The code uses the Nova Act SDK directly. When deployed to AgentCore Runtime, the execution environment manages browser session lifecycle through the Browser tool. In testing, a typical six-step journey completes in 2 to 4 minutes depending on page load times. Refer to the Nova Act User Guide for current method signatures and SDK version. The sample repository includes the complete agent definition with error handling and single-attempt step execution. Before the Amazon EventBridge schedule can invoke the agent, deploy it to AgentCore Runtime using the Nova Act CLI. The act workflow commands package the agent code, push the container image to Amazon ECR, and provision the runtime. Once deployed, the endpoint Amazon Resource Name (ARN) remains constant. Updates create new runtime versions without requiring you to update your Scheduler target. The act workflow show command returns the AgentCore Runtime ARN that you reference as the Scheduler target. The sample repository’s deploy.py script wraps these commands with prerequisite checks (Docker, AWS credentials), creates the SNS alert topic, and wires the Amazon EventBridge schedule, so a single python deploy.py performs an end-to-end deployment. (AgentCore also provides its own agentcore CLI for agent development. This sample standardizes on the Nova Act act workflow commands.) For a production-grade, repeatable deployment, the sample includes a CDK stack as a standalone alternative to deploy.py . It provisions the Amazon EventBridge schedule with least-privilege IAM permission, the SNS alert topic, and an SQS dead-letter queue that captures failed InvokeAgentRuntime calls from the Scheduler. The stack also creates two Amazon CloudWatch alarms: one on dead-letter-queue depth (failed Scheduler invocations), and one on missing scheduled runs (using the AWS/Scheduler InvocationAttemptCount metric, treating missing data as breaching). Note that these alarms detect infrastructure failures, such as a delivery failure to the agent or the schedule not firing. A functionally broken customer journey that still returns at the HTTP level surfaces through the agent’s SNS publish, not through these CloudWatch alarms. Focus synthetic monitors on high-value customer journeys rather than exhaustive page coverage. Over-monitoring creates noise that desensitizes teams to real failures. Start with 3-5 critical workflows (login, checkout, account access) and expand based on actual failure patterns and business impact. Monitor journeys that directly affect revenue or customer trust, not every possible user path. Similarly, avoid over-asserting on every page element. Validate meaningful outcomes (whether search results appear, whether the cart contains items) rather than checking every DOM element on the page. Overly granular assertions increase false positives without improving failure detection. The sample agent code uses single-attempt execution per step, which minimizes Browser session cost.
由 claude-code/sonnet 自動生成