Skip to content

Commit

Permalink
Add option to configure Prometheus retention (#640)
Browse files Browse the repository at this point in the history
Allow to set Prometheus retention to configurable value,
which defaults to 1y.
  • Loading branch information
mpryc authored Sep 16, 2022
1 parent dc30e53 commit 62c5d7d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/pelorus/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 1.8.1
version: 1.8.2

dependencies:
- name: exporters
Expand Down
1 change: 1 addition & 0 deletions charts/pelorus/templates/prometheus-cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spec:
name: thanos-objstore-config
{{- end }}
replicas: 2
retention: {{ .Values.prometheus_retention | default "1y" }}
replicaExternalLabelName: ""
ruleNamespaceSelector: {}
ruleSelector: {}
Expand Down
3 changes: 3 additions & 0 deletions charts/pelorus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ extra_prometheus_hosts:
## Persistent storage for Prometheus Operator
# https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/storage.md

# Set Prometheus retention time. Older data values are deleted
# prometheus_retention: 1y

# Uncomment to use PVC for Prometheus
# prometheus_storage: true

Expand Down
8 changes: 8 additions & 0 deletions docs/Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ You may additionally want to enabled other features for the core stack. Read on

See [Configuring the Pelorus Stack](Configuration.md) for a full readout of all possible configuration items. The following sections describe the most common supported customizations that can be made to a Pelorus deployment.

### Configure Prometheus Retention

Prometheus is removing data older than 1 year, so if the metric you are interested in happened to be older than 1 year it won't be visible. This is configurable in the `values.yaml` file with the following option:

```yaml
prometheus_retention: 1y
```
### Configure Prometheus Persistent Volume (Recommended)
Unlike ephemeral volume that have a lifetime of a pod, persistent volume allows to withstand container restarts or crashes making Prometheus data resilient to such situations.
Expand Down

0 comments on commit 62c5d7d

Please sign in to comment.