This documentation is for WSO2 App Manager 1.0.0. View documentation for the latest release.
Page Comparison - Publishing App Manager Runtime Statistics (v.56 vs v.57) - App Manager 1.0.0 - WSO2 Documentation

Versions Compared

Key

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

...

  1. Download WSO2 BAM 2.5.0.
  2. Apply an offset of 3 to the default BAM port by editing the  <BAM_HOME>/repository/conf/carbon.xml  file.

    Code Block
    languagehtml/xml
    <Offset>3</Offset>

    This increments all ports used by the server by 3, which means the BAM server will run on port 9446.  Port offset is used to increment the default port by a given value. It avoids possible port conflicts when multiple WSO2 products run on same host.

  3. Specify the datasource definition under the  <datasource>  element in the  <BAM_HOME>/repository/conf/datasources/master-datasources.xml  file. The tables are created automatically when the Hive script runs. You just need to create the schema. The example below connects to a MySQL instance:

    Code Block
    languagexml
     <datasource>
        <name>WSO2AM_STATS_DB</name>
        <description>The datasource used for getting statistics to API Manager</description>
        <jndiConfig>
            <name>jdbc/WSO2AM_STATS_DB</name>
        </jndiConfig>
        <definition type="RDBMS">
            <configuration>
                <url>jdbc:mysql://localhost:3306/stats_db?autoReconnect=true&amp;</url>
                <username>db_username</username>
                <password>db_password</password>
                <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                <maxActive>50</maxActive>
                <maxWait>60000</maxWait>
                <testOnBorrow>true</testOnBorrow>
                <validationQuery>SELECT 1</validationQuery>
                <validationInterval>30000</validationInterval>
             </configuration>
        </definition>
     </datasource>
  4. Save the database driver JAR inside both <APIM_HOME>/repository/components/lib and <BAM_HOME>/repository/components/lib folders.

  5. Copy the file  <AppM_HOME>/statistics/APP_Manager_Analytics.tbox , to   <BAM_HOME>/repository/deployment/server/bam-toolbox/  directory. 

    Info

    If this folder is not in the BAM installation directory by default, create it. The toolbox describes the information collected, how to analyze the data, as well as the location of the database where the analyzed data is stored.

  6. Restart BAM server by running the following command: <BAM_HOME>/bin/wso2server.[sh/bat]

...

  1. Set the following configurations in <AppM_HOME>/repository/conf/app-manager.xml file as follows. Change the default values of the  <BAMServerURL>, <BAMUsername>, and <BAMPassword> properties accordingly.

    Code Block
    languagehtml/xml
    <APIUsageTracking>
     
        <!-- Enable/Disable the API usage tracker. -->
        <Enabled>true</Enabled>  
        <PublisherClass>org.wso2.carbon.appmgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher</PublisherClass>
        <ThriftPort>7614</ThriftPort>
        <BAMServerURL>tcp://<IP_ADDRESS>:7614</BAMServerURL>
        <BAMUsername>admin</BAMUsername>
        <BAMPassword>admin</BAMPassword>
        <!-- JNDI name of the data source to be used for getting BAM statistics. This data source should
            be defined in the master-datasources.xml file in conf/datasources directory. -->
        <DataSourceName>jdbc/WSO2AM_STATS_DB</DataSourceName>
      
    </APIUsageTracking>
    Note

    Replace <IP_ADDRESS> within the <BAMServerURL> element in the above configuration, with the IP address of your BAM server, and also change the values of the <BAMUsername> and <BAMPassword> accordingly if you have changed them

  2. Specify the datasource definition in <APPM_HOME>/repository/conf/datasources/master-datasources.xml file as follows. 

    Code Block
    languagehtml/xml
    <datasource>
              <name>WSO2AM_STATS_DB</name>
              <description>The datasource used for getting statistics to APP Manager</description>
              <jndiConfig>
                 <name>jdbc/WSO2AM_STATS_DB</name>
              </jndiConfig>
              <definition type="RDBMS">
                 <configuration>
                     <!-- JDBC URL to query the database -->
                       <url>jdbc:mysql://localhost:3306/stats_db?autoReconnect=true&amp;</url>
                	   <username>db_username</username>
                	   <password>db_password</password>
                	   <driverClassName>com.mysql.jdbc.Driver</driverClassName>
                	   <maxActive>50</maxActive>
                	   <maxWait>60000</maxWait>
                	   <testOnBorrow>true</testOnBorrow>
                	   <validationQuery>SELECT 1</validationQuery>
                	   <validationInterval>30000</validationInterval>
                </configuration>
             </definition>
      </datasource>
    Info
    • Replace the <BAM_HOME> in the above configuration with the absolute path of BAM installation directory.

    • The JNDI name should be matched with the one give in the BAM configuration.
  3. Start the WSO2 AppM server.

...