...
The following parameters in the metrics.xml
file can be used to configure a JMX storage for metrics data.
Element Name | Description | Type | Default Value | Mandatory/Optional |
---|
Enabled | This parameter specifies whether ot noy metics monitoring is enabled for JMX. | Boolean | true | Mandatory |
CSV
The following parameters in the metrics.xml
file can be used to configure a CSV storage for metrics data.
Element Name | Description | Type | Default Value | Mandatory/Optional |
---|
Enabled | This parameter specifies whether or not metrics monitoring is enabled for CSV. | Boolean | false | Mandatory |
Location | The location where the CSV files are stored. | String | ${carbon.home}/repository/logs/metrics/ |
|
|
PollingPeriod | The time interval between polling activities that are carried out to update the metrics dashboard based on latest information. For example, if the polling period is 60, polling would be carried out every 60 milliseconds. | Integer | 60 |
JDBC
The following parameters in the metrics.xml
file can be used to configure a JDBC storage for metrics data.
Element Name | Description | Type | Default Value | Mandatory/Optional | Notes |
---|
Enabled | This parameter specifies whether or not metrics monitoring is enabled for JDBC. | Boolean | true | Mandatory |
|
|
DataSourceName | The name of the datasource used. | String | jdbc/WSO2MetricsDB |
|
|
|
PollingPeriod | The time interval between polling activities that are carried out to update the metrics dashboard based on latest information. For example, if the polling period is 60, polling would be carried out every 60 milliseconds. | Integer | 60 |
|
| This value is specified in milliseconds. |
ScheduledCleanup | This element contains parameters relating to scheduled cleanup. The possible values are Enabled , ScheduledCleanupPeriod and DaysToKeep . Scheduled cleanup involves scheduling a task to clear metric data in the database after a specified time interval. This is done to avoid excessive memory usage. |
| | | |
|
|
|
|
ScheduledCleanup/Enabled | This parameter specifies whether or not scheduled cleanup is enabled. | Boolean | true |
|
|
|
ScheduledCleanup/ScheduledCleanupPeriod | The number of milliseconds that should elapse after a clean-up task before the next clean-up task is carried out. | Integer | 86400 |
|
|
|
ScheduledCleanup/DaysToKeep | The number of days during which the scheduled clean-up task should be carried out. | Integer | 7 |
| | If you have enabled JDBC, then you also need to specify a datasource configuration, which will be used to create the connection between the WSO2 Message Broker product and the JDBC data storage system. The metrics-datasources.xml
file is used for configuring this datasource for metrics.
Parameters that can be configured for a datasource are as follows:
| |
| The container element for the datasource providers. |
| | |
| The datasource provider, which should implement org.wso2.carbon.ndatasource.common .spi.DataSourceReader . The datasources follow a pluggable model in providing datasource type implementations using this approach. | Fully qualified Java class |
| |
| The container element for the datasources. |
| |
| The root element of a datasource. |
| |
| Name of the datasource. | String |
|
| Description of the datasource. | String |
|
| The container element that allows you to expose this datasource as a JNDI datasource. |
| |
| The JNDI resource name to which this datasource will be bound. | String |
|
| Mandatory if specifying JNDI configuration |
<environment> |
|
| The container element in which you specify the following JNDI properties: java.naming.factory.initial : Selects the registry service provider as the initial context.java.naming.provider.url : Specifies the location of the registry when the registry is being used as the initial context.
| Fully qualified Java class |
|
| Optional |
<definition> | type | The container element for the data source definition. Set the type attribute to "RDBMS", or to "custom" if you're creating a custom type. The "RDBMS" datasource reader expects a configuration element with the sub elements listed below. | String |
|
| The container element for the RDBMS properties. |
| |
|
| Mandatory if definition type is RDBMS |
<url> |
|
| The connection URL that passes the JDBC driver to establish the connection. | URL |
|
| The connection user name that passes the JDBC driver to establish the connection. | String |
|
| The connection password that passes the JDBC driver to establish the connection. | String |
|
| Optional |
<driverClassName> |
|
| The class name of the JDBC driver. | Fully qualified Java class |
|
| The maximum number of active connections that can be allocated from this pool at the same time. | Integer | 100 | Optional |
<maxWait> |
|
| Maximum number of milliseconds that the pool waits (when there are no available connections) for a connection to be returned before throwing an exception. | Integer | 30000 (30 seconds) | Optional |
<testOnBorrow> |
|
| Specifies whether objects will be validated before being borrowed from the pool. If the object fails to validate, it will be dropped from the pool, and we will attempt to borrow another. When set to true , the validationQuery parameter must be set to a non-null string. | Boolean | false | Optional |
<validationQuery> |
|
| The SQL query that is used for validating connections from this pool before returning them to the caller. If specified, this query does not have to return any data, as it cannot throw an SQLException. The default value is "null". Example values are SELECT 1 (mysql), select 1 from dual (oracle), SELECT 1 (MS Sql Server). | String | null | Mandatory when testOnBorrow is set to true |
<validationInterval> |
|
| To avoid excess validation, a connection will be validated at this frequency, at most (interval time in milliseconds). If a connection is due for validation, but has been validated previously within this interval, it will not be validated again. The default value is 30000 (30 seconds). | Long | 30000 (30 seconds) | Optional |
Sample configuration
Shown below is a sample metrics.xml
file with the default configurations specifying the types of storages enabled for metrics data. See the above topics for instructions.
...