Creating Signoz Dashboard for GC Metrics

TLDR Div wanted to create a dashboard for GC events and metrics. Ankit and vishal-signoz provided help with Clickhouse queries and template variables.

Photo of Div
Div
Mon, 08 May 2023 04:01:35 UTC

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 ?

Photo of Ankit
Ankit
Mon, 08 May 2023 07:15:38 UTC

Div 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

Photo of Div
Div
Mon, 08 May 2023 07:16:17 UTC

i am using nestJS framework with Typescript

Photo of Ankit
Ankit
Mon, 08 May 2023 08:41:56 UTC

I see...nodejs runtime metrics like eventloop lag and GC metrics is still not merged

Photo of Ankit
Ankit
Mon, 08 May 2023 08:42:14 UTC

vishal-signoz can you help with the above queries in clickhouse?

Photo of vishal-signoz
vishal-signoz
Mon, 08 May 2023 11:48:19 UTC

Div Here’s a Query which returns avg time spent on a GC span. ```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```

Photo of Ankit
Ankit
Mon, 08 May 2023 12:11:29 UTC

vishal-signoz we should replace `now() - INTERVAL 30 MINUTE` with template variables

Photo of Div
Div
Mon, 08 May 2023 17:09:49 UTC

can you please share the template variable here, would help make the dashboard dynamic for us

Photo of vishal-signoz
vishal-signoz
Tue, 09 May 2023 04:46:19 UTC

Div Already updated the query with template variable:

Photo of vishal-signoz
vishal-signoz
Tue, 09 May 2023 04:47:08 UTC

You can follow this doc to learn more about template variables: