Skip to main content
Cloud DevOps Solutions
Get a quote Talk to an engineer

Logging & Tracing

Deploying ELK or Grafana Loki: Choosing and Building Your Log Platform

We deploy either the ELK stack (Elasticsearch, Logstash or Beats, Kibana) or Grafana Loki, whichever matches how your team searches logs and what you can afford to run. Elasticsearch indexes full text for rich search. Loki indexes only labels, so storage is cheaper and operations simpler.

Key takeaways

  • ELK indexes the content of every log line, which gives powerful search and aggregation at a higher storage and operations cost.
  • Loki indexes labels only and keeps log content compressed in object storage, which is cheaper but needs disciplined labelling.
  • The right choice depends on query patterns, retention, team skills and existing Grafana or Kibana usage, not on fashion.
  • Both are deployed as code, with sizing, storage, access control and upgrade paths decided up front.
  • We will tell you plainly when a managed service or a smaller setup is the better buy.

Why the platform choice matters

Most teams start with kubectl logs and a lot of luck. That works until a pod restarts and its logs vanish, or an incident spans six services and nobody can line the evidence up. At that point a central log platform stops being optional. The expensive mistake is not picking the “wrong” product, it is picking one without knowing your volume, your questions and your budget, then discovering at 40 GB a day that search is slow, disks are full, or the invoice has doubled.

This page is the platform decision and build. Collection, routing, retention and alerting each have their own page, linked below. The overall programme sits within our logging, ELK, Loki and OpenTelemetry service, and the concept itself is explained in our log aggregation glossary entry.

How the two architectures differ

The core difference is what gets indexed.

AspectELK (Elasticsearch, Kibana)Grafana Loki
IndexingEvery field and token in the log lineLabels only, content stored compressed
StorageLocal or attached disks, tiered by node roleObject storage (S3, GCS, Azure Blob) for chunks
Query languageKQL, Lucene, ESQL, Query DSL
StrengthFree-text search, aggregations, analyticsCheap storage, label-scoped debugging, Grafana native
Weak spotDisk, memory and shard managementBroad string search over long ranges, high-cardinality labels
OperationsStateful cluster with careful upgradesSimpler components, depends on object storage

Neither is universally better. A team that debugs by service and namespace, and already uses Grafana for metrics, will usually be happier with Loki. A team that analyses customer behaviour from logs, or needs security search across many fields, will usually need Elasticsearch.

What good looks like

  • Every production log line is searchable within seconds of being written.
  • Logs survive pod, node and even cluster loss, because storage is outside the workload.
  • Access is by role: developers see their services, auditors see audit logs, nobody shares an admin password.
  • Capacity is known: you can state ingest rate, retention and the point at which you will need to scale.
  • The platform is rebuilt from code, not hand-tuned on a running cluster.

How we deploy it in practice

ELK on Kubernetes

For Elasticsearch on Kubernetes we generally use the Elastic operator (ECK) so that upgrades, certificates and node sets are declared rather than scripted. Nodes are split by role: dedicated masters for stability, hot data nodes on fast SSD for current indices, and warm or cold nodes for older data. Our retention and ILM page covers how data moves between them.

A minimal ECK cluster definition looks like this:

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: logs
spec:
  version: 8.15.0
  nodeSets:
    - name: master
      count: 3
      config:
        node.roles: ["master"]
    - name: hot
      count: 3
      config:
        node.roles: ["data_hot", "data_content", "ingest"]
      volumeClaimTemplates:
        - metadata:
            name: elasticsearch-data
          spec:
            accessModes: ["ReadWriteOnce"]
            storageClassName: gp3
            resources:
              requests:
                storage: 500Gi

Version, node counts and volumes are illustrative. Real values come from your measured volume, and we pin the version you actually run.

Loki on Kubernetes

For Loki we normally run the simple scalable or distributed deployment mode with an object storage bucket for chunks and the index. Compute is stateless apart from short-lived write-ahead data, so scaling and replacing nodes is easier than with Elasticsearch. The bucket, its lifecycle rules and the IAM role are created with Terraform, and configuration is delivered by GitOps.

# Loki storage fragment (illustrative)
schema_config:
  configs:
    - from: "2024-04-01"
      store: tsdb
      object_store: s3
      schema: v13
      index:
        prefix: loki_index_
        period: 24h
limits_config:
  retention_period: 720h
  max_global_streams_per_user: 50000

Labels are the design decision that makes or breaks Loki. A label such as namespace, app or level is fine. A label holding a user ID or request ID creates a separate stream for each value and destroys performance. We agree the label set with your team before rollout.

Decisions and trade-offs

Logstash or Beats or neither. Logstash is powerful for parsing and enrichment but heavy. Lightweight collectors such as Fluent Bit cover most Kubernetes needs, as described in our Fluent Bit DaemonSet page. We keep Logstash for cases that need its filter ecosystem.

Self-hosted or managed. Running Elasticsearch well is real work: shard counts, heap sizing, snapshots, rolling upgrades. If you have fewer than a handful of platform engineers and modest volume, a managed log service can be cheaper in total than your time. We say so when the numbers show it.

When not to build this. If you run a few services on a single VM and cloud-native logging already meets your needs, a full platform is overkill. Likewise, if your real gap is tracing or metrics, start with the monitoring service.

Common failure modes

  • Unbounded cardinality. Loki labels or Elasticsearch field mappings that grow without limit. We set mapping limits and label allow-lists.
  • Over-sharding. Too many small Elasticsearch shards waste memory. Index templates and rollover rules keep shard size sensible.
  • No back-pressure plan. A logging burst should slow collectors, not take down applications. We configure buffers and limits.
  • Single-copy data. Disks or buckets without replication or snapshots. We configure snapshots to object storage or bucket versioning.
  • Open access. Dashboards exposed without authentication. Everything sits behind single sign-on.

Delivery and handover

You receive the infrastructure and configuration in your own repositories and cloud account, a sizing note with the assumptions behind it, runbooks for common operations, and a walkthrough with your engineers. If you want us to keep running it, that is covered by Managed DevOps. Otherwise your team owns it from day one.

How to tell it is working

Search results arrive quickly, no log source is silently missing, ingest stays below the capacity you planned, and the monthly cost is within the model. If you want an independent view on which platform fits, book a consultation.

References

How we deliver it

  1. 01

    Profile your logs

    We measure daily volume, line size, burstiness, who searches and for what, and which logs are required for compliance.

  2. 02

    Choose the platform

    We compare ELK and Loki against your query patterns, retention and budget, and write down the decision and its trade-offs.

  3. 03

    Design the architecture

    Node roles, storage classes, object storage, replication, ingestion path and network boundaries are specified before anything is installed.

  4. 04

    Deploy as code

    Helm charts or operators, Terraform for buckets and IAM, and GitOps for configuration, so the platform is reproducible.

  5. 05

    Secure and connect

    Single sign-on, role-based access, TLS and tenant separation are configured, then collectors are pointed at the platform.

  6. 06

    Load test and hand over

    We replay realistic volume, tune limits, document operation and agree who runs upgrades and capacity reviews.

Tools and technologies

ElasticsearchLogstashBeatsKibanaGrafana LokiGrafanaGrafana AlloyFluent BitHelmTerraformAmazon S3Elastic Cloud on Kubernetes

Frequently asked questions

Should we use ELK or Grafana Loki?
Choose Elasticsearch when you need free-text search across fields, complex aggregations or security analytics. Choose Loki when logs are mostly filtered by service, namespace and level and you already run Grafana. Loki costs less to store and run, while Elasticsearch gives richer queries. We decide with your actual query habits.
Is Loki a replacement for Elasticsearch?
Only for some workloads. Loki does not build a full-text index, so searching for an arbitrary string over a long time range scans data. For incident debugging scoped by labels it is fast and cheap. For ad hoc analytics, reporting or SIEM style use, Elasticsearch is usually the better fit.
Can we run both ELK and Loki?
Yes, and some teams do. A common split sends application logs to Loki for everyday debugging and audit or security logs to Elasticsearch for retention and search. It adds a second system to operate, so we only recommend it when the two workloads genuinely differ.
How much does it cost to run a log platform?
It depends mostly on daily ingest volume, retention and replication. Elasticsearch needs fast disks and memory sized to indexed data, while Loki leans on object storage. We model your numbers before you commit rather than quoting a generic figure, and we include the engineering time to operate it.
Should we use a managed service instead of self hosting?
Sometimes, yes. If your volume is modest and nobody wants to operate stateful clusters, a managed offering removes real toil. Self hosting makes sense when volume, data residency or per-GB pricing makes managed costs unreasonable. We will compare both on your numbers.

Talk to an engineer about elk stack vs grafana loki

Book a free 30-minute call. We review your current setup and tell you honestly whether and how we can help.

Written by Saddique Khan, DevOps / SRE / Cloud Consultant Engineer. Last updated 2026-10-08.