Creating GraphQL Query Traces Graph

TLDR Romario requested help with a graph for GraphQL queries. vishal-signoz provided a sample query and additional resources, while Ankit suggested potential improvements to the documentation and integrations.

Photo of Romario
Romario
Fri, 21 Apr 2023 20:02:10 UTC

Hello, I want to show a graph similar to the traces tab for my graphql queries. I followed the example but it shows me this. Someone have an idea how to achieve this?

Photo of Ankit
Ankit
Sat, 22 Apr 2023 06:25:24 UTC

vishal-signoz can you help here? Also 2 takeaways: 1. Add the gap in docs 2. If graphql has a few other charts too that are relevant, should we enable out of box as an integration? Please get in touch with Romario if he thinks there are a few other graphql charts that he would like to monitor

Photo of vishal-signoz
vishal-signoz
Mon, 24 Apr 2023 13:11:37 UTC

Romario Here’s a sample query for aggregating over avg `duration` grouped by `http.method` You can replace `http.method` with any other attribute. Also remember to use legend and y axis units as shared in screenshot. ```SELECT toStartOfInterval(timestamp, INTERVAL 60 SECOND) AS ts, stringTagMap['http.method'] as `http.method`, avg(durationNano) as value from signoz_traces.distributed_signoz_index_v2 where timestamp > now() - INTERVAL 30 MINUTE AND has(stringTagMap, 'http.method') group by http.method,ts order by http.method ASC,ts```

Photo of vishal-signoz
vishal-signoz
Mon, 24 Apr 2023 13:13:07 UTC

Also we can connect over a call to help you in creating more charts for graphQL.

Photo of Romario
Romario
Mon, 24 Apr 2023 17:20:01 UTC

Thank you! How can I use the variable from the time select? Use this in my query:

Photo of vishal-signoz
vishal-signoz
Mon, 24 Apr 2023 20:00:26 UTC

You can find reserved variables for timestamp here:

Photo of Romario
Romario
Mon, 24 Apr 2023 20:16:23 UTC

thanks!