S Rajith
04/28/2024, 11:59 AMsignoz_metrics
db distributed_time_series_v4
(assuming this is what i should use for getting metrics). where is metric value stored ?S Rajith
04/28/2024, 12:03 PMSrikanth Chekuri
04/29/2024, 6:52 AMsamples_v4
table with column name value
S Rajith
04/29/2024, 9:04 AMSrikanth Chekuri
04/29/2024, 9:09 AMS Rajith
04/29/2024, 9:10 AMSrikanth Chekuri
04/29/2024, 9:11 AMsamples
table indicates when measurement is produced.S Rajith
04/29/2024, 9:12 AMS Rajith
04/29/2024, 9:13 AMselect timestamp, body
from distributed_logs
where
arrayElement (
resources_string_value, indexOf (
resources_string_key, 'k8s.container.name'
)
) like 'myapp%'
order by timestamp desc
limit 5;
Srikanth Chekuri
04/29/2024, 9:14 AMS Rajith
04/29/2024, 9:16 AMSELECT ts.fingerprint, ts.metric_name, samples.unix_milli, samples.value
FROM
distributed_time_series_v4 ts
JOIN distributed_samples_v4 samples ON ts.fingerprint = samples.fingerprint
WHERE
ts.metric_name = 'container_cpu_utilization'
AND JSONExtractString (
ts.labels, 'k8s_container_name'
) LIKE 'myapp%'
ORDER BY samples.unix_milli DESC
LIMIT 10;
S Rajith
04/29/2024, 9:17 AMS Rajith
04/29/2024, 9:18 AMSrikanth Chekuri
04/29/2024, 9:31 AMtime_series_v4
can contain duplicates. You should take care of that in the query. Why are you writing your own queries? Does the query builder not support what you are trying to achieve?S Rajith
04/29/2024, 9:32 AMS Rajith
04/29/2024, 9:33 AMS Rajith
04/29/2024, 11:39 AMdistributed_time_series_v4_1day
it would contain metrics for present day ?Srikanth Chekuri
04/29/2024, 2:27 PMdistributed_time_series_v4
attempts to have one row for each unique time series, ``distributed_time_series_v4_6hrs`` one row for 6hrs and ``distributed_time_series_v4_1day`` one row for a day. So that when we query the large duration we can reduce the amount of data read which means faster queries.