Configuring web application statistics monitoring with BAM
Perform the following steps to ensure that you have the necessary configurations for monitoring web application statistics with BAM:
Step 1: Start the Application Server
To start the application server for web application monitoring with BAM:
Do the following changes to the given files before you start AS.
- Go to
{AS_HOME}/repository/conf/
folder and opencarbon.xml
.
Look for<offset>0</offset>
and change it to1
. - Go to
{AS_HOME}/repository/conf/etc/
folder and openbam.xml
.
Look for<WebappDataPublishing>disable</WebappDataPublishing>
and enable it.
- Go to
- Start the Application Server. For more information, see Starting the server.
Step 2: Start the Business Activity Monitor
To start BAM and to setup databases for statistics data:
- Start BAM. For more information, see Starting the server.
- If you need to change the database that stores statistic data, do the following;
- Create a database.
- Configure the database in
{BAM_HOME}/repository/conf/datasources/master-datasources.xml
asWSO2BAM_DATASOURCE
.
Step 3: Configure the Application Server (AS)
To configure the AS for publishing statistics in BAM:
Log into the AS management console.
Webapp data publishing settings need to be configured separately for the tenants.
On the Configure tab, click Webapp Data Publishing.
- Select the Enable webapp stats option.
- Leave the Stream Name, Version, Nick Name, Description as it is.
If you need to change the latter fields, you will have to make some more changes in the tool box and hive script. - Enter the Receiver URL.
This refers to the Thrift URL. This is normally tcp://{host}:7611. If you need to use SSL for this the URL will be tcps://{host}:7711. If you change the offset of the BAM server to 1, both ports will be incremented by 1 (7612, 7712) - Enter the Cassandra Username.
- Enter the Cassandra Password.
- Click Update to successfully configure the AS for Data publishing to BAM.
Step 4: Configuring the web application that need monitoring
Use either one of the following approaches to configure the web application before deploying. These steps ensures that each web application in AS is individually configured for data publishing in BAM.
The UI has the precedence over web.xml configurations. As a result, if you disable web apps statics monitoring from the UI configurations in the web.xml will not work.
Enable monitoring via the UI
- On the Main tab, under the Applications menu, click List.
- Click the Context link of the respective web application.
The selected application dashboard will appear.
- Click Activate, to enable BAM statistics.
Enable monitoring via the web.xml
Add the following context params to the application web.xml
<context-param> <param-name>enable.statistics</param-name> <param-value>true</param-value> </context-param>
Step 5: Configure the Business Activity Monitor (BAM)
- Log into the BAM management console.
On the Main menu, under BAM Toolbox, click Add.
Select the ToolBox From URL option.
Enter the URL of the WebApps_Stats_Monitoring toolbox.
Click Install.
Refresh after a few seconds to see if the toolbox is installed.
Step 6: Invoke the web application that has enabled statistics monitoring
Access the AS management console.
Main menu, under the Applications caption, click List.
Click the respective web application context link.
The application dashboard will appear.Click the web applications services link (e.g., /jaxrs_basic/services ).
Step 7: Schedule or execute the webapp statistics
- Access the BAM management console.
- On the Main menu, under Analytics, click List.
The webapp statistics will be displayed. Execute the webapp statistics or schedule its running sequence.
Viewing the web application statistics
On the Main menu, click Dashboard.
Login to the dashboard using "admin" as the username and password.
Select the Server, Tenant and Web App to view web application statistics via the BAM Dashboard.