From 805e6d51cbbafdc7c98383fc320e207341cba88b Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Wed, 1 Apr 2026 22:00:23 +0200 Subject: [PATCH] fix: add processor_type to stats_1m_processor_detail MV The table and materialized view were missing the processor_type column, causing the RouteMetricsController query to fail and the dashboard processor metrics table to render empty. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../main/resources/clickhouse/V4__stats_tables_and_mvs.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cameleer3-server-app/src/main/resources/clickhouse/V4__stats_tables_and_mvs.sql b/cameleer3-server-app/src/main/resources/clickhouse/V4__stats_tables_and_mvs.sql index c35795ce..1aa1a6f0 100644 --- a/cameleer3-server-app/src/main/resources/clickhouse/V4__stats_tables_and_mvs.sql +++ b/cameleer3-server-app/src/main/resources/clickhouse/V4__stats_tables_and_mvs.sql @@ -137,6 +137,7 @@ CREATE TABLE IF NOT EXISTS stats_1m_processor_detail ( application_id LowCardinality(String), route_id LowCardinality(String), processor_id String, + processor_type LowCardinality(String), bucket DateTime, total_count AggregateFunction(count), failed_count AggregateFunction(countIf, UInt8), @@ -146,7 +147,7 @@ CREATE TABLE IF NOT EXISTS stats_1m_processor_detail ( ) ENGINE = AggregatingMergeTree() PARTITION BY (tenant_id, toYYYYMM(bucket)) -ORDER BY (tenant_id, application_id, route_id, processor_id, bucket) +ORDER BY (tenant_id, application_id, route_id, processor_id, processor_type, bucket) TTL bucket + INTERVAL 365 DAY DELETE; CREATE MATERIALIZED VIEW IF NOT EXISTS stats_1m_processor_detail_mv TO stats_1m_processor_detail AS @@ -155,6 +156,7 @@ SELECT application_id, route_id, processor_id, + processor_type, toStartOfMinute(start_time) AS bucket, countState() AS total_count, countIfState(status = 'FAILED') AS failed_count, @@ -162,4 +164,4 @@ SELECT maxState(duration_ms) AS duration_max, quantileState(0.99)(duration_ms) AS p99_duration FROM processor_executions -GROUP BY tenant_id, application_id, route_id, processor_id, bucket; +GROUP BY tenant_id, application_id, route_id, processor_id, processor_type, bucket;