Synthetic Monitoring

Hi, im having a problem when validating the heartbeat.docker.yml file.
It's failing on inline script thus the docker container did not continue.

Help?

Hi @inhinyera16,

can you provide the log output that shows the failure?

I tried testing the predefine inline code using below command

 cat examples/inline/short.js | npx @elastic/synthetics --inline

then i got this error, looks like the installation of npm. Any reference on how to setup npm/npx?

Thank you for providing the error message. This looks like a problem with the dependencies. Could you go a bit more into detail about how you set up the environment up to that point? Which installation steps did you take?

To add to @weltenwort's reply, you might try npm remove @elastic/synthetics followed by npm install @elastic/synthetics to see if that helps or produces a useful error message.

i followed the quickstart installation here.

cloned the repository in my local, then update only the heartbeat.docker.yml and keep the original run.sh script

For yaml,
I am trying to run the default config for synthetic_suites only

heartbeat.synthetic_suites:
- name: Todos
  path: "/opt/elastic-synthetics/examples/inline"
  schedule: "@every 1m"

I tried to run initially but got failed due to npm/npx dependencies.
so i installed npn using yum install npm
then npm install -g npx

it throws this error, see, even if i remove/install elastic/synthetics as per @Andrew_Cholakian1 i keep having this kind of error

What do i missed?

I think the issue comes from being in the wrong directory while running npm @elastic/synthetics.

One confusing thing here is that our examples are in the same directory as our source code. You really want to be in the examples/todos directory when running these commands. Running them from the root of the project creates issues because the root of the project itself is the @elastic/synthetics package, changing directory to the examples/todos directory breaks out of that since it has its own package.json from NPM.

I've created this patch to our docs to make things more clear if that helps: https://github.com/elastic/observability-docs/pull/289

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