This extension works only with the standalone machine agent.
c3p0 is a connection pooling library for making traditional JDBC drivers "enterprise-ready" by augmenting them with functionality defined by the jdbc3 spec and the optional extensions to jdbc2. c3p0 registers MBeans under
com.mchange.v2.c3p0, one with statistics about the library as a whole (called C3P0Registry), and an MBean for each PooledDataSource you deploy. Please refer here for details.
This eXtension inspects and collects c3p0 datasource statistics exposed through MBeans and reports them to AppDynamics Controller.
Please enable JMX in the container if not already enabled that hosts the application using c3p0 connection pooling mechanism.
In the AppDynamics Metric Browser, look for: Application Infrastructure Performance | <Tier> | Custom Metrics | C3P0 in case of default metric path
Note : Please make sure not to use tab (\t) while editing yaml files. You can validate the yaml file using a yaml validator
Specify the container instance host, JMX port, username and password in the config.yml. Configure the MBeans for this extension to report the metrics to Controller. By default,
com.mchange.v2.c3p0 is the domain name. Extension by default reports the metrics of MBean C3P0Registry, one with statistics about the c3p0 library. Specify the dataSourceName you want to exclude from monitoring as a comma separated values in the keyproperty 'excludePooledDataSources'. PooledDataSource MBean ObjectName is of the form 'com.mchange.v2.c3p0:type=PooledDataSource[z8kfsx944ur8uu1osma2k|1b1a3c12]'. Please refer here for details. You can also add excludePatterns (regex) to exclude any metric tree from showing up in the AppDynamics controller.
# Server hosting the C3P0 application specifics server: host: "localhost" port: 9044 username: "" password: "" # C3P0 MBeans. Exclude patterns with regex can be used to exclude any unwanted metrics. mbeans: domainName: "com.mchange.v2.c3p0" excludePooledDataSources: [z8kfsx944ur8uu1osma2k|1b1a3c12] excludePatterns: [.*AllIdentityTokenized$, .*AllPooledDataSources$] #prefix used to show up metrics in AppDynamics metricPrefix: "Custom Metrics|C3P0|"
Configure the path to the config.yml file by editing the in the monitor.xml file in the
<MACHINE_AGENT_HOME>/monitors/C3P0Monitor/ directory. Below is the sample
<task-arguments> <!-- config file--> <argument name="config-file" is-required="true" default-value="monitors/C3P0Monitor/config.yml" /> .... </task-arguments>
Always feel free to fork and contribute any changes directly via GitHub.
For any support questions, please contact email@example.com.