Elastic Lightweight Monitor: ${host.name} no longer using current host name

I am deploying a lightweight project monitor to multiple hosts to check for the availability of a specific port on that host. Previously, the following worked:

heartbeat.monitors:
  - id: '09eb9559-ee3b-475f-ac4f-4f264f11318e'
    name: 'myapp'
    type: 'tcp'
    enabled: true
    alert.status.enabled: false
    hosts: 'https://${host.name}:8443'
    schedule: '@every 1m'
    timeout: '15s'
    privateLocations: ['my_private_location']

However, sometime fairly recently, it appears to have stopped parsing ${host.name} as the current host name, and I am getting the following error:

job could not be initialized: could not parse tcp host 'https://:8443'

I suspect that this means that it's trying to read ${host.name} as a parameter.

Because of the configuration of the web servers, I'm unable to use localhost:8443 as my address. Additionally, were I to do this, it would report the hostname as localhost for any alerts generated.

Is there any corresponding functionality for this? Am I able to do something like ${env.HOSTNAME}?

I'm currently using 8.15.1. This started sometime on 29 Aug, which appears to be when I upgraded my nodes to 8.15.0.

Thx!

Which operating system are you using?

Forgot that (sorry)...I'm seeing this in both Linux and Windows, but Windows is the more urgent of the two.

I am not sure what has been changed recently that would change the behaviour, let me see if there is any escape hatch. From which version did you upgrade?

Based on unit tests i have seen in code, behaviour has always been same though i believe it makes sense to not replace missing values, so i have made the PR to change it, most likely it will make 8.15.2 if got merged in time

I just updated from 8.15.0, updated to that from 8.14.3, when I believe it was working correctly.

i will test on 8.14.3 and report back.

1 Like

i tested again on 8.14.3 and as well found the behaviour same, i might be missing something :thinking:

FWIW fix has been back-ported and merged to 8.15.2 !!

Maybe I'm wrong about which version I updated from. I may have missed updating the agent to 8.14.3. In any case, it's probably not that relevant in this case, because...

Woot-woot! Thanks! :partying_face: