New in Grafana v6.3: Introducing Loki's Log Row Context Viewer

Published: 14 Aug 2019 RSS

With the release of Grafana v6.3, we are introducing a significant improvement to Loki’s log exploration workflow in Grafana Explore.

Launched at KubeCon North America last December, Loki is a Prometheus-inspired service that optimizes storage, search, and aggregation while making logs easy to explore natively in Grafana. Loki is designed to work easily both as microservices and as monoliths, and correlates logs and metrics to save users money.

Less than a year later, Loki has almost 6,500 stars on GitHub and is now quickly approaching GA.

Loki is tightly integrated into Grafana Explore, which allows you to correlate metrics and logs by viewing them side-by-side for a more seamless debugging workflow.

Imagine investigating your logs against a particular error that occurred in your application. Typically you would do that by using Loki’s filter expression which will narrow down the results to only those log lines that match the provided search expression, i.e.:

{filename="var/log/grafana/grafana.log"} Alert Rule Result Error

Log Context

But, as you can see in the image above, you are losing the important information about the logs that appeared just before and after the error occurred. In many cases, this context can be vital to understanding the circumstances in which the error happened, especially when you’re on call because the hidden log rows could have more information about the underlying causes of the alert.

With the new log row context feature in Grafana Explore, reviewing the filtered out log lines becomes as simple as a click on a newly introduced “Show Context” button. The button appears when you hover over a log line in Explore:

Log Row Content Explore Context

When clicking on it, a log row context viewer will be shown that will display the surrounding logs of the log line you are investigating:

Log Row Content Show Context

Note that the context feature is only available on log results that were returned for a query with a search term (filter expression). Also keep in mind that the query used for the context is based on the same label set as the original query. For example, if you are trying to view logs from more hosts, you need to remove any host labels from the selector part of the query.

We hope this will improve the debugging workflow for those using Grafana Explore and we appreciate any feedback around this new feature.

Related Posts

As the Grafana Labs team pushes the Loki project toward general availability, we will be doing deep dives on its key features. Today, we’re focusing on live tailing.
We’ve finally released the second beta version for Loki. Here’s what’s new.
As the Grafana Labs team pushes the Loki project toward general availability, we will be doing deep dives on its key features. Today, we’re focusing on the pipeline stage.

Related Case Studies

After trying to DIY, Wix embraces Grafana Cloud

Metrics is an important part of Wix’s culture, so Grafana Cloud was chosen to monitor mission-critical systems.

"It doesn’t make sense, price-to-performance, to do it ourselves, so we were looking for a fully-managed solution from a team that had experience running monitoring at scale."
– Alex Ulstein, Head of Monitoring, Wix

DigitalOcean gains new insight with Grafana visualizations

The company relies on Grafana to be the consolidated data visualization and dashboard solution for sharing data.

"Grafana produces beautiful graphs we can send to our customers, works with our Chef deployment process, and is all hosted in-house."
– David Byrd, Product Manager, DigitalOcean

Grafana enhances end user experience for Apica Systems

The company uses Grafana alongside its SaaS product to detect availability and performance issues before they affect users.

"There have been all kinds of dashboard solutions, but Grafana changed that game in terms of being extremely dynamic and hooking in whatever you like."
– Sven Hammar, CEO, Apica Systems