Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Dan_vL
Product and Topic Expert
Product and Topic Expert
0 Kudos
846

End-to-End Trace (New in SP05)

This plugin enables the tracing of HTTP calls made within a Kapsel application.  This trace information is updated to the SMP server which then forwards it on to a Solution Manager installation specified in the management cockpit under Settings > System > Solution Manager URL.  See also End-to-End Analysis Overview.

For additional details on the end-to-end trace plugin see C:\SAP\MobileSDK3\KapselSDK\docs\api\sap.E2ETrace.html or Using the End-to-End Trace Plugin. The following steps will demonstrate how to modify the sample used in the Logon sectionto enable and disable the capturing of the Kapsel End-To-End Trace plugin.

  • Add the e2etrace plugin.
    cordova plugin add kapsel-plugin-e2etrace --searchpath %KAPSEL_HOME%/plugins
    or
    cordova plugin add kapsel-plugin-e2etrace --searchpath $KAPSEL_HOME/plugins
  • Add a the following HTML just above the table tag in
    C:\Kapsel_Projects\LogonDemo\www\index.html
    This will add ability to start, stop, set the trace level and upload the trace log to the SMP server.
    <br><button id="start" onclick="sap.E2ETrace.startTrace('DansETEKapselTrace');">Start Trace</button>
    <button id="stop" onclick="sap.E2ETrace.endTrace();">End Trace</button><br>
    <button id="upload" onclick="sap.E2ETrace.uploadTrace(uploadTraceSuccess, errorCallback);">Upload Trace</button>
    Add the following JavaScript method used by the uploadTrace method.
    function uploadTraceSuccess() {
        alert("Trace successfully uploaded");
    }
  • In the management cockpit, Under Settings > System > Solution Manager Settings, specify the URL to the Solution Manager where the captured trace information will be sent and check Enabled for End to End Tracing.


    The XML file can be captured by using a program like TcpTrace if you do not have access to Solution Manager.

  • Prepare, build and deploy the app with the following command.
    cordova run android
    or
    cordova run ios
  • The following is the captured XML that would be sent to Solution Manager after pressing Start Trace, Read, End Trace, Upload Trace.
    Note that the log level is increased to debug after starting a trace and is returned to the previous log level when the trace is ended.
    <?xml version="1.0" encoding="UTF-8"?> <BusinessTransaction clientType="Mobile" id="946c1ae53e64437f8ce4679801f3248f" name="DansETEKapselTrace" time="20.08.2014 14:57:11.977 UTC" xmlVersion="7.1.10">    <ClientInformation>SMPClientSDK 3.5.0-sap-07 Android</ClientInformation>    <TransactionStep id="946c1ae53e64437f8ce4679801f3248f-1" name="Step-1" reqType="http" time="20.08.2014 14:57:11.977 UTC" traceflags="0d9f">       <Message dsrGuid="f51f88a04195404cb2d3d73e6abc29d1" id="1" name="Message-1">          <duration>1357</duration>          <firstByteReceived>20.08.2014 14:57:16.615 UTC</firstByteReceived>          <firstByteSent>20.08.2014 14:57:15.258 UTC</firstByteSent>          <lastByteReceived>20.08.2014 14:57:16.615 UTC</lastByteReceived>          <lastByteSent>20.08.2014 14:57:15.258 UTC</lastByteSent>          <rcvd>12289</rcvd>          <requestHeader>GET http://10.7.171.196:80/com.mycompany.logon/CarrierCollection?$format=json             SAP-PASSPORT: 2A5448...              MaxDataServiceVersion: 3.0              Authorization: Basic ***************              Accept: application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7, application/json;q=0.5, */*;q=0.1              X-CorrelationID: f51f88a04195404cb2d3d73e6abc29d1-1-1              X-SMP-APPCID: d903c252-8d59-4355-8c2c-98415be34f28          </requestHeader>          <requestLine>GET http://10.7.171.196:80/com.mycompany.logon/CarrierCollection?$format=json</requestLine>          <responseHeader>server: SAP             ntcoent-length: 12289             dataserviceversion: 2.0             etag: version 01             Date: Wed, 20 Aug 2014 14:57:48 GMT             Transfer-Encoding: chunked             Content-Type: ap             ab             plication/json;charset=utf-8          </responseHeader>          <returnCode>200</returnCode>          <sent>0</sent>       </Message>    </TransactionStep> </BusinessTransaction> 

Back to Getting Started With Kapsel