Instrumenting a Web Application Using an F5 BIG-IP Load Balancer
Where requests to a web application are load balanced using an F5 BIG-IP load balancer, you can use the broad steps outlined below to RUM-enable that web application:
- Copy the RUM code snippet to a text file.
- Create an HTML Rule on the F5 BIG-IP system
- Create an HTML Profile and associate the HTML Rule with it
Enable the HTML Profile on the virtual server that processes HTTP traffic to the target web application
Each of these steps have been elaborated below:
- The first step is to copy the RUM script to be injected. For this, login to the eG administrative interface and add a Real User Monitor component using the Add/Modify page (Infrastructure -> Components -> Add/Modify).
Once the component is added, the RUM script that should be included in the responses will be displayed. Copy this script to a text file. Note that this code snippet is case-sensitive. It is therefore recommended that you copy the code as is to the text file, instead of manually retyping it.
Figure 28 : The RUM script that is to be injected into the HTTP responses
Next, create an HTML Rule on the load balancer. An HTML rule defines the specific actions that you want the BIG-IP system to perform on a specified type of HTML content. For RUM-enabling a web application, you should create an HTML rule that searches for the /head tag in the HTML responses sent out by the F5 BIG-IP system and automatically inserts the RUM code snippet (that was copied to a text file at step 2 above) just before the /head tag in each of the responses. To create such an HTML rule, do the following:
Login to the F5 console. Figure 29 will then appear.
Using Figure 30, create a Prepend HTML Rule. Such a rule typically matches on the specified tag name, attribute name, and attribute value, and then prepends the specified HTML content to the tag delimiter. Click on the Create New drop-down in the HTML Rules page of Figure 30 and select the Prepend HTML option. This will invoke Figure 31, where you will have to specify the Rule Name.
Then, click the Match Settings option from the left panel of Figure 31. To instruct the rule to look for a match for the /head tag, specify /head against Match Tag Name in the right panel of Figure 32.
Next, choose the Action Settings option from the left panel of Figure 32. Doing so will display the HTML to Prepend text area in the right panel. Copy the RUM code snippet from the text file you created at step 2 above and paste it in this text area (see Figure 33).
Finally, click the OK button (not shown in Figure 33) to save the changes.
The next step is to create an HTML profile and associate the rule you created at step 3 with the profile. When you configure an HTML profile on the BIG-IP system, the system can modify HTML content that passes through the system, according to your specifications. For this, do the following:
- In the F5 console, invoke the Local Traffic menu once again. This time, follow the menu sequence, Profiles -> Content -> HTML. When Figure 34 appears, click on the Create New Profile button in Figure 34 to create a new HTML Profile.
Then, click the HTML Rules option in the left panel of Figure 35. The right panel will then change as depicted by Figure 36. From the Available Rules list in the right panel (see Figure 36), select the HTML rule you created at step 3 above. To select, simply click on the check box alongside the rule name. Then, click the < button to transfer the selection to the Selected Rules list. This will associate the rule with the HTML profile being created.
- Then, click on the OK button (not shown in Figure 36) to save the changes to the new profile.
The final step is to enable the HTML profile you created at step 4 for the Virtual server that will be processing the HTML traffic to and from the target web application. For this, follow the steps below:
In the F5 console, invoke the Local Traffic menu, and then follow the menu sequence, Virtual Servers -> Virtual Server List. Figure 37 will then appear.
A list of virtual servers will be displayed in Figure 37. Click on that virtual server on which you want the HTML profile to be enabled. This will open Figure 38. From the HTML Profile drop-down of the Content Rewrite section in Figure 38, select the profile you created at step 4 above.
- Finally, click the Update button in Figure 38 to save the changes.
Sometimes, when updating the virtual server details by clicking the Update button in Figure 38, the following error may occur:
Figure 39 : Error that appears when attempting to update the virtual server details
Such an error occurs if the application service associated with the virtual server object has Strict Updates enabled. If this setting is enabled, then users can control only objects that are exposed through the templates that are used by that application service.
To resolve this error, you first need to disable Strict Updates for the application service associated with the virtual server object. The steps to achieve this are as follows:
- Login to the F5 console.
- Follow the iApps -> Application Services menu sequence.
- Click on the Application Service for which you want Strict Updates disabled.
Then, click on the Properties tab page. In this tab page, choose Advanced against Application Service, deselect the Strict Updates check box, and click on the Update button (see Figure 40).
Once this is done, proceed to associate the HTML profile with the virtual server using the procedure detailed at step 5 above.