/wp-content/uploads/2014/09/sap_logo_542173.png

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 the JavaScript file in a project that includes this plugin at

project_name\plugins\com.sap.mp.cordova.plugins.etetrace\www\etetrace.js

or the JS Documentation at Kapsel End-to-End Trace Plugin API Reference. The following steps will demonstrate how to modify the sample used in the Logon section to enable and disable the capturing of the Kapsel End-To-End Trace plugin.

  • Add the e2etrace plugin.
    cordova -d plugin add com.sap.mp.cordova.plugins.e2etrace
    
  • 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.
    image1.PNG

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

  • Copy the files to the platform directory by running
    cordova -d prepare
    
  • Use the Android IDE or Xcode to deploy and run the project. 
  • 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

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Wayne Smith

    This is great if the customer is using Solution Manager.

    However we have a lot of customer who don’t

    So the question is can you modify  and dump the trace to

    client log or to the SMP log ?

    (0) 
    1. Daniel Van Leeuwen Post author

      I have forwarded your comment on to the dev team.

      I don’t believe it is currently possible to indicate the E2E trace details should be added to the client log.

      Regards,

      Dan van Leeuwen

      (0) 

Leave a Reply