Troubleshooting Synthetics

edit

[preview] This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.

Local debugging
edit

For debugging synthetic tests locally, you can set an environment variable, DEBUG=synthetics, to capture Synthetics agent logs when using the Synthetics CLI.

Common issues
edit
No results from a monitor configured to run on a Private Location
edit

If 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:

  1. Set up Elastic Agent.
  2. Connect Fleet to your Observability project and enroll an Elastic Agent in Fleet.
  3. 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
edit

If 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
edit

If 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:

  1. Go to the Synthetics UI.
  2. Click the monitor, then click Go to monitor.
  3. Go to the Overview tab to see the Avg. duration. You can also view the duration for individual runs in the History tab.
  4. 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
edit

When 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:

Get help
edit
Elastic Support
edit

We 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
edit

For other questions and feature requests, visit our discussion forum.