Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: pgdog-control
description: PgDog Control
type: application
version: 0.2.15
appVersion: "29a6513b"
version: 0.2.16
appVersion: "84c7c56a"
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ control:

### Alerting

`control.config.alerts` enables outbound alert integrations. Leave `incident_io` unset to disable incident.io. Thresholds are optional and only configured metrics create alerts.
`control.config.alerts` enables outbound alert integrations. Leave `incident_io` unset to disable incident.io. Alert conditions are optional; only configured metric thresholds and explicitly enabled query alerts create incidents.

```yaml
control:
Expand All @@ -674,6 +674,7 @@ control:
cpu: 90.0
memory: 2048
server_connections: 100
slow_queries: true
incident_io:
api_key: inc_live_xxx
```
Expand All @@ -685,6 +686,7 @@ control:
| `thresholds.cpu` | CPU usage percentage. Must be between `0.0` and `100.0`, inclusive (float, optional). |
| `thresholds.memory` | Memory used, in megabytes (int, optional). |
| `thresholds.server_connections` | Number of open server connections (int, optional). |
| `thresholds.slow_queries` | Create incidents for queries whose duration reaches `store.slow_queries_threshold` (bool, default `false`). |
| `incident_io.api_key` | incident.io API key with permission to create incidents. Missing `incident_io` disables the integration (string, optional). |

### State store
Expand All @@ -700,6 +702,7 @@ control:
evict_after_secs: 60
metrics_retention_secs: 300
query_history_limit: 1000
slow_queries_threshold: 5000
autoreload: immediately # or in_sync, or off
```

Expand All @@ -710,6 +713,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`). |
| `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`). |

### Slack Notifications
Expand Down
6 changes: 6 additions & 0 deletions templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ data:
{{- if hasKey . "query_history_limit" }}
query_history_limit = {{ .query_history_limit }}
{{- end }}
{{- if hasKey . "slow_queries_threshold" }}
slow_queries_threshold = {{ .slow_queries_threshold }}
{{- end }}
{{- if hasKey . "autoreload" }}
autoreload = {{ .autoreload | quote }}
{{- end }}
Expand Down Expand Up @@ -207,6 +210,9 @@ data:
{{- if hasKey . "server_connections" }}
server_connections = {{ .server_connections }}
{{- end }}
{{- if hasKey . "slow_queries" }}
slow_queries = {{ .slow_queries }}
{{- end }}
{{- end }}
{{- with .incident_io }}

Expand Down
6 changes: 6 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ for values_file in "$TEST_DIR"/values-*.yaml; do
helm template test-release "$CHART_DIR" -f "$values_file" > /dev/null
done

echo ""
echo "==> Verifying query alert settings..."
full_render=$(helm template test-release "$CHART_DIR" -f "$TEST_DIR/values-full.yaml")
grep -q '^ slow_queries_threshold = 2500$' <<< "$full_render"
grep -q '^ slow_queries = true$' <<< "$full_render"

echo ""
echo "==> Verifying external Redis rendering..."
external_render=$(helm template test-release "$CHART_DIR" -f "$TEST_DIR/values-redis-external.yaml")
Expand Down
2 changes: 2 additions & 0 deletions test/values-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ control:
process_notify_interval_secs: 30
metrics_retention_secs: 600
query_history_limit: 500
slow_queries_threshold: 2500
autoreload: "immediately"
autoscaling:
pool_size: true
Expand Down Expand Up @@ -68,6 +69,7 @@ control:
cpu: 90.0
memory: 2048
server_connections: 100
slow_queries: true
incident_io:
api_key: incident-token
slack:
Expand Down
2 changes: 2 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ control:
# process_notify_interval_secs: 60
# metrics_retention_secs: 300
# query_history_limit: 1000
# slow_queries_threshold: 5000 # Minimum query duration in milliseconds.
# autoreload: off
autoscaling: {}
# pool_size: false
Expand Down Expand Up @@ -155,6 +156,7 @@ control:
# cpu: 90.0
# memory: 2048
# server_connections: 100
# slow_queries: false
# incident_io:
# api_key: ""
slack: {}
Expand Down
Loading