Configurations Required to Correlate Traces between CA APM Tomcat Agent and CA API Gateway Services

Document ID : KB000094341
Last Modified Date : 03/06/2018
Show Technical Document Details
Introduction:
We had configured CA APM to CA APIM Integration via CA Precision API Monitoring.

Below is a high level illustration of the application call structure, where the RS Service is calling the Tomcat application:

User-added image


 
Question:
What are the configurations required in order to obtain transaction traces of these calls in the correct correlated sequence in CA APM?
Environment:
CA API Gateway (APIM) Version: 9.3
CA Precision API Monitoring Version: 3.3
CA Application Performance Management Version: 10.7
​Apache Tomcat Version: 7.0
Answer:
This transaction trace correlation scenario is supported in CA APM 10.7 and CA Precision API Monitoring 3.3.

Please refer to following sections in the CA Precision API Monitoring documentation for details on the configurations required to enable such correlation:

Configure Transaction Correlation
Configure Correlation on Two Gateways with Tomcat Servers

Below is a summary of the concepts:
  • Whatever is set in context variable “requestCorrelationID” will be sent to EM as “Cross Process Data” . So, in the proxy chain, the very first system should remove special characters from the correlation id. Regular expression containing all special characters :  (\+|\-|\&\&|\|\||\||\!|\(|\)|\{|\}|\[|\]|\^|\"|\~|\*|\?|\:|\\). Should be replaced by a dot ( . ) “Evaluate Regular expression” assertion can be used for this purpose as below.
 User-added image
 
  • Application needs to pass this id to downstream system, so that the downstream system can read it and again set it in trace. ( Usually done via HTTP headers ). The format ( e.g. ${CorID},1,1,0, ,, ) is not a mandate from product rather downstream system choose to accept in that way
  • Apart from “Cross Process Data” trace should also contain following
    1. TTPlugin.parameters.httprequest.header.X-Forwarded-Host :  <hostname> of immediate upstream  system ( if any )
    2. TTPlugin.correlation.proxy.1.source.host<hostname> of current system
    3. TTPlugin.correlation.proxy.1.source.ip: <ip_address> of current system
    4. TTPlugin.correlation.proxy.1.source.port: <port> of current system
Now, #2, #3 & #4 from above are always added from Gateway side by default ( no configuration needed ). For #1, we need to set a context variable apm.TTPlugin.parameters.httprequest.header.X-Forwarded-Host with desired value. ( Upstream system needs to pass it’s identity by some means, usually via http header X-Forwarded-Host  )