Skip to content

Commit

Permalink
feat: add support for customizing wal settings (#337)
Browse files Browse the repository at this point in the history
* feat: add support for customizing wal settings
* docs: update examples to include the wal settings customization
* docs: update readme values to include the wal settings customization
  • Loading branch information
claudioscalzo authored Jan 16, 2024
1 parent de79fdc commit ad28c9b
Show file tree
Hide file tree
Showing 38 changed files with 340 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/k8s-monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ The Prometheus and Loki services may be hosted on the same cluster, or remotely
| externalServices.prometheus.tenantId | string | `""` | Sets the X-Scope-OrgID header when sending metrics |
| externalServices.prometheus.tenantIdKey | string | `"tenantId"` | The key for the tenant ID property in the secret |
| externalServices.prometheus.tls | object | `{}` | TLS setting to configure for the metrics service. For remoteWrite protocol, refer to https://grafana.com/docs/agent/latest/flow/reference/components/prometheus.remote_write/#tls_config-block For otlp protocol, refer to https://grafana.com/docs/agent/latest/flow/reference/components/otelcol.exporter.otlp/#tls-block For otlphttp protocol, refer to https://grafana.com/docs/agent/latest/flow/reference/components/otelcol.exporter.otlphttp/#tls-block |
| externalServices.prometheus.wal.maxKeepaliveTime | string | `"8h"` | Maximum time to keep data in the WAL before removing it. |
| externalServices.prometheus.wal.minKeepaliveTime | string | `"5m"` | Minimum time to keep data in the WAL before it can be removed. |
| externalServices.prometheus.wal.truncateFrequency | string | `"2h"` | How frequently to clean up the WAL. |
| externalServices.prometheus.writeEndpoint | string | `"/api/prom/push"` | Prometheus metrics write endpoint. Preset for Grafana Cloud Metrics instances. |
| externalServices.prometheus.writeRelabelConfigRules | string | `""` | Rule blocks to be added to the write_relabel_config block of the prometheus.remote_write component. See https://grafana.com/docs/agent/latest/flow/reference/components/prometheus.remote_write/#write_relabel_config-block |
| externalServices.tempo.authMode | string | `"basic"` | one of "none", "basic" |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ prometheus.remote_write "metrics_service" {
{{- end }}
}

wal {
truncate_frequency = {{ .wal.truncateFrequency | quote }}
min_keepalive_time = {{ .wal.minKeepaliveTime | quote }}
max_keepalive_time = {{ .wal.maxKeepaliveTime | quote }}
}

external_labels = {
{{- range $key, $value := .externalLabels }}
{{ $key }} = {{ $value | quote }},
Expand Down
14 changes: 14 additions & 0 deletions charts/k8s-monitoring/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,20 @@
"tls": {
"type": "object"
},
"wal": {
"type": "object",
"properties": {
"truncateFrequency": {
"type": "string"
},
"minKeepaliveTime": {
"type": "string"
},
"maxKeepaliveTime": {
"type": "string"
}
}
},
"writeEndpoint": {
"type": "string"
},
Expand Down
11 changes: 11 additions & 0 deletions charts/k8s-monitoring/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ externalServices:
checkInterval: 1s
# -- Maximum amount of memory targeted to be allocated by the process heap.
limit: 0MiB

# Write-Ahead Log (WAL) settings. Only applies when protocol is "remote_write"
wal:
# -- How frequently to clean up the WAL.
truncateFrequency: 2h

# -- Minimum time to keep data in the WAL before it can be removed.
minKeepaliveTime: 5m

# -- Maximum time to keep data in the WAL before removing it.
maxKeepaliveTime: 8h

# Connection information for Grafana Loki
loki:
Expand Down
6 changes: 6 additions & 0 deletions examples/control-plane-metrics/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/control-plane-metrics/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/custom-allow-lists/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/custom-allow-lists/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/custom-config/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/custom-config/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/default-values/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/default-values/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/eks-fargate/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/eks-fargate/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/extra-rules/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/extra-rules/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/gke-autopilot/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/gke-autopilot/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/ibm-cloud/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/ibm-cloud/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/metrics-only/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ad28c9b

Please sign in to comment.