Kevin Anderson
04/08/2024, 10:27 PMKevin Anderson
04/08/2024, 10:28 PMPrashant Shahi
04/09/2024, 2:30 AMSrikanth Chekuri
04/09/2024, 3:52 AMKevin Anderson
04/09/2024, 4:54 AMSELECT service_name,
ts,
If((value - lagInFrame(value, 1, 0) OVER rate_window) < 0, nan,
If((ts - lagInFrame(ts, 1, toDate('1970-01-01')) OVER rate_window) >= 86400, nan,
(value - lagInFrame(value, 1, 0) OVER rate_window) /
(ts - lagInFrame(ts, 1, toDate('1970-01-01')) OVER rate_window))) as value
FROM (SELECT service_name,
toStartOfInterval(toDateTime(intDiv(timestamp_ms, 1000)), INTERVAL 60 SECOND) as ts,
sum(value) as value
FROM signoz_metrics.distributed_samples_v2
INNER JOIN (SELECT JSONExtractString(labels, 'service_name') as service_name, fingerprint
FROM signoz_metrics.time_series_v2
WHERE metric_name = 'seis_calls'
AND temporality IN ['Cumulative', 'Unspecified']
AND has(JSONExtractKeys(labels), 'http_method')
AND JSONExtractString(labels, 'span_kind') IN ['SPAN_KIND_SERVER','SPAN_KIND_INTERNAL']
AND JSONExtractString(labels, 'deployment_environment') = 'production'
AND JSONExtractString(labels, 'service_name') IN
['seis-gateway_seis-gateway','gateway']) as filtered_time_series USING fingerprint
WHERE metric_name = 'seis_calls'
AND timestamp_ms >= 1712637000000
AND timestamp_ms < 1712637960000
GROUP BY GROUPING SETS ( (service_name, ts), (service_name) )
ORDER BY service_name ASC, ts)
WINDOW rate_window as (PARTITION BY service_name ORDER BY service_name, ts)
v4 query
SELECT service_name,
toStartOfInterval(toDateTime(intDiv(unix_milli, 1000)), INTERVAL 60 SECOND) as ts,
sum(value) / 60 as value
FROM signoz_metrics.distributed_samples_v4
INNER JOIN (SELECT DISTINCT JSONExtractString(labels, 'service_name') as service_name, fingerprint
FROM signoz_metrics.time_series_v4
WHERE metric_name = 'seis_calls'
AND temporality = 'Delta'
AND unix_milli >= 1712631600000
AND unix_milli < 1712635800000
AND JSONExtractString(labels, 'service_name') IN ['seis-gateway_seis-gateway','gateway']
AND has(JSONExtractKeys(labels), 'http_method')
AND JSONExtractString(labels, 'deployment_environment') = 'production'
AND JSONExtractString(labels, 'span_kind') = 'SPAN_KIND_SERVER') as filtered_time_series
USING fingerprint
WHERE metric_name = 'seis_calls'
AND unix_milli >= 1712633940000
AND unix_milli < 1712635800000
GROUP BY GROUPING SETS ( (service_name, ts), (service_name) )
Srikanth Chekuri
04/09/2024, 5:25 AMseis_calls
. Please make sure you continuously send data with the same temporality everywhere.Kevin Anderson
04/09/2024, 7:03 AMSrikanth Chekuri
04/09/2024, 7:06 AMSrikanth Chekuri
04/09/2024, 7:06 AMKevin Anderson
04/09/2024, 7:35 AMSrikanth Chekuri
04/09/2024, 9:18 AM--prefer-delta=true
for query service to use delta for v3 also.