Correlate with Other Business Transactions

A correlation header contains the information that enables the agents to continue the flow of a Business Transaction across multiple tiers.

An SDK agent can correlate with other SDK agents as well as other Cisco AppDynamicsagents, such as Java, .NET, or PHP, that perform automatic correlation for certain types of entry and exit points.

  1. Correlate with an Upstream Tier:
    When your instrumented process receives a continuing transaction from an upstream agent that supports automatic correlation:
    1. Using a third-party Header.Get() APPD_CORRELATION_HEADER_NAME
    2. Pass the header to StartBT(). For example:
      hdr := req.Header.Get(appd.APPD_CORRELATION_HEADER_NAME)
      bt := appd.StartBT("Fraud Detection", hdr)
    If the header retrieved by the Header.Get() function is valid, the business transaction started by the StartBT() call will be a continuation of the Business Transaction started by the upstream service.
  2. Correlate with a Downstream Tier:
    The downstream agent is watching for a correlation header named singularityheader in the HTTP payload.
    If your SDK agent is making an exit call to a downstream agent that supports automatic correlation:
    1. Set the name of the correlation header using APPD_CORRELATION_HEADER_NAME .
    2. Begin the exit call.
    3. Retrieve the correlation header from the exit call using the GetExitcallCorrelationHeader() function.
    4. Using third-party HTTP functions, prepare an HTTP POST request.
    5. Inject a header named APPD_CORRELATION_HEADER_NAME with the value of the correlation header retrieved in step 3 into the outgoing payload of the HTTP request.
    6. Make the request.
      For example:
      inventoryEcHandle := appd.StartExitcall(btHandle,"Inventory DB")
      hdr := appd.GetExitcallCorrelationHeader(inventoryEcHandle)
       
      client :=&http.Client{
      	CheckRedirect: redirectPolicyFunc,}
      
      req, err := http.NewRequest("POST","https://inventory/holds/xyz", nil)// ...
      req.Header.Add(appd.APPD_CORRELATION_HEADER_NAME, hdr)
      resp, err := client.Do(req)// ......