Hi Team, I have a trace filter as `gc_type.(string...
# support
d
Hi Team, I have a trace filter as
gc_type.(string) IN "GC"
Which is showing all the traces for our GC Events in our node service, I want to add a dashboard for this on Signoz, with 2 main metrics, the time difference between 2 GCs and the time spent on a GC operation, can someone please help, should I write a Clickhouse query or Query Builder can do this for me ?
a
@Divyanshu Negi not sure about the 1st but 2nd should be doable in clickhouse query. BTW which language and framework are you using? They should expose GC related metrics too
d
i am using nestJS framework with Typescript
a
I see...nodejs runtime metrics like eventloop lag and GC metrics is still not merged
@Vishal Sharma can you help with the above queries in clickhouse?
v
@Divyanshu Negi Here’s a Query which returns avg time spent on a GC span.
Copy code
SELECT toStartOfInterval(timestamp, INTERVAL 60 SECOND) AS ts, 
avg(durationNano) as value 
from signoz_traces.distributed_signoz_index_v2 where timestamp between
{{.start_datetime}} AND {{.end_datetime}} 
AND stringTagMap['gc_type']='GC' group by ts order by ts
a
@Vishal Sharma we should replace
now() - INTERVAL 30 MINUTE
with template variables
d
can you please share the template variable here, would help make the dashboard dynamic for us
v
You can follow this doc to learn more about template variables: https://signoz.io/docs/tutorial/writing-clickhouse-queries-in-dashboard/