Tuesday, December 1, 2015

Using Carbon Metrics with WSO2 Products

"WSO2 Carbon Metrics" provides an API for WSO2 Carbon Components to use Metrics library[1]
This has been pre installed in some of the latest wso2 products such as WSO2 MB 3.0.0, WSO2 ML and WSO2 DAS 3.0.0. Those products also extends the carbon-metrics and implemented added some new features to those products.
If you like you can install and try the carbon metrics in most of the WSO2 products. I've installed it with WSO2 ESB 4.9.0, WSO2 DSS 3.5.0, WSO2 AS 5.3.0 and WSO2 IS 5.0.0

You can easily install the feature through the ui. To install the carbon-metric feature in the product you can follow the below steps
  1. Use [2] to add features through the UI and use Wilkes repository [3]
  2. After adding the repository, deselect Group features by category and click Find features
  3. From the feature list select Metrics Group and install.
  4. Restart the product when the installation complete.
When the feature successfully installed you will see a Metrics menu item in the configuration menu. When you go to that item you will see as follows

At the moment current implementation doesn't supports multi tenancy or RBAC. Feature can be only use with super tenant and super tenant admin.

These information are stored in a H2 database. You can configure the datasource metrics-datasources.xml. Even you can use the same database for all the products. To do so you have to use the same datasource in the $Produc_Home/repository/conf/datasource/metrics-datasources.xml

By default carbon metric uses hostname as the source. Therefore if you are using same database for all the products you can un-comment the 
<Source>Carbon</Source> under JDBC section in the $Product_Home/repository/conf/metrics.xml and change source for each product

 <JDBC>  
       <Enabled>true</Enabled>  
       <!-- Source of Metrics, which will be used to  
         identify each metric in database -->  
       <!-- Commented to use the hostname  
         <Source>Carbon</Source>  
       -->  
       <!--  
         JNDI name of the data source to be used by the JDBC Reporter.  
         This data source should be defined in a *-datasources.xml  
         file in conf/datasources directory.  
       -->  
e.g. for esb <Source>WSO2ESB</Source>, for DSS <Source>WSO2DSS</Source>
 <JDBC>  
       <Enabled>true</Enabled>  
       <!-- Source of Metrics, which will be used to  
         identify each metric in database -->  
       <Source>WSO2ESB</Source>  
       <!--  
         JNDI name of the data source to be used by the JDBC Reporter.  
         This data source should be defined in a *-datasources.xml  
         file in conf/datasources directory.  
       -->  

[1] - https://github.com/wso2/carbon-metrics

No comments:

Post a Comment