Elastic Synthetics Environment Variables

A quick question.

At one point, when writing an @elastic/synthetics journey and pushing it to Elastic Synthetics via npx @elastic/synthetics push, Elastic Synthetics would push the local values of any environment variables and would ignore the environment variables defined on the agent when running tests, even if no local values were pushed.

It appears that this has changed at some point (which is a good thing, IMO). However, I can't find any reference to this in either the changelog or the documentation.

Can you please confirm whether this has, in fact, change and point me to the changelog entry or documentation showing this (preferably both)?

This will certainly make it easier for me to allow my users to manage their own tests via a CI/CD pipeline.


Hi @DougR,

When running npx @elastic/synthetics push command, The environment variables defined in the params field of synthetics.config.ts file only gets pushed to the remote Kibana instance as part of the monitor configuration. Any other environment variables are dropped and never gets pushed.

// synthetics.config.ts

export default () => {
  return {
    params: {
      enable: process.env["ENABLED"]

I am not sure when we resorted to pushing everything vs what we are doing right now. As far as I can remember, it always worked this way. Please let us know if you have any other questions.


There must have been an issue at the time I validated this then. The only thing that matters is that it's not happening now.


1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.