Ours is a application with multiple modules residing in different packages ,we use web services where each HTTP request spans across different packages to get the desired data.
I have included the java agent and everything works fine when i include a single package in Trace method , but while including multiple packages to drill down to the actual performance bottle neck , the request that spans across multiple packages are not consolidated into a single transaction , but are sensed as independent custom methods .How can i consolidate the methods across different packages into a single request transaction ?
Thanks a lot for the quick reply :) we are using Apache Http Client - 4.5.2 , which is supported by the java agent . As i mentioned i am able to get the correct readings and spans when the request spans within a single package (the spans are consolidated into single request) . The spans are not consolidated into single request only when the http request spans across multiple packages as a part of cross module communication.Please let me know if more detailed information is required.
Thanks for the reply . Initially to set the context , our package structure is something that looks like this ,
com
abc
proj
core
user
bo
UserBO.java
Impl
UserImpl.java
dao
userDao.java
Impl
UserDaoImpl.java
Mapper
UserMapper.java
Entity
UserEntity.java
service
UserService.java
web
UserController.java
role
bo
RoleBO.java
Impl
RoleBOImpl.java
dao
RoleDao.java
Impl
RoleDaoImpl.java
Mapper
RoleMapper.java
Entity
RoleEntity.java
service
RoleService.java
web
RoleController.java
common
work
bo
WorkBO.java
Impl
WorkBOImpl.java
dao
WorkDao.java
Impl
WorkDaoImpl.java
Mapper
WorkMapper.java
Entity
WorkEnity.java
service
WorkService.java
web
WorkController.java
Implying - com.abc.proj.core.user.bo.impl.UserBOImpl.java
com.abc.proj.core.user.web.UserController.java
com.abc.proj.common.work.service.WorkService.java
I would like to get the span for all the java files involved in a request . A request can invoke the java files in multiple package (ie user , role, work ).The spans are not consolidated into a single transaction when the request invokes java files from multiple packages (ie user and role or user and work).The consolidation happens correctly when the request invokes java classes from a single package say user.My trace method and application package parameters are given below ,
I am still unclear if the request spans multiple controllers or just a single controller?
The request spans just a single controller ,because cross-package invocation happens at service layer and not through the controller.
And if you look at the apm-server logs on start up you should see an error if does not parse the trace_methods correctly
Not getting any errors on log with the following trace methods
trace_methods=com.abc.proj.core.user.#,com.abc.proj.core.role.#,com.abc.proj.common.work.#
can you try trace_methods="com.abc.proj.*#*"
Throws an error stating invalid trace methods.
If you take trace_methods completely out are the spans consolidated?
No Stephen , its not happening.
How are you setting on the command line?... from a startup script, you may need to escape the \# ?
your supplied matchers do not look correct to me see the document they should require *#* not just a # trace_methods=com.abc.proj.core.user.#,com.abc.proj.core.role.#,com.abc.proj.common.work.#
If you upgrade to 1.4 you can try
trace_methods=com.abc.proj.*
My question at the end was how are you starting the application? From the command line? if so you may need to escape the # or quote it.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.