In this section, we will take a detailed look at configuring monitoring for API App endpoints. An API App can specify a URL endpoint/multiple endpoints that returns metadata for the API in Swagger JSON format. With BizTalk360, you can monitor the health of the API App as well as the configured endpoints. In this article, we will take an in-depth look at the API Apps endpoint monitoring screen. The pre-requisite to configure monitoring for API app endpoint is that you need to add your Azure subscription into BizTalk360 in order to allow BizTalk360 to retrieve the information from Azure (active directory).
Click the links below to navigate to the corresponding section -
- API Apps screen
- Basic endpoint details configuration
- Optional details configuration
- Response alert configuration
- Endpoint summary
API Apps screen
- Log in to BizTalk360
- Click Monitoring on the top of the left navigation menu
- Expand Manage Mapping and select Azure Services
- If there are no Azure subscriptions mapped to your environment, you will see a warning message as "No Azure Subscriptions Found/Enabled". Click "Go to Settings to Add/Enable". Refer this article to know the details of adding a new Azure subscription.
- If there is an active Azure subscription available, you will see the list of API Apps in the grid
- If any API App has an active URL endpoint(s), you will notice an expand icon (v) on the grid against the API App grid row
You will not see the expand icon if the API App does not have a URL endpoint(s)
- Click the expand icon. This will list the active endpoints under the particular API App.
- Select the checkbox to set up the Azure API App Endpoint monitoring
- API - Name of the API as defined in Azure API Apps
- Is Monitoring Enabled - The default status is set to No. Once you set up monitoring for the endpoint, you will see the status changing to Yes.
- API URL - Displays the URL of the API
- Current State - The default state is set to Unknown. When monitoring is enabled for the API App endpoint, the current state will display the exact status of the endpoint (Healthy or Error).
- Reason - The reason for the state (explained in step 5). For instance, the response time exceeded the time specified for warning and error.
- Summary - A detailed endpoint summary giving the condition and the current state of the endpoint. Return code alerts takes the first priority. Keyword/ XPath/ JSON/ Response time alerts will only be validated if Return code alerts are healthy. In case of multiple Return code alerts (Ex. Error and Warning), the alert with the highest priority (Error) will be considered as the result. In case of multiple high priority Return code alerts (Ex. Error, Error, Warning), the alert with the highest priority (Error) that occurred in the first instance will be considered as the result.
Basic endpoint details configuration
In this section, we will take a detailed look at the basic endpoint details screen to enable monitoring of API App endpoints in BizTalk360. The basic details page is the first page that is displayed when you try to configure an API App endpoint monitor. Follow the steps as shown below to navigate to the basic details screen of API App endpoint monitoring.
- Log in to the BizTalk360 application
- Click 'Monitoring' in the navigation panel
- Click the + button against 'Manage Mapping' tab and select 'Azure Services'
- Select the Alarm name (see Creating an alarm) from the drop down for which you would like to associate the alerts
- Choose the Azure subscription from the drop downIf there are no Azure subscriptions mapped to your environment, you will see a warning message as "No Azure Subscriptions Found/Enabled". Click "Go to Settings to Add/Enable". Refer this article to know the details of adding a new Azure subscription.
- Select the API Apps tab. This will list the API Apps that are created under the selected subscription.
- Click the expand icon (v) against the API AppIf there are no endpoint URL associated with the API App, you will not see the (v) icon
- Select the check box against the API that you wish to monitor using BizTalk360. You will notice that the Configure API App Endpoints button will get activated when you select the API.
- Click the Configure API App Endpoints button. This will open a new blade with the following information -
- Friendly name - The friendly name will be pre-populated with the name of the API. You cannot edit the value in this field.
- Endpoint URL - The URL of the web endpoint, for e.g., http://www.microsoft.com, http://www.google.com. This will also be pre-populated with the URL of the API App endpoint, however, you can change the value of this field.
- Enable Monitoring - This toggle must be enabled in order to set up monitoring for the API App endpoint
Optional details configuration
In this section, we will take a detailed look at the optional settings available in the second (blade) screen that is displayed when setting up monitoring for an API App endpoint URL. Follow the steps as shown below to navigate to the optional details screen of API app web endpoint monitoring. All the details on this page are optional. You can choose to skip them if they are not required. You also need to remember that skipping the details in this section will start monitoring the endpoint based on the default selection ("Response Time Alerts") in the next screen.
Payload - You can use the Payload section to add external parameters to the endpoint URL (as appropriate). For example, let's assume you have an API that retrieves the description and id of the daily tasks you have to perform on your pet dog. Let's say, the first task is to feed the dog with an id of "0". The second task is to "take the dog on a walk" with id of "1". You can pass the id as a payload to the API URL to exactly retrieve the task specific to the id.
The payload section has the following options that users can choose to monitor their preferred endpoint.
Request Methods - GET method to get the payload as input for the endpoint URL
- HTTP Version - Choose the version of HTTP (HTTP/1.1 or HTTP/1.0)
Get Parameters - The two parameters (Key and Value) that have to be passed along with the endpoint URL. For example, value of the id and the task to perform on the dog. Enter the values in the space provided. You can add multiple parameter values by clicking the + button. Click the Delete icon to delete the parameter value.
- Request Methods - GET method to get the payload as input for the endpoint URL
Custom Header - You can pass custom headers along with your endpoint URL and monitor the endpoint based on the return code or keyword/response time alerts. You need to pass the Custom Header Name and Custom Header Value for the custom headers. You can add multiple custom header values as required by clicking the + button.
Response Alert Configuration
In this section, we will take a detailed look at the different options that are available in the third screen that is displayed when configuring monitoring for an API App endpoint URL.
Response Format - You need to select the type of response format that you will receive when the monitoring service tries to access the API App URL web endpoint. The different options available are - Plain Text, XML, and JSON.
Depending on the Response format selection, the second option in the response alert configuration will change automatically. For Plain Text, you will notice Keyword Alerts, for XML, it will be _XPath Alerts, and for JSON, it will be _JSON path Alerts.
Return Code Alerts - You can set up monitoring for the API App URL web endpoint and set up alerting based on the return code that is generated by the endpoint. You can define monitoring such as "Set up a monitor on the API App URL endpoint and the status should be Healthy if the return code is 200. Otherwise, throw a warning/error and set the status appropriately." To achieve this, you need to define 3 parameters -
- Status Code - This is the return code that you expect from the endpoint if it is active
- Expected Status - This expected status of the return code in the response alert. You can choose between Must be Present and Must be Absent
Else - This section will get triggered when the logic fails for the expected status value. For instance, if you set the expected status code (200) to "Must be Present", and the actual return code from the web endpoint is 404, then in this case the else section will get executed and the health status of the web endpoint will be displayed as Error or Warning depending on the value selected.
_JSON Path Alerts / _XPath Alerts - Similar to return code alerts, you can set up monitoring and set the alert configuration to the _JSON Path and _XPath Alerts. You need to define the following 3 parameters -
- XPath / JSON Path - Enter the XPath/JSON Path in the space provided. You can find a sample example format given in the text box. You need to enter the path in the specified format only.
Expected value - Enter the expected value that the XPath/JSON Path will return. If the actual returned value is the same as the expected value, you will notice the endpoint health status to be Healthy. However, if the returned value is different from the expected value, the endpoint health status will be displayed as Error or Warning depending on the status defined in the Else section (shown below).
Else - This section will get triggered when the logic fails for the expected status value. For instance, if you set the expected value to $7.95, and the actual value returned by the XPath or JSON path is $5.95, then the else section will get executed and the health status of the web endpoint will be displayed as Error or Warning depending on the value selected.
Response Time Alerts - You can set up monitoring for the API App URL web endpoint based on the response time alert. You can specify the minimum and maximum time by which the end point should send a response back. If the time exceeds the minimum/maximum time, the endpoint will be shown in the Error state. The default warning time is 2 seconds, and the error time is 7 seconds.The Response Time Alerts will be selected by default. Even if you do not choose the Return Code Alerts or _JSON Path alerts/XPath alerts, the web endpoint will be monitored against the response time alert values. In case you try to disable the response time alerts toggle bar, you will see an error message as "Please Make sure atleast one Alert section is enabled."
Depending of the endpoint configuration, you will see the current status of the endpoint monitor as either Error, Warning, or Healthy. In case of the Warning or Error status, the Reason field will display the reason for the current status. Click the eye icon in the Summary column to view the endpoint summary information.