Setup Synthetic monitoring automatically for application availability
After you deploy an application to IBM Cloud Pak® for Multicloud Management, by default Synthetic tests can be created automatically to monitor your application, without any additional setup. It's applicable to new IBM Cloud Pak® for Multicloud Management services that are deployed and existing services with Ingress endpoints.
In a Synthetic test, a simple REST API call pings Ingress endpoint of a service on a specific path or pings a webpage test and get the performance and availability results.
Synthetic test results can serve as a gate to move codes from one channel to the next, such as from staging period to test period or production period. It depends on whether the test results reach the performance and availability requirement.
Limitation: If there are multiple Ingress for an application in Red Hat® Advanced Cluster Management for Kubernetes, only one Synthetic test can be created automatically.
Procedure
You can follow the steps to create a new application and check its Synthetic test results.
- Go to Manage applications > Hybrid applications on IBM Cloud Pak console.
-
In the Applications page, click Create application from YAML or Create application from resources.
For more information about creating new applications, see Creating and managing application resources. -
Click the new application. In the Overview tab, click View Synthetic results.
-
In the Synthetic results page, find each result for the newly created application based on its Ingress and path.
-
Optional: If you want to configure a specific Synthetic test, follow the steps.
1.Go to Administer > Monitoring on the console, and click Synthetics Configure
-
In the Synthetics page, locate the Synthetic test, click
, and select Edit.
-
In the Edit synthetic test page, modify the Synthetic test settings.
For example, you can modify the test URL in the Request section as you need.
For more information about configuring Synthetics test, see Creating a REST API test.
Note:
Only IBM Cloud Pak® for Multicloud Management console administrator can configure Synthetic test settings.
-
-
To open the result details page, click the result name in the Synthetic results page.
-
View the Synthetic test results. For more information, see Viewing Synthetic test results.
What to do next
Auto-Configurator CronJob
controls automatic Synthetic monitoring for application availability. By default Auto-Configurator CronJob
is scheduled to run every 5
minutes and is not suspended.
-
You can configure the behavior of
Auto-Configurator CronJob
when you install Monitoring by changing the following parameters. For detailed steps about configuring parameters, see Monitoring configuration.-
monitoringDeploy.autoconfig.disableAlerts
Configure whether alerting on Synthetic test failures is available or not. Set it to true or false. The default value is
true
, which means alerting on Synthetic test failures is not available. -
monitoringDeploy.autoconfig.testActive
Configure whether generated Synthetic tests are active or not. Set it to
true
orfalse
. The default value istrue
, which means generated Synthetic tests are active. If you set the parameter tofalse
, then Synthetic tests are created but not run. -
monitoringDeploy.autoconfig.testInterval
Configure the default schedule interval (in minutes) of generated Synthetic tests. The default value is "5", which means the schedule interval is
5
minutes.Note:
After you install Monitoring, you can also change these parameters to update the behavior of automatic Synthetic monitoring for application availability.
-
-
You can run kubectl command to configure the behavior of
Auto-Configurator CronJob
.-
If you want to disable the function of automatic Synthetic monitoring for application availability, you need to stop the
Auto-Configurator CronJob
. Follow the steps:-
Run the command to check the CronJob name.
kubectl get cronjob -l component=autoconfig
-
Run the command to stop the CronJob.
kubectl patch cronjob <CronJob_name> -p '{"spec":{"suspend": true }}'
Where CronJob_name is the CronJob name that you get in the last step.
-
-
If you want to enable the function of automatic Synthetic monitoring for application availability again, run the command:
kubectl patch cronjob <CronJob_Name> -p '{"spec":{"suspend": false }}'
-
If you want to change the default schedule interval (
5
minutes) of the Cronjob, run the command:kubectl patch cronjob <CronJob_Name> -p '{"spec":{"schedule": "*/2 * * * *" }}'
Note:
The schedule interval is changed to
2
minutes after you run this command. You can change the number from 2 to any value as you need.
-