Should you log every HTTP request at the ingress controller?
BeginnerScenarioLogging Pipelines
Answer
Situation read → Access logs are valuable for security and debugging but can be the largest log source.
What I'd do →
- Enable structured (JSON) access logs at ingress with key fields: status, latency, upstream, bytes, client IP, request ID.
- Keep all 4xx/5xx and slow requests; sample successful 2xx (e.g. 10%) if volume is a concern.
- Derive request metrics from Prometheus (ingress exports them) instead of computing them from logs.
- Set shorter retention for access logs than for app errors.
Why → Metrics give the rate; logs give the evidence for specific failing requests.
Interview tip → Mention security needs: sometimes full access logs are required for forensics.
More on Logging Pipelines
Developers SSH into servers and `grep` log files to debug. You are asked to centralise logging. Where do you start?BeginnerYour app writes free-text logs like `User 42 paid 19.99 in 340ms`. Why push for structured logging, and how?BeginnerLoki ingestion is failing with `stream limit exceeded` and the ingester memory is exploding. What happened?IntermediateFluent Bit pods on busy nodes are dropping logs during traffic spikes. How do you make the pipeline lossless?IntermediateThe Elasticsearch cluster for logs goes red every Monday after the weekend batch jobs. How do you stabilise it?AdvancedFinance says the log bill doubled in a quarter. How do you cut it without losing debugging ability?Intermediate