Forum Discussion

keithkelly's avatar
2 years ago

Can I "Trace" the Requests Happening Behind the Scenes?

For the products we build, we have trace tools that help us understand what APIs etc are being called behind the scenes.  We even give them to our customers (b2b) so they can analyze & learn.

Of course there's Fiddler, which does quite a bit of tracing, but I *think*(?) Fiddler is irrelevant for tracing Khoros API stuff - but it's been probably 5 years since I've used Fiddler seriously. 

Are there any Trace tools available (either by Khoros or that expose Khoros goodies) that can help make sense of the API requests called by various components? 

(example:  "My Group Hubs" component ... what API call is happening behind the scenes there?  I'd like to build my own component that grabs the same list but uses it differently.  I've spent 1hr in the docs, and haven't found what I'm after.   Buuuutttttttttttt if I could only trace the dang thing........)

Does anyone have any tracing insight?  Are there any tools available? 

  • Hi keithkelly and, cblown hoping you both are doing well!!

    I have revoked the acceptance of the solution marked on @Normanschmidt's comment and banned the user for spamming, as it included an advertising link.

     
  • If I understand what you're asking correctly, you want to see what API calls the OOTB components are using?

    One of the first questions I recall asking a long time ago was, "Could we get the Freemarker source code for the OOTB component X?" Of course core components aren't Freemarker so the answer was "sorry not possible".

    V2 API came along and while it gave us a deeper look at the underlying core database (kind of) - it was still behind the API layer. I think with Hermes this changed and some of OOTB Components are actually Freemarker but they are not directly available in Studio - unless you ask really really nicely 🙂 

    I'm hoping, no praying, that Aurora provides a way for developers to extend the core OOTB Component so we can add minor customisations without the need to reimplement the entire component. But I suspect some of the highly complex components say "messageList" may still need to remain behind the curtain.       

    • keithkelly's avatar
      keithkelly
      Leader

      Agreed in all aspects. 

      An example of what I'm after is to take the question:

      "What's the API V2 request used by the My Group Hubs widget? 

      I could post that question on this forum, but I could avoid it if I could see that request (& the response) happening behind the scenes.  It's a capability we give our users, and I was hoping it was also available to those of us developing on Khoros.   

      • mdfw's avatar
        mdfw
        Genius

        The way I understand it (consider this a rumor, but seems supported by evidence) is that many of the OOB components don't use the API, especially the older parts of the templating engine. Those parts can call directly into the body of the beast. For instance, I see no way to build a proper kudos leaderboard from the API but it exists as a widget. 

        Aurora appears to fix some of that but it's frustrating now.

         

  • haha - a user with one post that joined Tuesday. I think maybe Chat GPT has escaped and changed its name to Normanschmidt ?

    This is a bit weird cause only the OP (or an admin) can accept a solution.

     

    • cblown's avatar
      cblown
      Boss

      What's more strange is I found the copy that was posted here even Chat GPT doesn't do that 🙂


      A trace can have multiple spans, the relation/ordering between the span is maintained by storing the pointer of parent_span inside each span.

  • Thanks, how come the spam post was accepted as a solution though? Seems odd. Only the OP or an Admin has permission to do this? 

  • Unfortunately I also do not know a way of tracing OOTB component's API queries, there are a few Angular ones that do AJAX requests directly to the API, those you can trace, but that's about it. Toolbox does only trace custom components, not OOTB ones (at least afaik).

    But for the GroupHub message list, a query like this is roughly what you need:

    "SELECT ${fields?join(',')} FROM messages WHERE depth = 0 and grouphub.id = '${id}' ORDER BY post_time DESC LIMIT 10 OFFSET 0"

     

  • Glad it helped someone =)!

    And yes, it doesn't answer the OP's question, that was done before: Basically, no, it's not possible to trace API requests from OOB components as some of them seem to use some kind of internal magic to access data we cannot via API v1 or v2.

    And for your usecase, the kudos leaderboard, there is actually an API v1 endpoint for that!