All posts
engineeringkubernetes

Navigating High-Capacity Log Management: Insights from the 'Loki at Scale' Webinar

How Capillary Technologies moved high-volume logging to Grafana Loki: the architecture, the phased rollout and the tuning that made it work at scale.

Rohit Raveendran
Rohit Raveendran
Feb 15, 2024 · 8 min read

High-volume logging is a real struggle, and in response to the interest in this topic we hosted a webinar titled 'Loki at Scale: Navigating High-Volume Logging Challenges.' Our guest was Sreejith S, DevOps Lead at Capillary Technologies.

Managing approximately 1.5 TB of logs per cluster daily, Sreejith played a critical role in Capillary's Loki adoption, in close collaboration with the Facets team.

Representing Facets, we were joined by Rohit Raveendran, Co-founder and VP Engineering, and Pramodh Ayyappan, DevOps Tech Lead. Together, they shared the learnings from implementing Loki.

The challenge before Loki

Capillary Technologies was facing challenges with its log management solution. Their log volume was over 1.5 TB of logs per day, and they had to retain these for over a year for compliance and daily operations. Compared to the massive volume, searches were almost non-existent: only a couple of hundred searches a day.

Adding to this challenge was the need for dedicated engineering effort just to manage these logs. Their old solution was simple and reliable, but over time it turned out to be expensive and hard to scale. With a high volume and a low search ratio, their return on investment was poor. They were sitting on a data goldmine but could not use it for business metrics and alerts.

Diagram of Capillary's log management process before Loki

Log Management Process Pre-Loki

They needed a solution where a similar investment would yield higher returns and make the team more efficient. The team evaluated options such as ELK, Parseable and New Relic, and chose Loki. The decision came down to Loki's scalability, cost, return on investment and Grafana integration, all of which matched Capillary's needs.

Loki architecture in one paragraph

Loki indexes only the labels of each log stream, such as the namespace, the app and the pod, and never the full log text. Log lines are compressed into chunks and kept in object storage such as Amazon S3, which is cheap at any volume. Distributors receive logs from agents such as Promtail, ingesters batch them into chunks and write them out, and queriers search the chunks that match a query's labels. Each component scales on its own, and caches in front of the queriers keep repeated queries fast.

Diagram of the Loki architecture. Log agents such as Promtail send log streams to distributors. Distributors pass them to ingesters, which batch log lines into compressed chunks. Chunks and a small label index go to object storage such as Amazon S3. Grafana sends queries through a query frontend with a cache to queriers, which read recent logs from ingesters and older logs from object storage.

Core differentiator: label-only indexing

What sets Loki apart is its minimal indexing strategy: it indexes only the labels and not the entire log content. This keeps queries on labels fast and cuts storage needs sharply. Inspired by Prometheus, Loki's design was scalable and robust, which made it a strong choice for large-scale logging at Capillary. The four key differentiators were:

Diagram of Loki's four key architectural differentiators, including minimal label-based indexing and Prometheus-inspired scalability

Implementing Loki: a phased strategy

Although Loki had everything Sreejith and his team were looking for, the implementation was not straightforward. The team took a methodical approach to moving from their legacy system to Loki.

The approach is twofold: a technical strategy that relies on phased deployment, thorough load testing and continuous performance monitoring; and a change management strategy that puts training, accessible documentation and an active feedback loop first.

Technical Strategy:

  • Phased Deployment: The existing approach needed extensive testing and adjustment. A step-by-step rollout made sure that Loki's integration did not affect existing operations, and the team tuned performance under different scenarios.

  • Load Testing: The team ran rigorous load tests to understand how Loki performs under different stress levels. These insights were critical for tuning system configurations and for scalability and reliability at full deployment.

  • Monitoring and Optimization: The team monitored Loki's performance and resource usage continuously, and used these metrics to tune configurations, improve efficiency and reduce costs.

Managing Change in Developer Processes:

  • Comprehensive Training: A training program covered Loki's architecture, features and best practices. Hands-on sessions helped developers get familiar with the new system.

  • Documentation and Support: Developers got detailed documentation and support channels, so they had the information and help they needed during the transition.

  • Feedback Loop: A feedback loop with developers gathered insights on what worked and what did not. It proved invaluable for improving both the technical strategy and developer support.

Overcoming implementation challenges

Transitioning to Loki brought its own set of challenges, each needing a specific fix. Rate limiting, ingester overloads and S3 API rate limits surfaced during the implementation. The team tackled these by adjusting ingestion rates and stream sizes and by tuning query performance.

Rate Limiting and Ingester Overloads: Adjusting ingestion rates and stream sizes was key to managing the load. This calibration let the system handle high volumes of data without losing data or adding latency, so ingesters could process logs smoothly.

S3 API Rate Limits: Caching and query sharding reduced the number of calls to the S3 API. This lowered latency and made queries more responsive.

Query Performance: Better query processing and a tuned indexing strategy made queries faster, so engineers got to their logs sooner.

Collaborative Optimization: The partnership between Facets and Capillary produced a Loki setup tailored to Capillary's workload, built to address the specific challenges they faced.

Watch the Webinar

The business impact of implementing Loki

Adopting Loki improved both log management and troubleshooting. Developers got faster access to logs, which sped up issue resolution. The Loki architecture also made it simple to extract business metrics from logs. Here are a few of the impacts that stand out:

More Efficient Log Management: Loki handled large volumes of log data with less time and effort spent on log processing and management.

Faster Issue Resolution: Developers spent much less time getting to logs. Faster access meant quicker diagnosis and fixes, less downtime and a more reliable system.

Better Analytics: With metrics extracted from logs, Capillary Technologies could analyze its data more deeply, with a clearer view of system performance, user behavior and areas to improve.

Scalability and Flexibility: Loki gave Capillary's logging infrastructure room to grow. It handles varying log volumes and can scale up as the organization grows.

Cost-Effectiveness: The minimal indexing strategy, together with object storage, lowers storage costs, which makes Loki a viable option for large-scale log management.

Here are some of the key takeaways from the implementation:

The five key takeaways from Capillary's Loki implementation

How Facets runs Loki today

In Facets, every environment runs Prometheus, Grafana and Alertmanager. Loki adds logs to that picture, and it can also collect logs from applications on VMs through Promtail (Setting up Loki for VMs).

For many resources, the Live tab shows a historical logs dashboard next to its metrics, so a developer starts from the resource instead of a separate tool. Loki's own alerts, such as CPU or memory throttling and OOM-killed pods, come with a runbook. With Praxis, your own AI assistant can fetch and search a pod's logs through K8s Inspector and explain what it found. Operations, debugging and cloud cost covers the rest of the operations toolset.

Conclusion

The "Loki at Scale" webinar covered one tool and a wider lesson: high-volume logging is complex, one size does not fit all, and it takes real domain knowledge to solve these problems. For people in DevOps and platform engineering, adopting tools like Loki is about more than keeping pace with technology. It is about using them to run operations well and support business growth.

Read the full Capillary Technologies case study, or see how observability fits into every phase of delivery in observability by design. To watch the full webinar, follow the link below.

Watch Full Webinar

Tags

#garafana-loki-#loki-integration-#loki-and-facets