I have created a dashboard with variable that can switch over the cluster name. My issue is that, how can I configure the panel on querying logs based on the cluster name that i select from the dashboard variable?
Chi Sheun SRE
11/07/2024, 3:26 PM
For example, the value in the panel will be based on the variable in the"$test".
s
Srikanth Chekuri
11/08/2024, 4:06 PM
Use the variable value in condition
k8.cluster.name = $test
c
Chi Sheun SRE
11/08/2024, 4:19 PM
may i ask if it can be used in this way?
Copy code
SELECT
toStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 1 MINUTE) AS ts,
toFloat64(count()) AS value
FROM
signoz_logs.distributed_logs_v2
WHERE
(timestamp >= {{.start_timestamp_nano}} AND timestamp <= {{.end_timestamp_nano}})
AND body LIKE '%k8.cluster.name = $test%'
AND body LIKE '%/test/test1%'
AND body LIKE '%HTTP/1.1" 200%'
GROUP BY ts
ORDER BY ts ASC;
s
Srikanth Chekuri
11/09/2024, 10:52 AM
No. This is neither recommended. Please extract the cluster name into attributes.
c
Chi Sheun SRE
11/11/2024, 3:21 PM
is there any reference/guide that I can refer to ?
Chi Sheun SRE
11/13/2024, 2:51 AM
Hi @Srikanth Chekuri, I have multiple clusters connecting to a single SigNoz. What I aim to do is to count the appearance of these strings in the logs in a cluster. Therefore, when I change the cluster name, the value showing will be changing to count the appearance of the strings in that specific cluster.
SigNoz is an open-source APM. It helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc.