Skip to content

Commit 5addec5

Browse files
RoyLinRoyLin
authored andcommitted
deploy: harden otel-collector config (memory_limiter + sending_queue/retry)
The sample claimed it survives a backend outage but had neither a sending queue nor retry, and no memory_limiter (OOM risk under backpressure). Add memory_limiter (first), explicit batch sizing, and otlp retry_on_failure + in-memory sending_queue.
1 parent 47c1be8 commit 5addec5

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ All notable changes to a3s-observer will be documented in this file.
1111
fanotify `FAN_OPEN_PERM` v0.4.0); the file guard uses fanotify, not LSM-BPF, because `bpf`
1212
isn't in this kernel's `lsm=` set.
1313
- Removed redundant `unsafe` blocks in the eBPF probes (clean build).
14+
- `deploy/otel-collector.yaml` hardened for production: `memory_limiter` (OOM guard under
15+
backpressure) + `sending_queue` / `retry_on_failure` so it actually survives a backend
16+
outage (which the header claimed but the config didn't do).
1417

1518
## [0.5.1] — production hardening
1619

deploy/otel-collector.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,31 @@ receivers:
3131
parse_from: body
3232

3333
processors:
34-
batch: {}
34+
# memory_limiter MUST be first — it sheds load before the Collector OOMs under backpressure
35+
# (e.g. a slow/dead backend filling the sending queue).
36+
memory_limiter:
37+
check_interval: 5s
38+
limit_percentage: 80
39+
spike_limit_percentage: 20
40+
batch:
41+
timeout: 5s
42+
send_batch_size: 1024
3543

3644
exporters:
37-
debug: # prints received records — use this to smoke-test the pipeline
38-
verbosity: detailed
3945
otlp:
4046
endpoint: ${env:OTEL_EXPORTER_OTLP_ENDPOINT} # Tempo / Jaeger / Loki / vendor OTLP
4147
tls:
42-
insecure: true
48+
insecure: true # production: set false and configure CA / mTLS
49+
retry_on_failure:
50+
enabled: true
51+
sending_queue:
52+
enabled: true # buffer across a backend outage; add file_storage to also survive restarts
53+
debug: # add to a pipeline's exporters to smoke-test (prints received records)
54+
verbosity: detailed
4355

4456
service:
4557
pipelines:
4658
logs:
4759
receivers: [filelog]
48-
processors: [batch]
49-
exporters: [debug, otlp]
60+
processors: [memory_limiter, batch]
61+
exporters: [otlp] # add `debug` to smoke-test the pipeline

0 commit comments

Comments
 (0)