What Is the LGTM Stack? How This Open Source Observability Stack Works
The LGTM stack combines Loki, Grafana, Tempo and Mimir into an open source observability stack. See how each part works, what it costs to run yourself and where it falls short.
The LGTM stack is a set of four open source tools that teams run together to collect, store and view logs, metrics and traces. Each letter covers one job: a log store, a dashboard layer, a trace store and a long-term metrics store.
Together they give a team the three core signals of observability without a license fee. We find most teams underestimate one point: the stack is four systems, not one.
Each part has its own storage, scaling model and query language, so the real cost shows up in the work of running it.
In this blog, you will:
Learn what each letter in the LGTM stack does and how the parts connect.
Follow how data flows from your services into the stack and back out.
See a worked example of what it takes to run the stack yourself.
What Is the LGTM Stack?
The LGTM stack is an open source observability stack built from four projects. Each one handles one type of telemetry or one layer of the experience. The four projects come from the same vendor and are free to self-host under the AGPLv3 license.
Teams often pick it because it pairs well with Prometheus, the default metrics tool in Kubernetes. If you already run Prometheus, the LGTM stack adds logs, traces and longer storage around it.
What Does LGTM Stand For?
LGTM stands for Loki, Grafana, Tempo and Mimir. Here is what each part does and how you query it.
Letter | Project | Role in the stack | Query language | Stores data? |
|---|---|---|---|---|
L | Loki | Log store | LogQL | Yes, in object storage |
G | Grafana | Dashboard and alerting layer | Uses the language of each data source | No, it only queries the others |
T | Tempo | Trace store | TraceQL | Yes, in object storage |
M | Mimir | Long-term metrics store | PromQL | Yes, in object storage |
One detail surprises many readers. The dashboard layer doesn't hold any telemetry itself. It sends queries to the three stores and draws the results, so the stack only works when all three stores are up.
How Does Each Part of the LGTM Stack Work?
Each store follows the same broad design. It receives data, holds recent data in memory, writes compressed blocks to object storage such as Amazon S3 and reads those blocks back at query time. The details differ by signal type.
How the LGTM Log Store Indexes Logs
The log store indexes only a small set of labels on each log stream, such as the app name, namespace and environment. It doesn't index the text of each log line. The lines themselves are compressed into chunks and written to object storage.
This design keeps the index small and storage cheap, which is the main reason teams choose it for log aggregation. What you give up is search speed. A query first narrows logs by label, then scans the matching chunks line by line.
Searching for one order ID across a week of logs can take a long time if the labels don't narrow it first.
Labels also need care. Every unique mix of label values creates a new stream. We've seen a single label for user ID or request ID turn a few hundred streams into millions, which slows ingestion and queries. It's the same high cardinality problem that metrics tools face.
How the Dashboard Layer Queries the Other Three
The dashboard layer connects to each store as a data source. Every panel on a dashboard runs a query in that store's own language. A latency chart runs PromQL against the metrics store, while a log panel next to it runs LogQL against the log store.
The same layer also runs alert rules and sends notifications. It links the signals through shared fields.
A panel can jump from a metric spike to traces from that window, or from a trace to logs that carry the same trace ID. Those links only work when every service attaches the same labels and IDs.
How the Trace Store Holds Distributed Traces
The trace store keeps distributed tracing data, which shows how one request moves across services. It accepts traces in common formats such as OpenTelemetry, Zipkin and Jaeger.
To keep costs low, it stores traces in object storage with very little indexing. The fastest lookup is by trace ID.
TraceQL lets you search by span attributes too, such as every checkout span slower than two seconds. We'd keep those searches to short time windows, because broad ones cost more to run.
How the Metrics Store Keeps Prometheus Data Long Term
A single Prometheus server keeps data on local disk, usually for about 15 days. The metrics store solves that limit. Prometheus servers send their samples to it through remote write, and it keeps them in object storage for months or years.
It also merges data from many Prometheus servers into one global view and splits data by tenant. Because it speaks PromQL, existing Prometheus queries and dashboards keep working.
How Does Data Flow Through an LGTM Observability Stack?
Data moves through the stack in four steps. We'll follow a fictional online store with a checkout service that runs on Kubernetes.
1. Instrument the services: The checkout code uses OpenTelemetry libraries to produce traces and metrics. It writes logs to standard output, and each log line carries the current trace ID.
2. Collect and route: A collector agent runs on each node. It reads container logs, receives traces and scrapes metrics. Many teams use the OpenTelemetry Collector for this job because it is vendor-neutral. This collection layer is the start of your telemetry pipeline.
3. Store by signal: The collector sends logs to the log store, traces to the trace store and metrics to the metrics store. Each store writes to its own object storage bucket.
4. Query and alert: Engineers open dashboards that query all three stores. Alert rules watch the metrics and send a notification when a rule matches.

The link between signals is the part that needs the most planning. Logs, metrics and traces live in three stores, so the only thing that connects them is shared data.
A trace ID in each log line lets you jump from a trace to its logs. Exemplars, which attach a trace ID to a metric sample, let you jump from a latency spike to one slow request.
If one service skips the trace ID, the jump breaks for that service. We'd treat consistent labels and IDs as part of the setup, not a later cleanup task.
Prometheus itself isn't part of the four letters. It is a separate open source project, and most teams keep it as the scraper and short-term store. The metrics store then becomes the long-term home for its data.
What Does It Take to Run the LGTM Stack Yourself?
Running the LGTM stack yourself means running three data stores and one dashboard layer, each with its own parts and upgrades.
The software is free, so the cost moves into storage, compute and engineering time. A worked example makes that concrete.
Take a fictional retail team with 40 microservices on Kubernetes. The numbers below are planning assumptions for this example, not benchmarks.
Logs: 150 GB of raw logs a day, kept for 30 days.
Metrics: 2 million active series, scraped every 15 seconds, kept for 90 days.
Traces: 1,000 spans a second on average, kept for 14 days.
We'll estimate object storage for each signal. For logs, we assume chunks compress raw text about 8 times. For metrics, we use about 1.5 bytes per sample after compression. For traces, we assume about 200 bytes per span after compression.
Signal | Daily volume | Stored per day | Retention | Object storage needed |
|---|---|---|---|---|
Logs | 150 GB raw | About 19 GB | 30 days | About 560 GB |
Metrics | About 11.5 billion samples | About 17 GB | 90 days | About 1.6 TB |
Traces | About 86 million spans | About 17 GB | 14 days | About 240 GB |
Total | About 53 GB | About 2.4 TB |
The metrics line comes from simple math. Two million series sampled every 15 seconds is about 133,000 samples a second. Over a day, we get about 11.5 billion samples, or about 17 GB at 1.5 bytes each.
Object storage is the cheap part. The larger cost is the running system around it. In production, each store usually runs as a set of microservices, such as distributors, ingesters, queriers and compactors. For this team, that adds up to the following:
Three storage systems to scale: Each store has its own ingest path, caches and capacity plan.
Three object storage buckets: Each needs its own retention, access and cost tracking.
Three query languages: On-call engineers need LogQL, PromQL and TraceQL to investigate one incident.
Four upgrade cycles: Each project ships on its own schedule, and versions must stay compatible.
Monitoring for the monitoring: Someone has to watch the stack's own health, or a broken ingester can hide an outage.
Each store can also run as a single process for small setups. We'd use that mode to test the stack before a full rollout. Most teams move to the split design once data volume grows.
Where the LGTM Stack Falls Short
The stack does its core jobs well. Its limits come from being several tools joined by shared IDs.
Correlation is manual setup: Jumping between signals depends on every service sending the same labels and trace IDs.
Full-text log search is slow at scale: Only labels are indexed, so broad text searches over long windows scan a lot of data.
Labels need constant control: High-cardinality labels can slow the log store and the metrics store alike.
Infrastructure and network monitoring needs extra pieces: Devices such as switches, routers and storage arrays need exporters and more setup.
How Do You Choose an Observability Stack?
The right observability stack depends on how much of the platform your team wants to build and run. We'd weigh the same five questions for any option, from a self-hosted stack to a single platform. Our guide to observability tools compares options across these points.
Who will run it: Count the engineers who can own upgrades, scaling and on-call for the stack itself.
How signals connect: Check whether you can move from an alert to its logs and traces in one view.
How many query languages: Fewer languages make on-call easier for every engineer.
What you need to see: List servers, apps, containers, networks and databases, then check coverage for each.
Total cost: Add storage, compute and people time, not just license fees.
We often hear from teams that want fewer parts to run. If you've already settled on moving away from a self-hosted setup, our list of Grafana alternatives covers that question in more depth.
How Alert Correlation Works in a Unified Platform
A unified platform handles correlation inside the product, so engineers don't stitch it together across stores. Here is how Alert Correlation in Motadata ObserveOps works, based on our product docs.
When a metric alert fires, you open it and click Correlation on the alert detail screen. ObserveOps then queries the same monitor for data inside the alert's active time window. It shows the results in four tabs.
Correlated Metrics: Related metric charts from the same monitor during that window.
Correlated Logs: Log entries from the same source ingested during that window.
Correlated Alerts: Other metric alerts active on the same monitor at the same time.
Log Pattern: Recurring log patterns found in those logs, such as a repeated error message.
Take a fictional CPU alert on a Linux server running at 96%. The Correlated Metrics tab shows a runaway process spiking at the same moment. Correlated Alerts confirms that no other threshold fired. The engineer finds the cause without writing a query in any language.
There is one limit to plan for. Correlated logs and log patterns only appear when logs are forwarded from that source. If a server sends metrics but no logs, the logs tab stays empty for its alerts.
Correlate Logs, Metrics and Traces With Motadata ObserveOps
The LGTM stack gives teams a free and open way to store logs, metrics and traces. Each part does one job, and the dashboard layer ties them together. The real cost is ownership.
You run three stores, three buckets and three query languages, and you keep labels and trace IDs consistent so the signals connect. We suggest sizing storage and counting the people's time before you commit.
If you'd prefer one system to run, Motadata ObserveOps brings metrics, logs, traces and alert correlation into one unified observability and ITSM platform. Alerts open with their related metrics, logs and log patterns already in view. We think that saves your team the work of linking tools and gives it more time to fix issues.
FAQs
Is the LGTM stack free?
Yes, the software is free to self-host under the AGPLv3 license. You still pay for compute, object storage and the engineering time to run, scale and upgrade four separate projects. For many teams, people time is the largest cost.
Is Prometheus part of the LGTM stack?
No, Prometheus is a separate open source project and isn't one of the four letters. It often works alongside the stack, scraping metrics and sending them to the long-term metrics store through remote write.
Is the log store the same as the dashboard tool?
No, they are separate projects. The log store collects and keeps logs in object storage. The dashboard tool only queries and displays data from the stores. You can run either one without the other.
Do you need all four parts of the LGTM stack?
No, each part works on its own, and many teams start with one or two. A common start is Prometheus with dashboards, then the log store. Teams add the trace and metrics stores as they grow.
What is an observability stack?
An observability stack is the set of tools that collect, store, query and alert on logs, metrics and traces. It can be several open source tools joined together, like the LGTM stack, or one unified platform.
Author
Ramya Shah
Technical Writer
Ramya Shah is a technical content writer with a computer engineering background and roots in automotive journalism. He covers IT Service Management, observability, IT operations, and AI-driven automation. An early adopter of AI-assisted writing workflows, he turns complex IT processes into clear, engaging content optimized for search and answer engines (AEO), lifting content output and organic visibility.
![8 Best Kafka Monitoring Tools [We’ve Compared for 2027]](https://www.motadata.com/storage/blog/featured-images/kafka-monitoring-tools-hero.webp)
![8 Best SIEM Tools in 2026 [Reviewed and Ranked]](https://www.motadata.com/storage/blog/featured-images/siem-tools-hero.webp)
