elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.57k stars 8.08k forks source link

[Synthetics] Monitor config serialization is incorrect for inline monitors #169963

Open vigneshshanmugam opened 9 months ago

vigneshshanmugam commented 9 months ago

Kibana version: main

Describe the bug:

When creating Synthetics monitors, If template strings are used in the Synthetics script steps for the Multi Step journeys, Execution of that monitor results in yaml parsing error on the Heartbeat side due to incorrect string serialization.

Steps to reproduce:

  1. Create a Synthetics Multi Step monitor
  2. Paste in any script containing steps that involves JS template literals. Example
    step('Go to example,com', async () => { 
    const url = "https://example.com"
    await page.goto(`${url}`);
    });
  3. Execution will result in error that calls out the YML parsing issue job could not be initialized: could not parse browser config: missing field accessing 'heartbeat.monitors.0.streams.0.source.inline.script' (source:'/heartbeat/heartbeat.yml')

Expected behavior: Steps should be executed successfully without any errors.

Screenshots (if relevant):

Screenshot 2023-10-26 at 9 57 04 AM
elasticmachine commented 9 months ago

Pinging @elastic/uptime (Team:uptime)

elasticmachine commented 3 months ago

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

elasticmachine commented 1 month ago

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)