This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Prerequisites to Publish Statistics

The following sections describe the prerequisites for publishing statistics from the ESB profile of WSO2 EI to the Analytics profile.

Enabling statistics/message tracing

Follow the instructions give below to enable statistics monitoring and message tracing. You can use message tracing to track a message (including the message payload) throughout a mediation flow.

Note that it is not recommended to enable tracing in production environments as it generates a large number of events that reduces the performance of the analytics profile. Therefore, tracing should only be enabled in development environments.

Step 1: Enabling statistics/message tracing for the ESB profile

Open the synapse.properties file (stored in the <EI_HOME>/conf/ directory) and configure the properties given below.

PropertyDescription
mediation.flow.statistics.enable

Set this property to true and enable statistics for the required ESB artifact, to record information such as the following.

  • The time spent on each mediator.
  • The time spent to process each message.
  • The fault count of a single message flow.
mediation.flow.statistics.tracer.collect.payloads

Set this property to true and enable tracing for the required ESB artifact, to record the message payload before and after the mediation performed by individual mediators. Note that message tracing is not recommended for production environments.

mediation.flow.statistics.tracer.collect.properties

Set this property to true and enable tracing for the required ESB artifact, to record the following information.

  • Message context properties.
  • Message transport-scope properties. 

Note that message tracing is not recommended for production environments.

mediation.flow.statistics.collect.all

Set this property to true and set the mediation.flow.statistics.enable property also to true, to enable mediation statistics for all the artifacts in the ESB profile by default.

If you set this property to false, you need to set the mediation.flow.statistics.enable property to true and manually enable statistics for the required ESB artifact.

Step 2: Enabling statistics/message tracing for ESB artifacts

If you have enabled the mediation.flow.statistics.collect.all property in the synapse.properties file as explained in the previous section, you will be monitoring the statistics of all the ESB artifacts (proxy services, REST APIs, sequences, and endpoints)  by default. Alternatively, you have the option of enabling statistics for only the required artifacts. You can use WSO2 EI Tooling or the management console for this purpose.

In a clustered deployment, statistics should be enabled for the required artifacts in all the EI nodes if you have not enabled deployment synchronizing. If deployment synchronising is enabled, you need to enable statistics for the required artifacts only in one node.

For example, you can enable statistics for a proxy service as described below.

  1. Start the ESB profile and log into the management console.
  2. In the Main tab, look for the Services section and click List  under the same section to open the Deployed Services page. Then click on the required proxy service as shown below.
     
  3. Click Enable Statistics and Enable Tracing links. Note that message tracing is not recommended for production environments. 
    Click OK in the information message that appears to confirm that statistics/tracing is enabled.
     
The following table specifies the path to the Enable Statistics link for each ESB artifact type that can be analyzed using the Analytics Dashboard.


EI Artifact TypePath
Proxy ServiceMain tab => Services => List => Deployed Services page => <Proxy_Service_Name>
REST APIMain tab => APIs => Deployed APIs page
SequenceMain tab => Sequences => Mediation Sequences page
EndpointMain tab => Endpoints => Manage Endpoints page
Inbound EndpointMain tab => Inbound Endpoints => Manage Inbound Endpoints page

If you have worker nodes configured in your deployment, use WSO2 EI Tooling to enable message tracing/statistics as follows. You need to set the value of the Trace Enabled and Statistics Enabled options to true in the Properties tab of the artifact. Note that message tracing is not recommended for production environments. 


Configuring the ESB to publish data to the Analytics profile

The required configuration details described below are available by default. Follow this section to understand the Analytics related configurations used in the process, and do any modifications if required. In a clustered deployment, the following configurations should be checked for each Enterprise Integrator node in the cluster.

This step involves providing the information required by the ESB profile to publish data to WSO2 EI Analytics in order to analyze the data via the Analytics Dashboard. An event publisher is configured with the URL to which ESB-related information are published as events.

Follow the procedure below to configure EI Analytics.

  1. Open the <EI_HOME>/repository/deployment/server/eventpublishers/MessageFlowConfigurationPublisher.xml file, and enter relevant configurations as described in the table below. This file is used to enter the information required to publish ESB data to the WSO2 EI Analytics server.

    PropertyRequired ValueExample
    usernameThe username to be used when accessing the WSO2 EI Analytics server to publish configurations.admin
    passwordThe password to be used when accessing the WSO2 EI Analytics server to publish configurations.admin
    receiverURLThe URL of the thrift port to which the EI configurations should be published. The format of the URL is as follows.
    tcp://<localhost>:<THRIFT_PORT>
    tcp://localhost:7612
  2. Open the <EI_HOME>/repository/deployment/server/eventpublishers/MessageFlowStatisticsPublisher.xml file, and do the configurations and specified in the table below. 

    PropertyRequired ValueExample
    usernameThe username to be used when accessing the WSO2 EI Analytics server to publish statistics.admin
    passwordThe password to be used when accessing the WSO2 EI Analytics server to publish statistics.admin
    receiverURLThe URL of the thrift port to which the EI statistics should be published. The format of the URL is as follows.
    tcp://<localhost>:<THRIFT_PORT>
    tcp://localhost:7612
  3. Change the hostname to the actual hostname in the <EI_HOME>/wso2/analytics/repository/deployment/server/jaggeryapps/portal/configs/designer.json file as follows. 

    This step avoids the host verification errors that can occur when multiple WSO2 product instances publish statistics.

        },
        "host": {
            "hostname": "localhost",
            "port": "",
            "protocol": ""
        }

Configuring datasources

The datasources of WSO2 EI Analytics are by default configured with the H2 database type. If you configure them with the MSSQL database type, add the SendStringParametersAsUnicode property to the database connection URL in the data source configuration in the <EI_HOME>/wso2/analytics/conf/datasources/analytics-datasources.xml file as shown below to avoid deadlock issues that are caused when the same table row is updated in two or more sessions at the same time.

<url>SQLSERVER_JDBC_URL;SendStringParametersAsUnicode=false</url>

Enabling purging

Purging removes old data to prevent it from accumulating, which would eventually reduce the performance of WSO2 EI Analytics. Purging is especially important in production environments or any instance that runs for extended periods of time. When you enable purging, you can specify the retention period to determine how long the data will remain before it is purged. For more information, see Purging Analytics Data.

Starting the servers

  • For instructions on how to run WSO2 EI Analytics, see Starting EI Analytics.
  • The ESB profile of WSO2 EI should run simultaneously with the WSO2 EI Analytics server. For instructions on how to run a WSO2 product, see Running the Product.