Developers SSH into servers and `grep` log files to debug. You are asked to centralise logging. Where do you start?
BeginnerScenarioLogging Pipelines
Answer
Situation read → No central logs means slow debugging, lost evidence when instances die, and too many people with SSH access.
What I'd do →
- Pick a backend that matches budget and query needs: Loki (cheap, label-indexed), Elasticsearch/OpenSearch (full-text), or a managed service (CloudWatch Logs, Grafana Cloud).
- Deploy one shipper per node: Grafana Alloy, Fluent Bit or Vector, tailing
/var/log/*.logand the journal. - Attach consistent labels:
env,service,host,cluster. - Set a retention policy (e.g. 14 days hot, 90 days archived to S3).
- Give developers Grafana Explore or Kibana and then remove routine SSH access.
Why → Logs survive instance termination, everyone searches in one place, and you can build alerts on top.
Interview tip → Say what you would not do first: shipping everything at DEBUG level on day one.
More on Logging Pipelines
Your 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?IntermediateA Java stack trace shows up in Kibana as 40 separate log events. How do you fix it?Beginner