Using SigNoz for Client Logs Query Rules and Line Chart Creation

TLDR Zhichao asked how to create rules in SigNoz query builder for log properties. Nocnica and Srikanth suggested to sum data and use 'count'. Zhichao was able to implement it.

Photo of Zhichao
Zhichao
Wed, 01 Nov 2023 10:02:46 UTC

Hi, We are going to use SigNoz to collect some client logs and generate a line chart based on the properties of the logs. How do we write rules in the Query Builder? For example, my log is first picture,How should I write a rule that can generate values where x is time and y is data.fcp?

Photo of Nocnica
Nocnica
Thu, 02 Nov 2023 17:17:05 UTC

ooooh that's an interesting question Zhichao, let me try formulating an example query to see if I can demonstrate this. Question: are you trying to sum data.fcp within a certain timespan? So like if you have two log lines in the same minute that are `data.fcp:500` you'd want the behavior to be plotting a value of `1000`?

Photo of Srikanth
Srikanth
Fri, 03 Nov 2023 02:37:07 UTC

> generate a line chart based on the properties of the logs. How do we write rules in the Query Builder? Use count. The body can be filtered like this `body.data.e = local`. You can use any key, operator, but the key needs to have prefix `body.`

Photo of Zhichao
Zhichao
Fri, 03 Nov 2023 05:34:44 UTC

I tried putting the data on the same layer to handle this and it seems to be ok.