Hi,
I resolve my problem.
I found the same question without response, so this is my solution.
if you have a better say me.
@brian.brazil : to debug my pattern I add 2 log
- one to log the matchname : logger.log(Level.FINE,"matchName:"+matchName);
- one other to log the pattern : logger.log(Level.FINE, "-----> pattern:" + rule.pattern.toString())
with this to logs I can check and test my pattern with the real data.
to export the datasource information from catalina :
- pattern: 'Catalina<type=DataSource, class=javax.sql.DataSource, name="(.*)"><>(maxIdle|minIdle|maxWait|active|size|idle|createdCount|initialSize|reconnectedCount|maxAge|maxActive|releasedIdleCount|releasedCount):'
name: tomcat_dataSource_$2
labels:
datasource_name: "$1"
help: Tomcat datasource $2
type: GAUGE
to export the datasource information from tomcat.jdbc :
- pattern: 'tomcat.jdbc<name=\"(.*)\", type=ConnectionPool, class=org.apache.tomcat.jdbc.pool.DataSource><>(MaxIdle|MinIdle|MaxWait|Active|Size|Idle|CreatedCount|InitialSize|ReconnectedCount|MaxAge|MaxActive|ReleasedIdleCount|ReleasedCount):'
name: tomcat_jdbc_$2
labels:
datasource_name: "$1"
help: Tomcat jdbc $2
type: GAUGE
Pascal