elasticsearchkibanaelastic-stack

Elasticsearch lightweight monitors unable to use params


I have a lightweight monitor defined in my @elastic/synthetics project defined as follow:

heartbeat.monitors:
 - type: http
   name: "XXXXX"
   id: "XXXX"
   enabled: true
   urls: ["${my_url}"]

and my synthetics.confing.ts is

export default (env) => {
   const config: SyntheticsConfig = {
     params: {
       my_url: "https://test.com/api/test",
     },
     playwrightOptions: {
       ignoreHTTPSErrors: false,
     },
    
     monitor: {
      schedule: 10,
      locations: [],
      privateLocations: ["dev"],
    },
    project: {
      id: "monitoring",
      url: "https://kibana.net",
      space: "myspace",
    },
  }
  if (env !== "customenv") {      
  }
  return config
}

when I push the monitors with the following command

NODE_TLS_REJECT_UNAUTHORIZED=0 NODE_ENV="customenv" SYNTHETICS_API_KEY=ccccc== npx @elastic/synthetics push

I get:

Error
   > Invalid Heartbeat configuration: monitor(XXXX)
       `http` project monitors must specify a valid URL for field `monitor.urls` in version `8.15.0`. Your monitor definition with ID `XXXX` was not saved.

Solution

  • it is a bug already fixed and it will be back ported to 8.15.4 https://github.com/elastic/kibana/pull/197797