:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(dev): Limit local otel-collector perf impact (#68414)
Michael Matlokab3116ea13ab1
diff --git a/docker-compose.base.yml b/docker-compose.base.ymlindex 5bbd6cf6a7d3..9d9425781acd 100644--- a/docker-compose.base.yml+++ b/docker-compose.base.yml@@ -792,6 +792,18 @@ services:- jaegernetworks:- otel_network+ # Cap the footprint: the collector parses every container's logs, so one+ # log-flooding container could otherwise peg many cores and balloon RAM.+ cpus: 2+ mem_limit: 2g+ environment:+ # Keep Go's GC under mem_limit so pressure triggers collection, not an OOM kill.+ GOMEMLIMIT: 1750MiB+ logging:+ driver: json-file+ options:+ max-size: '50m'+ max-file: '3'jaeger:image: jaegertracing/all-in-one:1.76.0diff --git a/otel-collector-config.dev.yaml b/otel-collector-config.dev.yamlindex 3e8758474ce1..60839f3c0459 100644--- a/otel-collector-config.dev.yaml+++ b/otel-collector-config.dev.yaml@@ -97,6 +97,9 @@ exporters:headers:# special "local" token is automatically mapped to team_id 1 in dev environmentsauthorization: Bearer phc_local+ # Give up in 30s (vs the 5 min default) when capture-logs is down.+ retry_on_failure:+ max_elapsed_time: 30sotlphttp/logs:endpoint: 'http://host.docker.internal:4320'compression: none@@ -105,6 +108,8 @@ exporters:headers:# special "local" token is automatically mapped to team_id 1 in dev environmentsauthorization: Bearer phc_local+ retry_on_failure:+ max_elapsed_time: 30sotlphttp/metrics:endpoint: 'http://host.docker.internal:4320'compression: none@@ -112,26 +117,35 @@ exporters:insecure: trueheaders:authorization: Bearer phc_local+ retry_on_failure:+ max_elapsed_time: 30sprocessors:+ # Shed load instead of buffering to multiple GB of RAM when a downstream+ # (e.g. capture-logs) is unreachable.+ memory_limiter:+ check_interval: 1s+ limit_mib: 512+ spike_limit_mib: 128batch:service:pipelines:traces:receivers: [otlp]- processors: [batch]+ processors: [memory_limiter, batch]exporters: [otlp, otlphttp]logs:exporters:- otlphttp/logsprocessors:+ - memory_limiter- batchreceivers:- otlp- receiver_creatormetrics:receivers: [otlp, prometheus]- processors: [batch]+ processors: [memory_limiter, batch]exporters: [otlphttp/metrics]extensions: [docker_observer, health_check, zpages] # Enabling the declared extensions