Set dynamic headers in every request

Hi,

We are monitoring a series of machines with heartbeat and we have a special casuistic in which we need heartbeat to send the timestamp in which the request is made, we don't care if by headers, params, or query params.

Is it possible in each execution to add the dynamic timestamp to a header for example? By using javascript or elastic variables. Something like:

  check.request:
    method: GET
    headers:
        'Content-Type': 'application/json' 
        'X-Heartbeat-Timestamp': {{timestamp}}

Regards and thanks in advance.

Hi @rbr66 - thanks for your interest in Heartbeat.

Heartbeat does not support the type of use case you describe today. That being said, we are planning to add a feature to our Synthetics agent that will allow this type of flexibility and much more in the future.

Today there's a great deal of flexibility within synthetic browser journeys that allows users to write custom scripts, import frameworks, etc., and this would extend that same flexibility to our lightweight monitors as well.

Have a look at the issue linked, and if you have concerns feel free to make any suggestions. Please let us know if we can provide any further info.