Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 03ef564

Browse files
Adds telemetry for metric-rollup
Signed-off-by: Harkishen-Singh <[email protected]>
1 parent c9495db commit 03ef564

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

migration/idempotent/010-telemetry.sql

+7
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ $$
100100
SELECT _prom_catalog.get_default_value('chunk_interval') INTO result;
101101
PERFORM _ps_catalog.apply_telemetry('metrics_default_chunk_interval', result);
102102

103+
-- Metric downsampling.
104+
SELECT prom_api.get_automatic_downsample()::TEXT INTO result;
105+
PERFORM _ps_catalog.apply_telemetry('metrics_automatic_downsampling_enabled', result);
106+
107+
SELECT array_agg(resolution || ':' || retention)::TEXT INTO result FROM _prom_catalog.rollup; -- Example: {00:05:00:720:00:00,01:00:00:8760:00:00} => {HH:MM:SS}
108+
PERFORM _ps_catalog.apply_telemetry('metrics_automatic_downsampling_resolutions', result);
109+
103110
IF ( SELECT count(*)>0 FROM _prom_catalog.metric WHERE metric_name = 'prometheus_tsdb_head_series' ) THEN
104111
-- Calculate active series in Promscale. This is done by taking the help of the Prometheus metric 'prometheus_tsdb_head_series'.
105112
-- An active series for Promscale is basically sum of active series of all Prometheus instances writing into Promscale

0 commit comments

Comments
 (0)