Go to All Forums

APM Transactions for GraphQL

I have several services which expose a GraphQL API. In contrast to REST, GraphQL uses one endpoint URL for all requests, e.g.:

POST /graphql
Content-type: application/json

{
"query": "query list_friends($characterName: String!) { character(name: $characterName) { friends { name } } }",
"variables": { "characterName": "Luke Skywalker" }
}

200 OK
Content-type: application/json

{
"data": {
"character": {
"friends": [ { "name": "Leia Organa" }, { "name": "Han Solo " } ]
}
}
}

APM's Transactions tab groups all these requests together -- "POST */graphql" -- which is fairly useless because different requests do very different things.

I attempted to make these transactions unique by having my clients append a query string parameter to the end of the URL that's unique to each query ("?operationName=ShortDescriptionOfWhatItDoes"). But the Transactions tab isn't showing that parameter.

Is there a way to differentiate transactions using either:

  1. A query string parameter, like I've added?
  2. An "operation name" that was part of the POST body?
Like (4) Reply
Replies (3)

Hi Karl,

Apologies for the delayed response.

In transactions we do group similar looking transactions under 'Transactions' tab, whereas under Traces you should be able to view the exact url of the transaction along with the query parameters. 

 

Upon selection of any trace, you should be able to see all the operations performed for processing the request

Like (0) Reply

Thanks, I see this now!

It would be nice to be able to define that these transactions should be differentiated on a query string parameter, but at least I can see this data.

(I have an separate problem that the Site24x7 APM agent is collecting almost no data because my service heavily uses Reactive (async) code, and the Site24x7 APM doesn't seem to understand async calls)

Like (0) Reply

Good to hear you were able to see the data.

 

Regarding async calls, we have completed the development and its in testing phase. We will roll out the enhancement soon. Watch the community space for further updates on async calls

Like (0) Reply

Was this post helpful?