<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gokul Skumar</title>
    <description>The latest articles on DEV Community by Gokul Skumar (@gokul_skumar_b11a3f36e2b9).</description>
    <link>https://dev.to/gokul_skumar_b11a3f36e2b9</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3828591%2Fd3165265-5051-46f7-af0f-107a9a4791d0.jpg</url>
      <title>DEV Community: Gokul Skumar</title>
      <link>https://dev.to/gokul_skumar_b11a3f36e2b9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gokul_skumar_b11a3f36e2b9"/>
    <language>en</language>
    <item>
      <title>Introduction to the Loki Stack: Lightweight Logging for Kubernetes</title>
      <dc:creator>Gokul Skumar</dc:creator>
      <pubDate>Tue, 17 Mar 2026 05:25:05 +0000</pubDate>
      <link>https://dev.to/gokul_skumar_b11a3f36e2b9/introduction-to-the-loki-stack-lightweight-logging-for-kubernetes-5h2o</link>
      <guid>https://dev.to/gokul_skumar_b11a3f36e2b9/introduction-to-the-loki-stack-lightweight-logging-for-kubernetes-5h2o</guid>
      <description>&lt;h2&gt;
  
  
  What is the Loki Stack?
&lt;/h2&gt;

&lt;p&gt;Loki Stack is a lightweight, cloud‑native logging system built with the same design philosophy as Prometheus. It’s a great fit for Kubernetes environments because it keeps things simple, scalable, and cost‑effective — all of which matter a lot in modern DevOps workflows.&lt;/p&gt;


&lt;div class="crayons-card c-embed"&gt;

  
&lt;h3&gt;
  
  
  The Core Idea 💡
&lt;/h3&gt;

&lt;p&gt;Unlike traditional logging tools that index the entire log content, Loki takes a smarter approach: &lt;strong&gt;it indexes only the metadata labels.&lt;/strong&gt; Logs themselves are stored as compressed streams. This makes Loki far more efficient and cheaper to run compared to systems like Elasticsearch.&lt;br&gt;

&lt;/p&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Key Components
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Loki
&lt;/h3&gt;

&lt;p&gt;The core engine. It handles log ingestion, storage, and querying. Components like the Distributor, Ingester, and Querier work together to push logs, compress them, store them (often in S3 or GCS), and make them searchable.&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/grafana" rel="noopener noreferrer"&gt;
        grafana
      &lt;/a&gt; / &lt;a href="https://github.com/grafana/loki" rel="noopener noreferrer"&gt;
        loki
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Like Prometheus, but for logs.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/grafana/loki/docs/sources/logo_and_name.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fgrafana%2Floki%2Fdocs%2Fsources%2Flogo_and_name.png" alt="Loki Logo"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/grafana/loki/actions/workflows/check.yml" rel="noopener noreferrer"&gt;&lt;img src="https://github.com/grafana/loki/actions/workflows/check.yml/badge.svg" alt="Check"&gt;&lt;/a&gt;
&lt;a href="https://goreportcard.com/report/github.com/grafana/loki" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/9cc6145ff0689bd6de69e5187f846e5baef0dfe2f0acdc47f3e20dac78c7c7c7/68747470733a2f2f676f7265706f7274636172642e636f6d2f62616467652f6769746875622e636f6d2f67726166616e612f6c6f6b69" alt="Go Report Card"&gt;&lt;/a&gt;
&lt;a href="https://slack.grafana.com/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/7b75579a24cbc994b148facad1bbe03b0a536fe1b563d405fa5e0372270761cd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e253230736c61636b2d2532336c6f6b692d627269676874677265656e2e737667" alt="Slack"&gt;&lt;/a&gt;
&lt;a href="https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&amp;amp;can=1&amp;amp;q=proj:loki" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/dd0b623028678eed4e5f77ff15626e4bbe02c71b2d185a8ca9f7bc95bfa281f5/68747470733a2f2f6f73732d66757a7a2d6275696c642d6c6f67732e73746f726167652e676f6f676c65617069732e636f6d2f6261646765732f6c6f6b692e737667" alt="Fuzzing Status"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Loki: like Prometheus, but for logs.&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by &lt;a href="https://prometheus.io/" rel="nofollow noopener noreferrer"&gt;Prometheus&lt;/a&gt;
It is designed to be very cost effective and easy to operate
It does not index the contents of the logs, but rather a set of labels for each log stream.&lt;/p&gt;
&lt;p&gt;Compared to other log aggregation systems, Loki:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;does not do full text indexing on logs. By storing compressed, unstructured logs and only indexing metadata, Loki is simpler to operate and cheaper to run.&lt;/li&gt;
&lt;li&gt;indexes and groups log streams using the same labels you’re already using with Prometheus, enabling you to seamlessly switch between metrics and logs using the same labels that you’re already using with Prometheus.&lt;/li&gt;
&lt;li&gt;is an especially good fit for storing &lt;a href="https://kubernetes.io/" rel="nofollow noopener noreferrer"&gt;Kubernetes&lt;/a&gt; Pod logs. Metadata such as Pod labels is automatically scraped and indexed.&lt;/li&gt;
&lt;li&gt;has native support in Grafana (needs Grafana v6.0).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A Loki-based logging stack consists of…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/grafana/loki" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;




&lt;h3&gt;
  
  
  2. Grafana
&lt;/h3&gt;

&lt;p&gt;This is where you visualize and explore logs. Using &lt;strong&gt;LogQL&lt;/strong&gt;, you can filter log streams and even correlate logs with metrics and traces in the same dashboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Promtail or Fluentd
&lt;/h3&gt;

&lt;p&gt;These agents run on your nodes or containers. They collect logs, attach meaningful labels, and send them to Loki.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture Diagram:
&lt;/h3&gt;


&lt;div class="crayons-card c-embed"&gt;

  &lt;br&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbdcppldho34frevnme4n.png" alt="Architecture Diagram"&gt;&lt;br&gt;

&lt;/div&gt;


&lt;h2&gt;
  
  
  Helm Chart Installation
&lt;/h2&gt;

&lt;p&gt;First, add the Grafana repository and download the chart to your local machine:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

helm repo add grafana https://grafana.github.io/helm-charts
helm fetch grafana/loki-stack
Next, install the chart into your cluster:

helm upgrade --install loki --namespace=loki-stack &amp;lt;path&amp;gt;
Accessing Grafana
If you are using the Grafana instance included in the Loki package, retrieve the admin password with this command:

kubectl get secret --namespace &amp;lt;namespace&amp;gt; loki-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
Configuring the Loki Data Source
To connect Loki to your existing Grafana instance:

Click the Configuration (gear icon) in the left panel.
Select Data sources.
Click the Add data source button.
Select Loki from the list.
Set the URL to: http://loki.&amp;lt;namespace&amp;gt;.svc:3100.
Click Save &amp;amp; test.

Success! If configured correctly, you will see a green message: Data source connected and labels found.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>devops</category>
      <category>kubernetes</category>
      <category>monitoring</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
