Monitoring endpoints with Synthetic tests
You can use the Synthetic Monitoring user interface to create and manage Synthetic tests and Smart Alerts for such tests.
- Creating a test
- Viewing the summary for a test
- Viewing the list of results for a test
- Viewing Smart Alerts for a test
- Viewing the configuration for a test
- Viewing test result details
- Instana integration
Creating a test
To create a Synthetic test, go to Synthetic Monitoring > Tests > ADD > Add Synthetic Test, and then complete the steps. Use the Create Synthetic Test wizard or click Switch to Advanced Mode to view additional options.
The advantages of the wizard are:
- Guided steps
- Quick creation of a basic Synthetic test
The advantages of advanced mode are:
- You can define many optional settings for your test definition
- Using advanced mode aligns more closely with defining a test by using the Open API
- SSL Certificate test is only available by using advanced mode
You can choose one of the following test types:
- API Simple test to perform a single REST call to a URL or API endpoint. It is equivalent to the HTTPAction test type.
- API Script test to perform a complex test by using a script that you enter or upload. It is equivalent to the HTTPScript test type.
- Browser Simple test to test a webpage URL. It is equivalent to the WebpageAction test type.
- Browser Script test to test web applications by using a Node.js script or a recorded Selenium IDE script that you upload. For more information about the browser script, see browser script guide.
- SSL Certificate test to check whether a web server certificate is nearing expiration. This test type can only be created by using advanced mode.
Creating a test by using the wizard
To create a Synthetic test, complete the following steps:
- Go to Synthetic Monitoring > Test.
- Click Add Synthetic Test. The Create Synthetic Test wizard is displayed.
- In Step 1: Select type, select the type of test that you want to create:
- API Simple for an HTTP GET method to a URL of your choice. In Instana 250 and earlier versions, it is labeled as HTTPAction.
- API Script to upload a JavaScript file or enter the script into the input box. In Instana 250 and earlier versions, it is labeled as HTTPScript.
- Browser Simple to check a webpage for HTTP errors.
- Browser Script to simulate user actions with your web application by using a Node.js script or a recorded Selenium IDE script.
-
Click Next, the Step 2: Request details dialog is displayed.
- For an API Simple test, provide the URL. For the test to be run successfully, the URL must be in one of the following formats
https://www.YourCompany.com
orhttp://www.YourCompany.com
. The portionhttps://www
orhttp://www
is required. To create a Synthetic test with a different HTTP method, use the Open API. Refer to the Synthetic monitoring section of the Open API documentation.
- For an API Script test, upload a file or enter the script in the box. Basic JavaScript validation is run against the script.
- For an API Simple test, provide the URL. For the test to be run successfully, the URL must be in one of the following formats
- For a Browser Simple test, provide the URL of the webpage. Select the Deploy PoP to run the test at this location.
- For the Browser Script test, upload a Node.js script or a recorded Selenium IDE script. Select the Deploy PoP to run the test at this location. Basic JavaScript validation is run against the Node.js script. No validation is run for a Selenium IDE script.
- For all test types, select the locations for the test to run.
- Click Next, the Step 3: Scheduling dialog is displayed, select the test run frequency.
Select the frequency by using the slider. You can select any interval from 1 minute to 120 minutes. The interval that you select is applied on each PoP where the test is assigned to run the test repeatedly.
- Click Next, Step 4: Provide details dialog is displayed, identify the test.
Give the test a name (required) and a description (optional). If the test is associated with an application that is also monitored by Instana, you can select the application name from the list, or use the search button to find the correct application name. You need not assign a name for the application. You can create a Synthetic test that is not associated with an application.
Creating a test by using advanced mode
To create a Synthetic test, complete the following steps:
- Go to Synthetic Monitoring > Test.
- Click Add Synthetic Test. The Create Synthetic Test wizard is displayed.
- Click Switch to Advanced Mode.
- Complete one of the following steps:
- To test an API, select API then select one of the following test types:
- To test a single REST API, select API Simple Test.
- To test the sequence of multiple REST APIs, select API Script Test.
- To test an API, select API then select one of the following test types:
- To test a webpage, select Browser then select one of the following test types:
- To test a single webpage, select Browser Simple Test.
- To test web applications, select Browser Script Test.
- To test an SSL Certificate, select SSL Certificate, then click on Select button since test type is selected by default.
-
In Configuration: How will this test work?, enter the details depending on the test type that is selected in step 4.
- For API Simple test, provide the URL or API endpoint. For the test to run successfully, the URL or API endpoint must begin with 'https://www.YourCompany.com' or 'http://www.YourCompany.com'. The portion 'https://www' or 'http://www' is required. To create a Synthetic test with a different HTTP method, use the Open API. See Synthetic monitoring section in the Open API documentation.
Optional: Define the following elements for an API Simple test:
- Header: You can add one or multiple header elements. Each header element is added to the test by the PoPs when the test is run. You can also use $secure to refer to your user credential or $synthetic to refer to an environment variable in the
Value
field, such as$secure.API_TOKEN
or$synthetic.LOCATION
. - Body: You can define specific content to include in the body of the request. Only one body element can be added. The body element is added to the test by the PoPs when the test is run.
- Validation String: You can define a string that should appear in the response when the test has run. Only one validation string element can be added. When the test is run, if the string is missing, the test fails.
- expectStatus: You can define the expected HTTP return code for the test. If the return code does not match when the test has run, the test fails. Only one expectStatus element can be added. Use the drop-down menu to
select the desired
expect
condition. Use Add Validation to add more than oneexpect
condition. You can add one of each type ofexpect
condition to a test. - expectMatch: You can provide a regular expression to check when the test runs. Only one expectMatch element can be added. If the expression is not matched when the test is run, the test fails. Use the drop-down menu
to select expectMatch. Use Add Validation to add more than one
expect
condition. You can add one of eachexpect
condition to a test. - expectJson: You can provide a json snippet to check when the test runs. Only one expectJson element can be added. If the
json
file is not matched when the test is run, the test fails. Use the drop-down menu to select expectJson. Use Add Validation to add more than oneexpect
condition. You can add one of eachexpect
condition to a test. - followRedirect: This flag is set to
true
by default. You can change this behavior to disallow redirection by deselecting the box. - allowInsecure: The flag to enable testing of HTTP endpoints. The flag is set to
true
by default. You can change this behavior and prevent insecure URLs for your test by deselecting this box.
- For API Script test, select Add Script. An additional view is displayed where you can enter the script in the box, upload a single file, or upload a bundled set of scripts in a
zip
file. For more information about how to create a bundled set of scripts see Creating a bundled api script test.
If you upload a single script file, the contents of the file appear in the text box. Basic JavaScript validation runs for a single uploaded script and a manually entered script. You can correct the script in the text box. If you uploaded the script and changed it in the text box, the script file is treated as if it was manually entered. If you upload a bundled set of scripts, you must enter the name of the main script in the input box.
-
Select Add to accept the script or bundle and return to the Configuration section view.
- For Browser Simple test, provide the URL of the webpage to be tested. For the test to run successfully, the URL must have the form 'https://www.YourCompany.com' or 'http://www.YourCompany.com'. The portion 'https://www' or 'http://www' is required.
- For Browser Script test, select Add File. An additional view is displayed where you can upload a single Node.js script, a bundle of scripts, or a single Selenium IDE script.
If you upload a Node.js script file, the contents of the file appear in the text box. Basic JavaScript validation runs for the script. If you upload a bundle or a Selenium IDE script, no validation runs.
-
Select Add to accept the file and return to the Configuration section view.
-
For SSL Certificate test, provide the hostname, port and the number of days before certificate expiration when the test should begin to fail.
The remaining sections in advanced mode apply to all types of tests.
- In the Locations section, click Select Location. A list of locations that are available to you and that support the test type is displayed. Select the checkboxes for your choice of locations, or use the
search box to find a location and select its checkbox. Select Add Locations to add the location and return to the Locations section. To remove a location from the selected locations, use the
minus
icon at the end of the row.
- For API and Browser test types, the Schedule section is the same in advanced mode and wizard mode. Select the frequency by using the slider. You can select any interval from 1 minute to 120 minutes. The interval that you select is applied on every PoP where the test is assigned to run repeatedly.
- For SSL Certificate test in advanced mode, use the slider to select an interval from 1 hour to 24 hours. The default frequency for this test type is one run every 24 hours from each selected location.
- In the Identify section, the
Name
parameter is required. The following parameters are optional:
- Description: The description of the test.
- Application: If the API or endpoint that is being tested is associated with an application that is also being monitored with Instana, you can associate the test with the application. Use the list and extend it by selecting Load more or use the search box to find the application name and select it. Only a single application name can be selected.
- In the Custom Property section, you can specify one or more key-value pairs as custom properties. These properties become part of the test definition and the test results. You can use these properties to locate, sort, or filter tests and test results. Select Add Property to add additional custom properties. The number of properties that can be added to a test has no limit. If you add a property and want to remove it before creating the test, select the trash icon at the end of the row for that property.
Viewing the summary for a test
To view the summary for a test, select a test on the Tests tab of the Synthetic Monitoring page.
The Summary tab displays aggregated information about a single Synthetic test for the selected time period. The page also has a tab that lists the test results, a tab that displays Smart Alert configurations, and a tab to view or change the test configuration.
The Summary tab displays KPIs for the test such as the success rate during the time period across locations, the number of locations where the test runs, the average response time of the test runs, and the average response size, if applicable.
Graphs of Failures, Response Times, and Response Sizes are displayed with data from each location if applicable. If more location labels appear on the charts than appear in the "Locations" KPI, then it means that the test was not running at all assigned locations during the selected time period.
The Results widget lists the top 5 results based on the selected filter. You can view the slowest results (those with the longest response time), the most recent results or the failed results. Each row in this widget is a link that will take you to the detailed view of that particular test run.
If the selected test is an API Simple test, you can see two additional charts on the Summary tab: a graph of network timings that show the breakdown of the network communication and a chart of the HTTP return codes that are received.
If the selected test is an SSL Certificate test, you can see a set of Last Run widgets with information about certificate validity, time to expiration and expiration date. Response Size is not applicable for this test type so those widgets can not be seen.
Viewing the list of results for a test
To view the list of results for a test, select the test on the Tests tab of the Synthetic monitoring main page, and then click the Results tab.
The Results tab displays a list of results from your selected test. You can sort the list on any column. You can filter the list by using the Status and Location filters. The search box lets you search for all results from a "Location". The test results are listed by the time the test was run. Successful test results appear in the list in the form 'nn minutes ago' with a green indicator. Failed test results appear in the list in the form 'yyyy-mm-dd, hh:mm:ss' representing the time of the failure. They appear with a red indicator.
For an SSL Certificate test, instead of Response Size, you can see days remaining until certificate expiration.
Viewing Smart Alerts for a test
To view the Smart Alerts for a test, select the test on the Tests tab of the Synthetic monitoring main page, and then click the Smart Alerts tab.
The Smart Alerts tab displays the configured Smart Alerts for your selected test.
To view details of a Smart Alert, select the Smart Alert entry. You can also edit, duplicate, or delete the Smart Alert by using the ellipses menu.
For more information about working with Smart Alerts, see Smart Alerts for Synthetics.
Viewing the configuration for a test
To view the Configuration for a test, select the test on the Tests tab of the Synthetic monitoring main page, and then click the Configuration tab.
In the Configuration tab, you can view the test's configuration, locations, schedule, and identification.
If you want to delete the test definition, select the trash can icon. You are prompted to confirm whether you want to delete the test. You must enter the word SYNTHETIC
in the text box in the confirmation dialog to complete the
deletion request.
If you want to edit the test definition, select the pencil
icon. The complete test definition is then displayed. You cannot change the type of the test, but you can modify the rest of the configuration. The following modifications
are supported for the tests:
- API Simple test: You can change the URL or API endpoint and modify any of the optional elements.
- API Script test: You can edit the single script or upload a new file or bundle.
- Browser Simple test: you can change the URL.
- Browser Script test: if you added a single script, you can change it in the text box. If you uploaded a script or bundle, you can upload a new file or bundle or switch from a single file to a bundle.
- SSL Certificate test: You can change the hostname, the port number, and the number of days before expiration when the test should fail.
- All test types: You can modify the locations where the test needs to run, the scheduled interval between test runs, the associated applications, and the custom properties.
You should be aware of the following limitation:
Some test properties cannot be modified on the Instana UI; you can use the APIs or the 'synctl' tool to update these properties. If you update a Synthetic test by using the UI and API or 'synctl' tool at the same, an error message is displayed. The error message indicates that the test is being modified in another method. Save the changes before you switch the update method.
Viewing test result details
To view the test result details page for a single test run, either select an entry from the Results tab in the Summary tab or select an entry from the Results widget in the Summary tab. The tests that run successfully and the tests that failed are displayed differently in the Instana UI.
The test result details for each type and status of Synthetic test are slightly different. All results have the KPIs that show the time of this result, the status, the response time, the number of requests that are made by the test, and the response size if applicable. SSL Certificate test shows the certificate validation.
SSL Certificate test type shows the applicable KPIs and the Failures widget. The Failures widget includes a message indicating the number of days until expiration and the number of days before expiration that the test is defined to fail.
For all other test types:
- If the test has run partially or to completion, the Timings will be displayed. The timings of each request can be expanded to view more details. If the test has not gotten far enough to make a request, no timings are available.
- Failed tests include a Failures widget with a stack trace that can be collapsed. Failed tests also have a Logs widget. Click the text of the first log message to expand or collapse the log messages. These are the logs that are captured by the PoP during the execution of the Synthetic test.
- The console logs and the browser logs are displayed for failed Browser Simple and Browser Script tests.
- To download the Browser Simple and Browser Script test logs, click Download Logs.
- To download the Browser Simple and Browser Script test log archives, click Download HAR File.
- To view screenshots for Browser Simple and Browser Script tests, click View Screenshots.
An API Simple test result detail is as follows:
The Failed Run (Exception) section is shown only for a failed test.
The test results for an API Script test are shown in the following example:
If an API Script test failed, the Failed Run (Exception) section is shown with the error messages and stack traces:
To display detailed log messages, click the Logs section:
The test results for a Browser Simple test are shown in the following example:
The test results for a Browser Script test are shown in the following example:
The test results for an SSL Certificate test are shown in the following example:
Instana integration
-
Applications: When you create a Synthetic test and associate it with an application that is already monitored by Instana, you can link between the Synthetic Monitoring page and the Applications page for the applications in the Instana UI. If an application has Synthetic tests associated with it, a new tab Synthetic monitoring appears in the display of a selected application. This tab lists the associated Synthetic tests and lets you use links in the page to go to the Synthetic test UI. On the Tests tab of the Synthetic monitoring main page, you can use the application name in the row to link to the selected application in the Applications page.
-
Events: If you create an alert for a Synthetic test and that alert fires, you can see it in the Events view. If you select an alert, you can see a graph of failures and a link to the failing Synthetic test results. Similarly, from the Summary tab of a Synthetic test, you can use the alert indicators to link to the details of the alert in the Events view.
Click a Synthetic Smart Alert event entry:
Click View Alerting Configuration:
You can edit, duplicate, or delete an alert from the Alert Configuration page. To create an alert, click ADD SYNTHETIC SMART ALERT.
If an Instana agent is deployed in the same Kubernetes environment but no PoP sensor is deployed, you can find the details of the Kubernetes namespace from Synthetic Monitoring > Locations. Click the name of a namespace to view the details.
To find the details of the Kubernetes environment in which the PoP is deployed, complete the following steps:
- Go to Synthetic Monitoring > Locations and then click the name of a location. The Synthetic PoP @ < the location label > page is displayed.
- Click Instana Synthetic PoP. The details of the namespace are displayed.