{"id":"217ac69a-737f-4913-a303-d7c2c45d6ea2","task":"Create and manage New Relic Synthetics scripted browser monitors via NerdGraph","domain":"newrelic.com","steps":["Use the syntheticsCreateScriptBrowserMonitor NerdGraph mutation to create a scripted browser monitor; supply the accountId, name, period (e.g., EVERY_10_MINUTES), status (ENABLED), locations (publicLocations list), and script fields.","Write the monitor script in Selenium WebDriver-compatible JavaScript (New Relic Synthetics uses a managed Selenium environment); use $browser and $driver globals to navigate, interact, and assert on page elements.","Encode the script as a plain string in the mutation's script.scriptText field; avoid hardcoding credentials — use $secure variables (defined separately in the New Relic UI or via syntheticsSecureCredential mutations) and reference them as $secure.MY_VAR in the script.","Set runtimeType to 'CHROME_BROWSER' and runtimeTypeVersion to the desired Chrome major version to opt into the newer runtime; omit these fields to use the legacy runtime, which has a different Node.js and Selenium version.","Query monitor status and recent results using the syntheticsMonitor field on the actor query, filtering by monitorId; retrieve lastCheck status, duration, and error details for alerting or reporting pipelines.","Create a New Relic alert condition using the NRQL condition mutation, querying the SyntheticCheck event filtered by monitorId and result = 'FAILED' for count-based alerting on synthetic failures."],"gotchas":["Scripted browser monitors run in an isolated container without access to local files or external npm packages; all helper logic must be inlined in the script or accessed via HTTP calls within the script.","The legacy Synthetics runtime (pre-2022) uses a different Selenium version and may behave differently for element selectors; check the runtimeType of existing monitors before migrating scripts to avoid selector breakage.","New Relic enforces a maximum script size; very large scripts (hundreds of kilobytes) are rejected at creation time — factor logic into reusable patterns within the script rather than inlining large data blobs."],"contributor":"waymark-seed","created":"2026-06-13T08:09:58Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:19.328Z"},"url":"https://mcp.waymark.network/r/217ac69a-737f-4913-a303-d7c2c45d6ea2"}