Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

BAM Service Data Agent is used to collect statistics related to service data from WSO2 service-hosting products (such as WSO2 Application Server (AS), WSO2 Data Services Server (DSS), WSO2 ESB, WSO2 Business Process Server (BPS), WSO2 Business Rules Server (BRS)) and send to the WSO2 BAM server. BAM server receives data events via its Thrift API. This protocol uses a binary protocol and enables fast data transmission between the service-publishing products and BAM server. BAM Service Data Agent can be configured early so that the statistics to be extracted from service data of the service-publishing product can be pre-defined. In the configuration panel, the user can specify the BAM server (Thrift server) related information and properties to be extracted from services. The user should define the Event Stream related parameters uniquely identified by a name and a version.

...

3. To start the server,

  • on Linuxwso2server: sh wso2server.sh
  • on MS Windows: wso2server.bat

4. In the management console, select "Configure -> Features" and click the "Repository Management" tab. Then select a P2 repository either from a URL or a file. For instructions, refer to section Managing the Feature Repository .

Info

WSO2 features are available in Equinox P2 repository at http://dist.wso2.org/p2/carbon/releases. Repositories are listed there by WSO2 Carbon platform versions. Check the WSO2 Release Matrix, identify the WSO2 Carbon version that your product is based on and get the repository that is based on that Carbon version.

For example,

 

5.Then click "Add".
5. Go to "Available Features" tab and select the repository added above. The, click on "Find Features" button. From the list of features that appears, select "BAM

6.Click Installed Features. You see the BAM Service Data Agent Aggregate " feature and click "Install."
Image Removed

6. Click "Next" and accept the license agreement.

7. Restart the WSO2 AS server. (Go to "Shutdown/restart" sub menu of the "Main" menu in the management console).

Image Removed  

...

1. Go feature installed by default from the added P2 repository as shown below.

BAM service data agent aggregateImage Added 

 7. Go to <WSO2 Application Server home>/repository/conf/etc and open bam.xml file and enable ServiceDataPublishing as follows:

...

This is disabled by default, and BAM publishing won't occur even if you proceed with the rest of the steps if not explicitly enabled.

2. Log 8. Restart the WSO2 AS server. (Go to "Shutdown/restart" sub menu of the "Main" menu in the management console).Image Added  

Configuring Service Data Agent
Anchor
Configuring Service Data Agent
Configuring Service Data Agent

Follow the instructions below to setup service data publishing in a running WSO2 AS Carbon instance.

Using on-premise deployment of WSO2 AS

If you are using an on-premise deployment of WSO2 AS, follow the below steps to configure the service data publishing capability, which is provided in the WSO2 feature repository:

1. Log in to the Application Server management console and select "Service Data Publishing" from the "Configure" menu.

...

3. The "Service Data Publisher Configuration" window opens. Fill it appropriately. For example,

Image RemovedImage Added

Enable Service stats: Tick to get the activity statistics. 

Enable Activity Service: This enables message tracing with BAM. Typically, a request is sent to an endpoint after being passed through some intermediate stages. Messaging tracing enables to track each messages and visualize the message body in each of these intermediate stages.

Info
titleNote

Enable Activity Service feature will be implemented from the next release of BAM.

Stream Definition Configuration:

  • Stream Name: Stream Name can be any string with alpha-numeric characters
  • Version: Stream Version distinguishes different streams with the same Stream Name. Default version should be 1.0.0 . If the service statistics toolbox is installed, the version should be different to 1.0.0 since the default toolbox uses version 1.0.0 for the stream definition to enable service statistics only.
  • Nick Name: This is a user preferred nick name to the Stream Name in alpha-numeric characters
  • Description: A description describing about the particular stream defined by Stream Name, Stream Version pair. Description should also consists of alpha-numeric characters.

BAM Credentials:

  • BAM URL: Enter the IP address of the BAM server. And the port should be the thrift port ( ex: tcp://127.0.0.1:7611 ). You can add a comma-separated list of server URLs to ensure that load is distributed among many servers and to minimize effects of a failure of one server node. This load balancing feature is an enhancement of the BAM 2.0.1 release onwards.
  • Username: Put the BAM Thrift log-in user name. Default value is admin.
  • Password: Put the BAM Thrift log-in password. Default value is admin.

...

Click the "Update"button once done.

Using Cloud deployment of WSO2 AS

In a cloud deployment of WSO2 AS, it is not required to enable data publishing to BAM using the 'BAM Service Data Agent Aggregate' feature as explained above. Instead, you can simply add the BAM url to the <AS_HOME>/repository/conf/carbon.xml file as shown below.

Code Block
<BamServerURL>https://bamhost:bamport/services/</BamServerURL> 

Note that cloud deployment is enabled by the following setting in the <AS_HOME>/repository/conf/carbon.xml file:

Code Block
<IsCloudDeployment>true</IsCloudDeployment>

Monitoring a sample Web service
Anchor
Monitoring a Sample Web Service
Monitoring a Sample Web Service

...

  1. Log in to the Application Server management console and select "Services -> List" in the "Main" menu.
    Image Modified

...

  1. In the "Deployed Services" window that opens, click the "TryIt" option of the "HelloService".
    Image Modified

...

  1. In the Try It UI, add a sample string as "name" and click the "Send" button.
    Image Modified

...

  1. To view data in the Cassandra database using the Cassandra Explorer, in the management console click Tools, and then click Connect to Cluster in the Cassandra Explorer menu.
  2. Enter the connection details as shown below, and click Connect.
    connect to Cassandra clusterImage Added
    • Connection Url: connection url of the Cassandra cluster with ip and port. For example, localhost:9160 if you didn't set a port offset, and 10.8.99.101:9161 if you have set a port offset of one. This field is mandatory.
    • Username: username of the Cassandra cluster. 
    • Password: password of the Cassandra cluster. 
    • Maximum Result Count: maximum results retrieved from the Cassandra cluster. The default value is 1000.
  3. BAM data agent sends the message  from the service hosting product to the column family with the given

...

  1. stream name in  the EVENT_KS  key-space

...

  1. of the Cassandra database as shown below.
    Cassandra data in the keyspaceImage Added

      

Analyzing service statistics
Anchor
what does service stats
what does service stats

...