DX Application Performance Management

Expand all | Collapse all

How to work with promises

  • 1.  How to work with promises

    Posted 10-17-2018 11:28 PM

    We have an application that uses promises for HttpServletRequests which means that we can see when an request is made, but cannot see the response as that is being handle via a Promise. Is there a specific way to configure APM to work with Promises so that we can tie the Response to the Request?



  • 2.  Re: How do work with promises

    Posted 10-18-2018 10:47 AM

    Dear Nicolas :

      Converted to a Discussion since this is third-party integration. Are you talking about this -- Promise API 

     

    Thanks 

    Hal German



  • 3.  Re: How do work with promises

    Posted 10-18-2018 07:10 PM

    Dear Hal,

    Sort of, but with Java.

    We are trying to determine details from HttpClientHandler (OpenIG doc 5.5.0 Documentation) which in turn uses Promise (OpenIG doc 5.5.0 Documentation) 

     

    we can see the initial request via the handle, but then nothing else as it seems to get lost.

     

    Another one is the following

    httpServletRequest.getAsyncContext().addListener(new AsyncListener() {
    @Override
    public void onComplete(AsyncEvent event) throws IOException {
    decorateResponse(httpServletResponse, responseWrapper);
    }

    @Override
    public void onTimeout(AsyncEvent event) throws IOException {
    }

    @Override
    public void onError(AsyncEvent event) throws IOException {
    }

    @Override
    public void onStartAsync(AsyncEvent event) throws IOException {
    event.getAsyncContext().addListener(this);
    }
    }, httpServletRequest, responseWrapper);

    where httpServletRequest is of type javax.servlet.http.HttpServletRequest and within a Jetty Container. Again we can see the initial request, but then it disappears.

    Does that make sense?


    Thanks

    Nicholas Irving



  • 4.  Re: How do work with promises

    Posted 10-19-2018 11:15 AM

    Dear Nicholas:

        I posted this on the internal boards. Hopefully someone will respond to you.

    Your example was helpful

    Thanks

    Hal German



  • 5.  Re: How do work with promises

    Posted 10-19-2018 12:31 PM

    are you more interested in authentication failures or monitoring of the SAML system? Is there a REST API available to get performance information?



  • 6.  Re: How to work with promises

    Posted 10-22-2018 09:56 PM

    What I am trying to achieve is similatr to GitHub - opentracing/opentracing-java: OpenTracing API for Java  The request starts in one thread, which APM ios capturing, but the response is in another and APM fails to link the two. This goes further than just the classes above, it is about how to handle asynchronous requests/responses so that I can the total time it has taken to perform. Now I have framed it better, will have a search to see if anybody else has asked in that way.



  • 7.  Re: How to work with promises

    Posted 10-22-2018 10:01 PM


  • 8.  Re: How to work with promises

    Posted 10-22-2018 10:34 PM

    Hi Nicholas,

    Re: your last 2 posts

    Both Java & .NET Agents have the concept of Transaction Correlation to be able to stitch transaction traces from different components together, typically if they execute in a different JVM or CLR container. A correlation identiifier (ID) is used to do that. That should also apply to async calls:

    Use Cross-Process Transaction Tracing to Solve Problems - CA Application Performance Management - 10.7 - CA Technologies…  

    What Application Server(s) are you using?

     

    BTW "CA Digital Experience Insights Application Performance Management" is the SaaS version of APM. The Manager side is hosted by CA in the cloud but Agents are still on premise. SaaS and on-premise agent features may slightly differ due to release cycles. On premise docs here: CA Application Performance Management - CA Application Performance Management - 10.7 - CA Technologies Documentation 

     

    Regards,

     

    Lynn