π Loki How-To Guides
Ready to hunt down some bugs? This guide shows you how to search and analyze logs effortlessly within our environment.
(For advanced LogQL tricks, check out the official Grafana Loki documentation.)
π Querying Logs in Grafanaβ
Loki is a backend powerhouse, so it does not have its own UI. Instead, we use Grafana as our magnifying glass!
- Open Grafana and click the Explore tab (the compass icon on the left). π§
- Select Loki from the data source dropdown at the top left.
- Use the Label filters to instantly narrow down your hunt (e.g., set
app=my-backend-serviceornamespace=production). - Smash that Run query button to stream your logs! π
πͺ Jumping from Traces to Logs (Magic!)β
Here is the absolute coolest feature of our stack: seamless integration between Tempo (traces) and Loki (logs). β¨
Are you staring at a slow or failed request trace in Tempo?
- Look closely for a tiny document icon right next to the failing span.
- Click it!
- Grafana will instantly split the screen and query Loki for the exact logs generated by that specific service during the exact microsecond of that trace!
It is the ultimate debugging shortcut! π―