grafana-loki

Query and analyze Grafana Loki logs using LogQL and the Loki HTTP API.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/sandipb/skills-directory --skill grafana-loki-sandipb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grafana-loki
Source: https://github.com/sandipb/skills-directory/tree/main/skills/grafana-loki
Command: npx skills add https://github.com/sandipb/skills-directory --skill grafana-loki-sandipb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Enables AI agents to query, analyze, and troubleshoot Grafana Loki logs by guiding LogQL usage, Loki API interactions, and multi-tenant configuration.

Core Features & Use Cases

  • Guided LogQL query composition for logs and metrics across Loki deployments.
  • Tenant-aware API usage with X-Scope-OrgID handling and endpoint configuration.
  • Diagnostic workflows for performance, cardinality, and label discovery in Loki clusters.

Quick Start

Provide your Loki endpoint and tenant ID, then run a minimal query to verify connectivity and basic results.

Frequently Asked Questions about grafana-loki

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query and analyze Grafana Loki logs using LogQL?

To query Loki logs, you compose LogQL statements to filter log streams and extract metrics. This skill guides agents in building log and metric queries and interacting with the Loki HTTP API to retrieve results.

Can I scope Loki log queries to a specific tenant using X-Scope-OrgID?

Yes, tenant scoping is supported by passing the X-Scope-OrgID header. The skill handles tenant-aware API usage by requiring the LOKI_ORG_ID environment variable to configure multi-tenant access for your queries.

Do I need specific environment variables configured to connect to a Loki cluster?

Yes, you must define the LOKI_ADDR and LOKI_ORG_ID environment variables. These prerequisites allow the skill to establish connectivity to your Loki endpoint and execute queries safely.

How do I troubleshoot Loki performance and cardinality issues?

You can troubleshoot Loki performance by running diagnostic workflows for label discovery and cardinality analysis. The skill provides guided steps to identify high-cardinality labels and optimize query performance across clusters.

What is the best way to discover available labels in a Loki deployment?

The best way to discover labels is by querying the Loki API endpoints for label names and values. This skill facilitates label discovery workflows to help you understand the structure of your log data before writing complex LogQL queries.