Skip to content

Commit 8bfbe06

Browse files
committed
documentatino update
1 parent 847d0fc commit 8bfbe06

3 files changed

Lines changed: 50 additions & 4 deletions

File tree

docs-md/LOKI_HELM_CHART.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ deployments/openshift/helm/plg/
3535
| `loki.storageClassName` | Storage class (empty = cluster default) | `""` |
3636
| `loki.resources.requests.memory` | Memory request | `256Mi` |
3737
| `loki.resources.requests.cpu` | CPU request | `500m` |
38-
| `loki.resources.limits.memory` | Memory limit | `256Mi` |
38+
| `loki.resources.limits.memory` | Memory limit | `256Mi` (OpenShift override: `2Gi`) |
3939
| `loki.resources.limits.cpu` | CPU limit | `500m` |
4040
| `loki.httpPort` | HTTP listen port | `3100` |
4141

@@ -71,6 +71,34 @@ To change the retention period, override `loki.retentionDays`:
7171
helm upgrade plg ./deployments/openshift/helm/plg --set loki.retentionDays=14
7272
```
7373

74+
## Ingestion Rate Limits
75+
76+
The OpenShift deployment configures ingestion limits to apply back-pressure before Loki exhausts its memory ceiling:
77+
78+
| Setting | Value | Purpose |
79+
|---------|-------|---------|
80+
| `ingestion_rate_mb` | 4 | Sustained ingest rate per tenant (MB/s) |
81+
| `ingestion_burst_size_mb` | 8 | Burst allowance above the sustained rate |
82+
| `chunk_idle_period` | 30m | Flush idle chunks to disk after this interval |
83+
| `chunk_target_size` | 1536000 (~1.5MB) | Flush a chunk to disk once it reaches this size |
84+
85+
Without these limits, Loki accumulates unbounded in-memory chunks when ingestion outpaces disk flushes, eventually reaching the memory ceiling and being OOMKilled. The ingestion limits cause Promtail to receive a `429 Too Many Requests` response and retry, rather than Loki silently growing until it is killed.
86+
87+
## Prometheus Metrics
88+
89+
Loki exposes a `/metrics` endpoint on its HTTP port. The PLG Prometheus instance scrapes it via a dedicated `loki` scrape job configured in `prometheus-configmap.yaml`. Use `{job="loki"}` as the label selector in queries, for example:
90+
91+
```promql
92+
# Current RSS memory usage
93+
process_resident_memory_bytes{job="loki"}
94+
95+
# In-memory ingester chunks
96+
loki_ingester_memory_chunks
97+
98+
# Ingest rate (bytes/sec)
99+
rate(loki_distributor_bytes_received_total[5m])
100+
```
101+
74102
## Deployment
75103

76104
### OpenShift

docs-md/PLG_DEPLOYMENT_INTEGRATION.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,22 @@ The PLG deployment is completely independent of the Kustomize-based application
7474
- No Kustomize base or overlay files are modified for PLG
7575
- If PLG deployment fails, the application deployment is unaffected
7676

77+
## Prometheus RBAC
78+
79+
Prometheus uses Kubernetes pod service discovery (`kubernetes_sd_configs`) to scrape `backend-services` and `temporal-worker` pods by IP across replicas. This requires permission to list and watch pods in the namespace.
80+
81+
The chart creates a dedicated `ServiceAccount`, `Role` (pods: `get`/`list`/`watch`), and `RoleBinding` for the Prometheus StatefulSet. These are scoped to the release namespace only. The `default` service account is not used — it has no pod-list permissions on OpenShift.
82+
83+
## ches-adapter and Alertmanager
84+
85+
The ches-adapter Deployment, Service, PodDisruptionBudget, and sidecar ConfigMaps are only rendered when **both** `alertmanager.notificationsEnabled: true` and `alertmanager.notificationChannel: "ches"`. When notifications are disabled (the default), none of these resources are created and no ches-adapter image is required.
86+
87+
Similarly, the `ches-notifications` and `teams-notifications` receivers in the Alertmanager config are only emitted when `notificationsEnabled: true`. This prevents Alertmanager from failing to start due to empty webhook URL validation when notifications are off.
88+
89+
## Grafana Storage
90+
91+
Grafana stores its SQLite database and alert history on a `ReadWriteOnce` PersistentVolumeClaim. The Deployment uses `strategy: Recreate` rather than the default `RollingUpdate`, so the old pod is terminated before the new one starts. This prevents `Multi-Attach` errors caused by two pods competing for the same RWO volume during an upgrade.
92+
7793
## Accessing Grafana
7894

7995
Grafana is not exposed via an OpenShift Route. Access it via port-forwarding:

docs-md/PROMTAIL_SIDECARS.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ Each application pod includes a Promtail sidecar container that:
2222

2323
## Resource Limits
2424

25-
All Promtail sidecars use minimal resource allocations:
25+
Promtail sidecars on PVC-backed services (`backend-services`, `temporal-worker`) use the following allocations:
2626

2727
| Resource | Request | Limit |
2828
|----------|---------|-------|
29-
| Memory | 32Mi | 64Mi |
29+
| Memory | 64Mi | 128Mi |
3030
| CPU | 50m | 100m |
3131

32-
These defaults are sized for low-traffic environments. To adjust resource limits, modify the Promtail container resource specifications in the relevant deployment manifests under `deployments/openshift/kustomize/base/`.
32+
The memory limit is set to 128Mi to prevent OOMKills caused by Loki backpressure. When Loki is under memory pressure it slows ingest responses, causing Promtail to buffer pending log batches in-heap. A 64Mi limit was insufficient in practice and caused CrashLoopBackOff on both `backend-services` and `temporal-worker` pods.
33+
34+
To adjust resource limits, modify the Promtail container resource specifications in the relevant deployment manifests under `deployments/openshift/kustomize/base/`.
3335

3436
## Configuration
3537

0 commit comments

Comments
 (0)