#support

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.

Powered by Struct AI
+11
7
5mo
Solved
Join the chat
Apr 21, 2023 (5 months ago)
Romario
Photo of md5-6c7925cd4df7e39b036d2b26fb21013d
Romario
08:02 PM
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?
Image 1 for 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?
Apr 22, 2023 (5 months ago)
Ankit
Photo of md5-dbe7088320fe1d922707613e02f3420d
Ankit
06:25 AM
vishal-signoz can you help here? Also 2 takeaways:
1. Add the gap in docs https://signoz.io/docs/tutorial/writing-clickhouse-queries-in-dashboard/
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
Apr 24, 2023 (5 months ago)
vishal-signoz
Photo of md5-f936d3e5743d23344d6c60813189716f
vishal-signoz
01:11 PM
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
Image 1 for <span class="s-mention s-user"> <strong>Romario</strong></span> Here’s a sample query for aggregating over avg <code>duration</code> grouped by <code>http.method</code><br>You can replace <code>http.method</code> with any other attribute.<br>Also remember to use legend and y axis units as shared in screenshot.<br><pre><code>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 &gt; now() - INTERVAL 30 MINUTE 
AND has(stringTagMap, 'http.method') group by http.method,ts order by http.method ASC,ts</code></pre>
01:13
vishal-signoz
01:13 PM
Also we can connect over a call to help you in creating more charts for graphQL.
Romario
Photo of md5-6c7925cd4df7e39b036d2b26fb21013d
Romario
05:20 PM
Thank you! How can I use the variable from the time select? Use this in my query:
Image 1 for Thank you! How can I use the variable from the time select? Use this in my query:
vishal-signoz
Photo of md5-f936d3e5743d23344d6c60813189716f
Romario
Photo of md5-6c7925cd4df7e39b036d2b26fb21013d
Romario
08:16 PM
thanks!
+11