I am using the new synthetics approach using a Typescript project. All docs indicate that parameters/secrets can be used in both lightweight and journey/browser code. I am not able to do so can do either or.
Docs indicate having this in the synthetics.config.ts:
config.json is a simple JSON object with key/values - have a local version and is transformed in CI/CD for different environments and works as expected for synthetics. Note we are still on 8.7.1 so wonder if a bug that we should upgrade? Also running from a private location that is the correct docker image - synthetic monitor runs fine.
Here is a screenshot of the lightweight monitor deployed to elastic:
Updated the fleet agent to 8.8.1 as well.
Anything else I can check? This is blocking hard now as heartbeat monitors appear to be depreciated in 8.8.1 as i not longer see those in uptime.
@Ben_Berg1 can you take a look at the actual document that you are receiving from heartbeat?
We actually discussed this internally and in the UI we don't display the parsed value which i can understand is bit confusing. I will create an issue to discuss this and whether UI should show the parsed value.
You can take a look at the actual result you are receiving in discover by creating a data view with synthetics-* pattern.
Another issue that i can think of is migration. Change a config a bit and push the monitor again.
or you can simply test a new monitor.
let me know if you need help with checking data in discover.
Thanks @shahzad31 - there was no data in the synthetics index but I have it working now. It appears the id field for the heartbeat.yml cannot contain parameters. Once i removed the parameter there it did go from pending to running the monitor.
Good to know on the UI. Be interested in hearing others thoughts there, I could see either way being useful. I did notice in the list view the name isn't parsed but within the monitor view the values appear to be parsed which i think is valuable.
I think i will just move some of the metadata i was trying to put in the id to separate and put in tags. I won't have same ID in any monitors in the same project as each environment has own project ID.
On a similar but separate note, can environment variables be defined outside of the config and used by the synthetics? I am using AWS and would like some of the data to come from environment variables defined on the ECS task (env vars for the docker agent) to be used. Is this a good approach? Thinking on how to keep some secure values out of the parameters defined in monitor and we use AWS secrets manager/docker environment variables currently in heartbeat monitors. Assuming it will work same way but thought I'd ask before testing/validating.
Thanks again for your help.
The monitor tags not getting applied to all pushed monitors is already tracked in this issue where we are consolidating how tags should behave similar to other parameters like locations.
Also, I would like to understand more about your use case on why you would want to tie in your monitor name with environment when the URL for the monitor is going to be the same in the latest test.
Thanks for the link @vigneshshanmugam .
For using the environment in monitor name it is to be able to see what environment the synthetic is running on easily. We have 2 elastic cloud deployments currently, one for local, dev, and staging and one for prod.
We deploy monitors for dev and staging through CI/CD and the urls would be for different environments. Local is used for local testing of synthetics and have basically same configuration as dev but aren't super critical expect during development of synthetic monitors.
We could use tags likely just as well to filter and seems filtering by project also works - just trying to find a fool proof way for consumers of the monitor data to know what environment they are working with and the environment name in the name seems like a very hard thing to miss!
Thanks again!
Ben
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.