Slackbot
12/28/2023, 10:21 AMnitya-signoz
12/28/2023, 1:26 PMk8s_container_name
.
and then your query will look like
SELECT
toStartOfInterval(
fromUnixTimestamp64Nano(timestamp),
INTERVAL 540 SECOND
) AS ts,
toFloat64(count(*)) as value
from
signoz_logs.distributed_logs
where
(
timestamp >= 1703385720000000000
AND timestamp <= 1703558520000000000
)
AND resource_string_container_name = 'some-service' AND resource_string_container_name_exists = true
group by
ts
order by
value DESC
Ofcourse this may or maynot change alone increase the perf due to variables like granularity, but this is the first step and then the next step is to create clickhouse projections.nitya-signoz
12/28/2023, 1:27 PMk8s_container_name
will remain k8s.container.name
Siddharth Prakash Singh
12/28/2023, 1:28 PMSiddharth Prakash Singh
12/28/2023, 2:52 PMSiddharth Prakash Singh
12/28/2023, 3:48 PMSiddharth Prakash Singh
12/28/2023, 3:49 PMnitya-signoz
01/03/2024, 4:29 AMseverity_text and service.name
you can create a projection . Please note that this will increase perf of queries but it will also use more storage.
Eg:-
alter table logs on cluster cluster add PROJECTION default_projection
(
SELECT *
ORDER BY
severity_text,
`resource_string_service$$name`
)
https://clickhouse.com/docs/en/sql-reference/statements/alter/projectionnitya-signoz
01/03/2024, 4:30 AMSiddharth Prakash Singh
01/03/2024, 7:01 AMSiddharth Prakash Singh
01/03/2024, 7:34 AM