Service Data Agents

Installing Required Features

The following installation instructions apply to WSO2 AS version 4.1.x

  1. Download the WSO2 Application Server. (WSO2 AS)
  2. As we are running both AS and BAM server concurrently we should change the port number of AS by applying an offset. In order to apply an offset, in the AS product directory go to $as_home/repository/conf and open file, carbon.xml . Then change the value in xpath Server/Ports/Offset from '0' to some other integer.
  3. To start the server, on Linux

    wso2server.sh

    on MS Windows

    wso2server.bat

    Start WSO2 AS on Linux,

    start-AS-linux

  4. After starting the server, go to AS management console Configure→Features→Settings menu.

    Give P2 repository link either from as a URL or from a file.

    AS-set-p2repo

    Then click 'Add'.

  5. Go to 'Available Features' tab and select the above repository.

    AS-feature-management

    Click 'Find Features'.

    AS-available-features

    User can see all available features. From those, select 'BAM Data Agent Service Statistics' feature and 'Statistics' feature.

    AS-select-features

    Click 'Install'.

    AS-click-next-to-install-feature

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

    AS-agree-to-license

    AS-installing-features

    AS-feature-install-complete

  7. Restart the WSO2 AS server.

    AS-shutdown-restart-server

    AS-confirm-restart

    AS-server-is-restarting

Configuring Service Data Publisher

  1. Go to AS management console and select Configure→Service Data Publishing from side panel.
  2. Fill the form.
    1. Tick on 'Enable Service stats ' and 'Enable Activity Service '.
    2. Set the 'BAM URL' as the URL of the BAM server. e.g. : https://localhost:9443
    3. Set user name and password as 'admin'.
    4. Let the default setting and value remain for 'socket' and 'port' in 'Transport'.

    AS-service-data-publisher-configuration

  3. Click 'Update'.

    AS-service-data-publisher-configuration-successful

Monitoring a Sample Web Service

  1. Go to AS management console Main→Web Services→List menu.

    AS-all-web-services

  2. In web service, 'HelloService ', click 'Try this service'.

    AS-HelloService-try-service

  3. Add a sample string as 'name' and click the 'Send' button.

    AS-send-a-sample-text

  4. BAM Data Agent will send the message to the EVENT table in Cassandra database. Data in the Cassandra database can be seen by from the CLI using Cassandra Client. Using the BAM server it can execute analyzers and store results to summary tables which can be visualized by the Gadget IDE in BAM.
  5. Sample data format for service data agent as follows.
    event data
    
    => key=fault_count, value=0
    => key=operation_name, value=echoInt
    => key=request_count, value=1
    => key=response_count, value=1
    => key=response_time, value=10
    => key=server_name, value=10.150.3.122
    => key=service_name, value=echo
    => key=timestamp, value=2012-03-12 11:21:27.675
    => key=total_average_response_time, value=10.0
    => key=total_maximum_response_time, value=10
    => key=total_minimum_response_time, value=10
    => key=total_request_count, value=1
    => key=total_response_count, value=1
    
    
    meta data
    
    => key=content_type, value=text/xml; charset=UTF-8
    => key=host, value=localhost:9764
    => key=remote_address, value=127.0.0.1
    => key=request_url, value=http://localhost:9764/services/echo
    => key=timeStamp, value=2012-03-12 11:21:40
    => key=user_agent, value=Synapse-HttpComponents-NIO