grafana / explore-logs

Repo for the Loki log exploration app
GNU Affero General Public License v3.0
285 stars 11 forks source link

Explore Logs

Explore Logs offers a query-less experience for browsing Loki logs without the need for writing complex queries. Discover or narrow down your search using by volume and text patterns. Uncover related logs and understand patterns—all with just a few clicks. No LogQL required. With Explore Logs, you can:

...all without crafting a single query!

Screenshot of Explore Logs

Installation in Your Own Grafana Instance

You can install Explore Logs in your own Grafana instance using grafana-cli:

[!IMPORTANT]
The following Loki and Grafana version and configuration are required:

  • Loki v3.2+
    • --pattern-ingester.enabled=true for pattern ingestion
    • Volume endpoint enabled in Loki config:
limits_config:
  volume_enabled: true
  • Grafana v11.2+
grafana-cli --pluginUrl=https://storage.googleapis.com/integration-artifacts/grafana-lokiexplore-app/grafana-lokiexplore-app-latest.zip plugins install grafana-lokiexplore-app

Installation via environment variables

If you want to install the app in a docker container, you need to configure the following environment variable:

GF_INSTALL_PLUGINS=https://storage.googleapis.com/integration-artifacts/grafana-lokiexplore-app/grafana-lokiexplore-app-latest.zip;grafana-lokiexplore-app

Test Out with Docker Compose

Test out the app using the following command to spin up Grafana, Loki, and the Logs Explore App:

curl -L https://github.com/grafana/explore-logs/raw/main/scripts/run.sh | sh

This will download the https://github.com/grafana/explore-logs/blob/main/scripts/run.sh file and execute it. That shell file will download some configuration files into your /tmp/explore-logs directory and start the docker containers via docker compose from there.

Once the docker container started, navigate to http://localhost:3000/a/grafana-lokiexplore-app/explore in order to use Explore Logs.

Getting Started

  1. In the main navigation bar click on Explore > Logs
  2. You’ll land in the service overview page that shows time series and log visualizations for all the services in your selected Loki instance.
  3. Change your data source with the drop-down on the top left.
  4. Modify your time range in two ways:
    • With the standard time range picker on the top right.
    • By clicking and dragging the time range you want to see on any time series visualization.
  5. Services are shown based on the volume of logs, and you can search for the service you want through the Search service input.
  6. Select the service you would like to explore. This takes you to the Service page.
  7. Filter logs based on strings, labels, fields, or detected patterns.
app

Community Resources, Feedback, and Support

Development

In order to run the setup locally and build the plugin by your own, follow these steps:

  1. yarn install
  2. yarn dev this builds the plugin continuously
  3. yarn server this spins up the docker setup, including a Loki instance and the fake data generator

Supported Features

This section outlines the supported features available by page: Service Selection and Service Detail.

Service Selection

Service Selection is the entry step where users can choose a service. List of features and functionalities:

1. Fetching of services - Services are fetched using the Loki /loki/api/v1/index/volume endpoint and ordered by their volume. Services are re-fetched when the time range significantly changes to ensure correct data. Services are updated if:

2. Showing of services - Services are shown based on volume and are lazy-loaded. Metrics and logs are queried only for services that are scrolled to.

3. Previously selected services - Previously selected services are displayed at the top of the list for easier access.

4. Searching of services - The search input can be used to filter services that include the specified string.

Service Details