Skip to content

Instantly share code, notes, and snippets.

@lmangani
Last active April 11, 2024 08:12
Show Gist options
  • Save lmangani/80549119f493c280a6fbc272480dd9e4 to your computer and use it in GitHub Desktop.
Save lmangani/80549119f493c280a6fbc272480dd9e4 to your computer and use it in GitHub Desktop.
Grafana 11.x LOG Explore

qryn + grafana 11

Explore Logs App

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

  • Easily find logs and log volumes for all of your services
  • Effortlessly filter service logs based on their log volumes, labels, fields, or patterns.
  • Automatically choose the best visualization for your log data based on its characteristics, without any manual setup.

...all without crafting a single query!

image

Github Repository

Test Out with Docker Compose

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

curl -L https://gist.githubusercontent.com/lmangani/80549119f493c280a6fbc272480dd9e4/raw/b6d1753aa9376347979bbf0edf94237136a8d9b1/run.sh | sh
apiVersion: 1
apps:
- type: "grafana-lokiexplore-app"
org_id: 1
org_name: "Grafana"
disabled: false
jsonData:
apiUrl: http://default-url.com
isApiKeySet: true
secureJsonData:
apiKey: secret-key
apiVersion: 1
datasources:
- name: gdev-testdata
isDefault: false
type: testdata
- name: gdev-loki
type: loki
uid: gdev-loki
access: proxy
url: http://host.docker.internal:3100
version: '3.0'
services:
grafana:
image: grafana/grafana:11.0.0-preview
environment:
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_BASIC_ENABLED=false
- GF_FEATURE_TOGGLES_ENABLE=accessControlOnCall
- GF_INSTALL_PLUGINS=https://storage.googleapis.com/integration-artifacts/grafana-lokiexplore-app/grafana-lokiexplore-app-latest.zip;grafana-lokiexplore-app
ports:
- 3000:3000/tcp
volumes:
- ./provisioning:/etc/grafana/provisioning
extra_hosts:
- 'host.docker.internal:host-gateway'
qryn:
image: qxip/qryn:latest
ports:
- "3100:3100"
environment:
- CLICKHOUSE_SERVER=clickhouse-server
- CLICKHOUSE_AUTH=qryn:supersecretpassword
- CLICKHOUSE_DB=qryn
clickhouse-server:
image: clickhouse/clickhouse-server:latest
container_name: clickhouse-server
environment:
- CLICKHOUSE_USER=qryn
- CLICKHOUSE_PASSWORD=supersecretpassword
ports:
- 8123:8123
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', '127.0.0.1:8123/ping']
interval: 1s
timeout: 1s
retries: 30
generator:
image: svennergr/fake-logs-generator:main-c8d21cc
command: -url http://qryn:3100/loki/api/v1/push
#!/bin/sh
mkdir -p /tmp/explore-logs/config
mkdir -p /tmp/explore-logs/provisioning/datasources
mkdir -p /tmp/explore-logs/provisioning/plugins
# Download files
curl https://gist.githubusercontent.com/lmangani/80549119f493c280a6fbc272480dd9e4/raw/489a780c5b90fed08686a67b3f841215a1afed5d/default.yaml -o /tmp/explore-logs/provisioning/datasources/default.yaml
curl https://gist.githubusercontent.com/lmangani/80549119f493c280a6fbc272480dd9e4/raw/489a780c5b90fed08686a67b3f841215a1afed5d/app.yaml -o /tmp/explore-logs/provisioning/plugins/app.yaml
curl https://gist.githubusercontent.com/lmangani/80549119f493c280a6fbc272480dd9e4/raw/489a780c5b90fed08686a67b3f841215a1afed5d/docker-compose.yaml -o /tmp/explore-logs/docker-compose.yaml
docker compose -f /tmp/explore-logs/docker-compose.yaml up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment