Skip to content

[Heartbeat] Suite Monitor discovery mode #29917

@vigneshshanmugam

Description

@vigneshshanmugam

Issue

Currently, we don't have a good way to deal with these below situations when one of the error occurs on running monitors that are zip url endpoints.

Network Error : ZIP url endpoint is not reachable, downloadable.
Syntax Error: Cannot run journeys due to syntax errors in one of the journey files
Run Error: Duplicate journey Id's.

Proposal

Introduce a discovery mode in Heartbeat that would create essential documents for the UI to create monitors based on the journeys. See also #30571 , for caching the discovered zips on a cloud storage endpoint for the service

  • Add a discovery flag to the existing monitor runs
heartbeat.monitors:
 - id: elastic-monitor
  name: Elastic Monitor
  discovery:
    enabled: true
      # optional, place to re-upload the downloaded zip for subsequent executions.
    source_cache:
      gcp_cloud_storage:
        signed_url: ""https://presignedgcpstorageurl"
  schedule: '@every 1m'
  source:
    zip_url: 
      url: "https://github.com/elastic/synthetics-demo/archive/refs/heads/main.zip"
  • Create the documents for the discovery mode and send them to the ES. The new documents are created differently than the existing format to avoid changing the queriers on the Uptime UI.

Error cases

  • Syntax/Network errors would contain only the Top level error event
{
  "suite": {
     "id": "elastic-monitor",
     "name": "Elastic Monitor"
   },
   "source_cache": {
     "google_cloud_storage": {"signed_url": "https://presignedgcpstorageurl"}
   },
   "journeys": [],
   // top level error 
   "error": {
     "message": "invalid syntax - failed with exit status 1",
     "stack": "/test.journey.ts"
   } 
}
  • If we can execute the synthetics runner, other related errors include duplication would be reported this way.
{
  "suite": {
     "id": "elastic-monitor",
     "name": "Elastic Monitor"
   },
   "source_cache": {
     "google_cloud_storage": {"signed_url": "https://presignedgcpstorageurl"}
   },
   "journeys": [
     {
       "id": "j1",
      "name": "journey-1"
     },
     {
       "id": "j",
        "name": "journey-2",
       "error": {
         "message": "duplicate monitor ID",
         "stack": ""
       }
     }
   ],
   // top level error 
   "error": {
     "message": "one or more journeys had errors"
   } 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions