diff --git a/Chart.yaml b/Chart.yaml index 8a0bdda..58c8b85 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: pgdog-control description: PgDog Control type: application -version: 0.2.17 +version: 0.2.18 appVersion: "84c7c56a" diff --git a/README.md b/README.md index 40a0210..a0da432 100644 --- a/README.md +++ b/README.md @@ -702,6 +702,7 @@ control: evict_after_secs: 60 metrics_retention_secs: 300 query_history_limit: 1000 + query_plans_limit: 100 slow_queries_threshold: 5000 autoreload: immediately # or in_sync, or off ``` @@ -713,6 +714,7 @@ control: | `evict_after_secs` | Instance is dropped from the store entirely if its newest metric is older than this (int, default `60`). | | `metrics_retention_secs` | How much per-instance metric history is kept in memory. Older points are dropped as new ones arrive (int, default `300`). | | `query_history_limit` | Per-token historical query store capacity. Oldest deduped query entries are evicted first once the limit is reached (int, default `1000`). | +| `query_plans_limit` | Per-token query-plan capacity. Plans with the oldest creation time are evicted first once the limit is reached; `0` disables plan storage (int, default `100`). | | `slow_queries_threshold` | Minimum query duration, in milliseconds, for classifying a query as slow (int, default `5000`). | | `autoreload` | Automatically enqueue `reload_configuration` for instances that report config drift (enum, default `off`, available options: `off`, `immediately`, `in_sync`). | diff --git a/templates/configmap.yaml b/templates/configmap.yaml index 77616b5..5e1374c 100644 --- a/templates/configmap.yaml +++ b/templates/configmap.yaml @@ -93,6 +93,9 @@ data: {{- if hasKey . "query_history_limit" }} query_history_limit = {{ .query_history_limit }} {{- end }} + {{- if hasKey . "query_plans_limit" }} + query_plans_limit = {{ .query_plans_limit }} + {{- end }} {{- if hasKey . "slow_queries_threshold" }} slow_queries_threshold = {{ .slow_queries_threshold }} {{- end }} diff --git a/test/test.sh b/test/test.sh index df85acd..d8c3ebe 100755 --- a/test/test.sh +++ b/test/test.sh @@ -17,6 +17,7 @@ done echo "" echo "==> Verifying query alert settings..." full_render=$(helm template test-release "$CHART_DIR" -f "$TEST_DIR/values-full.yaml") +grep -q '^ query_plans_limit = 75$' <<< "$full_render" grep -q '^ slow_queries_threshold = 2500$' <<< "$full_render" grep -q '^ slow_queries = true$' <<< "$full_render" diff --git a/test/values-full.yaml b/test/values-full.yaml index 5a713e1..02e301a 100644 --- a/test/values-full.yaml +++ b/test/values-full.yaml @@ -32,6 +32,7 @@ control: process_notify_interval_secs: 30 metrics_retention_secs: 600 query_history_limit: 500 + query_plans_limit: 75 slow_queries_threshold: 2500 autoreload: "immediately" autoscaling: diff --git a/values.yaml b/values.yaml index ebc3645..624e5d7 100644 --- a/values.yaml +++ b/values.yaml @@ -110,6 +110,7 @@ control: # process_notify_interval_secs: 60 # metrics_retention_secs: 300 # query_history_limit: 1000 + # query_plans_limit: 100 # Set to 0 to disable query-plan storage. # slow_queries_threshold: 5000 # Minimum query duration in milliseconds. # autoreload: off autoscaling: {}