com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links' is unknown.

Configuring metrics-datasources.xml

The datasources used for metrics are added in the <ML_HOME>/resources/conf/metrics-datasources.xml file as shown in the example at the end of this page. Parameters that can be configured for a datasource are as follows.

By default, WSO2 ML stores metrics in its inbuilt H2 database. If you want to change this default database you need to do the following.

  • Use the scripts in the <ML_HOME>/dbscripts/metrics/ directory to create the tables of the database.
  • Change the properties of the below datasource configuration accordingly.

For similar instructions on changing the default database, see Setting up the Physical Database.

XML elementAttributeDescriptionData typeDefault valueMandatory/Optional
<datasources-configuration> xmlns The root element. The namespace is specified as: xmlns:svns="http://org.wso2.securevault/configuration" N/AMandatory
<providers>N/AThe container element for the datasource providers. N/AMandatory

<provider>

N/AThe 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 classN/AOptional
<datasources>N/AThe container element for the datasources. N/AMandatory
<datasource>N/AThe root element of a datasource. N/AMandatory
<name>N/AName of the datasource.String
WSO2_METRICS_DB
Mandatory
<description>N/ADescription of the datasource.String
The datasource used for WSO2 Carbon Metrics
Optional
<jndiConfig>N/AThe container element that allows you to expose this datasource as a JNDI datasource.N/AN/AOptional
<name>N/AThe JNDI resource name to which this datasource will be bound.String
jdbc/WSO2MetricsDB
Mandatory if specifying JNDI configuration
<environment>N/A

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 classN/A
 
Optional
<definition>typeThe 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" data source reader expects a "configuration" element with the sub-elements listed below.StringN/AMandatory
<configuration>N/AThe container element for the RDBMS properties.N/AN/AMandatory if definition type is RDBMS
<url>N/AThe connection URL to pass to the JDBC driver to establish the connection.URL
jdbc:h2:repository/database/WSO2METRICS_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE
Mandatory
<username>N/AThe connection user name to pass to the JDBC driver to establish the connection.String
wso2carbon
Optional
<password>N/AThe connection password to pass to the JDBC driver to establish the connection.String
wso2carbon
Optional
<driverClassName>N/AThe class name of the JDBC driver to use.Fully qualified Java class
org.h2.Driver
Mandatory
<maxActive>N/AThe maximum number of active connections that can be allocated from this pool at the same time.Integer100Optional
<maxWait>N/AMaximum number of milliseconds that the pool waits (when there are no available connections) for a connection to be returned before throwing an exception.Integer30000 (30 seconds)Optional
<testOnBorrow>N/ASpecifies 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.
BooleanfalseOptional
<validationQuery>N/AThe SQL query used to validate connections from this pool before returning them to the caller. If specified, this query does not have to return any data, it just can't throw a SQLException. The default value is null. Example values are SELECT 1(mysql), select 1 from dual(oracle), SELECT 1(MS Sql Server).StringnullMandatory when testOnBorrow is set to true
<validationInterval>N/ATo avoid excess validation, only run validation at most at this frequency (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).Long30000 (30 seconds)Optional

Example

The following is an excerpt from the metrics-datasources.xml.

<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">
    <providers>
        <provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
    </providers>

    <datasources>

        <datasource>
            <name>WSO2_METRICS_DB</name>
            <description>The datasource used for WSO2 Carbon Metrics</description>
            <jndiConfig>
                <name>jdbc/WSO2MetricsDB</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:h2:repository/database/WSO2METRICS_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE</url>
                    <username>wso2carbon</username>
                    <password>wso2carbon</password>
                    <driverClassName>org.h2.Driver</driverClassName>
                    <maxActive>50</maxActive>
                    <maxWait>60000</maxWait>
                    <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                </configuration>
            </definition>
        </datasource>

    </datasources>

</datasources-configuration>
com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.