Troubleshooting Synthetics
editTroubleshooting Synthetics
editLocal debugging
editFor debugging synthetic tests locally, you can set an environment variable,
DEBUG=synthetics
, to capture Synthetics agent logs when using the
Synthetics CLI.
Common issues
editNo results from a monitor configured to run on a Private Location
editIf you have created a Private Location and configured a monitor to run on that Private Location, but don’t see any results for that monitor in the Synthetics UI, make sure there is an agent configured to run against the agent policy.
If you attempt to assign an agent policy to a Private Location before configuring an agent to run against the agent policy, you will see a note in the Synthetics UI that the selected agent policy has no agents.
When creating a Private Location, you have to:
- Set up Elastic Agent.
- Connect Fleet to your Observability project and enroll an Elastic Agent in Fleet.
- Add a Private Location in the Synthetics UI.
If you do not complete the second item, no agents will be configured to run against the agent policy, and any monitors configured to run on that Private Location won’t be able to run so there will be no results in the Synthetics UI.
To fix this, make sure there is an agent configured to run against the agent policy.
No results from a monitor
editIf you have configured a monitor but don’t see any results for that monitor in the Synthetics UI, whether running them from Elastic’s global managed testing infrastructure or from Private Locations, ensure Synthetics has a direct connection to Elasticsearch.
Do not configure any ingest pipelines or output via Logstash as this will prevent Synthetics from working properly and is not supported.
Browser monitor configured to run on a Private Location not running to schedule
editIf you have browser monitors configured to run on a Private Location but notice one or more of them are not running as scheduled, this could be because:
- The time it takes for your monitor to run is longer than the frequency you have set
- There may be too many monitors trying to run concurrently, causing some of them to skip their scheduled run
You may also see a message in the logs such as 2 tasks have missed their schedule deadlines by more than 1 second in the last 15s
. These will be visible from inside the Agent diagnostic ZIP file, and the numbers and time periods may be different in your logs.
Start by identifying the cause of the issue. First, check if the time it takes the monitor to run is less than the scheduled frequency:
- Go to the Synthetics UI.
- Click the monitor, then click Go to monitor.
- Go to the Overview tab to see the Avg. duration. You can also view the duration for individual runs in the History tab.
-
Compare the duration to the scheduled frequency. If the duration is greater than the scheduled frequency, for example if the monitor that takes 90 seconds to run and its scheduled frequency is 1 minute, the next scheduled run will not occur because the current one is still running so you may see results for every other scheduled run.
To fix this, you can either:
- Change the frequency so the monitor runs less often.
- Refactor the monitor so it can run in a shorter amount of time.
If the duration is less than the scheduled frequency or the suggestion above does not fix the issue, then there may be too many browser monitors attempting to run on the Private Location. Due to the additional hardware overhead of running browser monitors, we limit each Private Location to only run two browser monitors at the same time. Depending on how many browser monitors you have configured to run on the Private Location and their schedule, the Private Location may not be able to run them all because it would require more than two browser tests to be running simultaneously.
To fix this issue, you can either:
- Increase the number of concurrent browser monitors allowed (as described in Scaling Private Locations), paying attention to the scaling and hardware requirements documented.
- Create multiple Private Locations and spread your browser monitors across them more evenly (effectively horizontally scaling your Private Locations).
No locations are available
editWhen using Elastic Cloud, if there are no options available in the Locations dropdown when you
try to create a monitor in the Synthetics UI or if no locations are listed when using the
location
command, it might be because you do not have permission to
use Elastic managed locations and there are no Private Locations
available yet.
There are a few ways to fix this:
- If you have Editor access, you can create a new Private Location. Then try creating the monitor again.
- If you do not have the right privileges to create a Private Location, you can ask an Admin to create a Private Location or give you the necessary privileges so you can create a new Private Location. Then try creating the monitor again.
Get help
editElastic Support
editWe offer a support experience unlike any other. Our team of professionals speak human and code and love making your day. Learn more about subscriptions.
Discussion forum
editFor other questions and feature requests, visit our discussion forum.