Zagalin - AI Assistant for Grafana
Zagalin is a context-aware AI assistant that brings the power of Large Language Models (LLMs) directly into your Grafana experience. Chat with your metrics, generate queries, and troubleshoot issues using natural language.
- Dashboard Context: Zagalin automatically understands which dashboard and panels you're viewing
- Time Range Awareness: Queries are aware of your current time range selection
- Floating Chat: Access Zagalin from any dashboard with the floating chat button
- Full Chat Page: Dedicated chat interface for longer conversations
- Natural Language to PromQL: "Show me CPU usage over the last hour"
- Natural Language to LogQL: "Find errors in my application logs"
- Query Explanation: Get detailed explanations of complex queries
- Best Practices: Suggestions for query optimization and improvements
- Guided Troubleshooting: Step-by-step guidance for common issues
- Pattern Recognition: Identifies common patterns in metrics and logs
- Root Cause Analysis: Helps identify the source of problems
- Actionable Insights: Provides specific recommendations and next steps
- Panel Explanation: Understand what each panel shows and why it matters
- Data Interpretation: Get insights from your metrics
- Trend Analysis: Identify patterns and anomalies
- Alert Suggestions: Recommendations for setting up alerts
- Personality Presets: Choose from helpful, technical, beginner-friendly, or concise modes
- Custom Instructions: Add your own instructions to tailor Zagalin's behavior
- Temperature Control: Adjust creativity vs. consistency
- Token Limits: Control response length
Zagalin works with multiple LLM providers through the Grafana LLM App:
- OpenAI (GPT-4, GPT-3.5)
- Azure OpenAI
- Anthropic Claude
- Grafana's Managed LLM
- Grafana 10.4.0 or later
- Grafana LLM App plugin installed and configured
grafana-cli plugins install jorgeancal-zagalin-appdocker run -d \
-p 3000:3000 \
-e "GF_INSTALL_PLUGINS=grafana-llm-app,jorgeancal-zagalin-app" \
--name=grafana \
grafana/grafana:latest- Download the latest release from GitHub Releases
- Extract to your Grafana plugins directory
- Restart Grafana
Before using Zagalin, you need to set up the Grafana LLM App:
- Navigate to Configuration → Plugins → LLM App
- Enable the plugin
- Configure your preferred LLM provider:
- Add your API key (OpenAI, Anthropic, etc.)
- Or configure Azure OpenAI endpoint
- Or use Grafana's managed LLM service
- Go to Apps → Zagalin
- Click Enable
- Configure your preferences in the Configuration tab
The floating chat button appears automatically when you're viewing a dashboard (not on the home page or other Grafana pages).
When it appears:
- When viewing any dashboard
- Automatically positioned in the bottom-right corner
- Shows context badge when dashboard context is available
How to use it:
- Click the floating orange chat button
- A chat panel slides up from the bottom
- Type your question and press Cmd/Ctrl+Enter or click Send
- Zagalin will respond with context about your current dashboard
- Click the X button or press Escape to close
Pro Tips:
- The button turns green when dashboard context is active
- You can drag and reposition the chat panel
- Chat history persists during your session
- Use natural language - no special commands needed
- Full Chat Page: Navigate to Apps → Zagalin → Chat for a dedicated full-screen experience
- Ask Panel: Add the "Ask AI" panel to any dashboard for inline queries
Zagalin offers three different ways to connect to LLM services, each optimized for different use cases. Choose the one that best fits your needs.
| Feature | Official Grafana (Default) |
Zagalin Backend (Production) |
Direct LLM API (Advanced) |
|---|---|---|---|
| Service Account Required | No | Yes | No |
| Setup Complexity | Easy | Moderate | Advanced |
| Rate Limiting | Yes | Yes | Yes |
| Query Validation | Yes | Yes | Yes |
| Datasource Governance | Yes | Yes | Yes |
| Audit Logging | Yes | Yes | Yes |
| Requires grafana-llm-app | Yes | Yes | No |
| Best For | Getting started Single user |
Production Multiple users |
Custom setups No grafana-llm-app |
Hybrid architecture that combines the best of both worlds:
- Uses @grafana/llm package for LLM calls (no service account needed)
- Uses Zagalin backend for queries, security, and storage
Key Features:
- No service account needed - Works immediately after install
- Session-based authentication - Uses your Grafana login automatically
- Backend security features - Rate limiting, query validation, audit logging
- Datasource governance - Allowlist enforcement, OTel scope checking
- Persistent storage - Conversations saved via Grafana User Storage API
Prerequisites:
- Install grafana-llm-app plugin from Grafana catalog
- Configure it with your LLM provider (Administration → Plugins → LLM App)
- Zagalin backend must be running
Configuration:
- Go to Apps → Zagalin → Configuration
- Select "Official Grafana (Default)" card
- Click Save
- Start chatting!
Full backend proxy mode with complete security pipeline:
- All LLM requests go through Zagalin backend → grafana-llm-app
- Requires service account token for backend-to-backend authentication
Key Features:
- Complete audit trail - All LLM calls logged with user context
- Service account authentication - Backend-to-backend security
- Full security pipeline - Rate limiting, validation, governance
- Production-ready - Designed for multi-user environments
- Centralized control - Single point for LLM access management
Prerequisites:
- Install grafana-llm-app plugin from Grafana catalog
- Configure it with your LLM provider
- Create a Grafana service account with Admin or Editor role
- Generate a service account token
- Provide the token in Zagalin configuration
Configuration:
- Go to Administration → Service Accounts
- Create new service account (e.g., "Zagalin Plugin")
- Assign Admin or Editor role
- Generate a token and copy it
- Go to Apps → Zagalin → Configuration
- Select "Zagalin Backend (Production)" card
- Paste the service account token
- Click Save
Direct API integration where Zagalin backend calls LLM providers directly:
- No grafana-llm-app required - Direct OpenAI/Anthropic/Azure integration
- Requires your own API keys from LLM providers
- Full security features still enabled (rate limiting, validation, governance)
Key Features:
- No grafana-llm-app dependency - One less plugin to manage
- Direct API control - Full control over API parameters
- Multiple providers - OpenAI, Anthropic, Azure, custom endpoints
- Full security pipeline - All backend features enabled
- Custom configurations - Advanced endpoint and model settings
Prerequisites:
- Obtain API keys from your LLM provider:
- OpenAI: https://platform.openai.com/api-keys (+ Organization ID if your key belongs to multiple orgs)
- Anthropic: https://console.anthropic.com/settings/keys
- Azure: Your Azure OpenAI deployment endpoint + key
- Know your model name (e.g.,
gpt-4o-mini,claude-3-5-sonnet-20241022)
Configuration:
- Go to Apps → Zagalin → Configuration
- Select "Direct LLM API" card
- Choose your LLM Provider:
- OpenAI
- Anthropic
- Azure OpenAI
- (OpenAI only) Enter your Organization ID if your API key belongs to multiple organizations
- Enter your API Key (stored securely in Grafana's encrypted storage)
- Configure Model Name (e.g.,
gpt-4o-mini) - (Optional) Set Custom Endpoint for Azure or custom deployments
- Click Save
Supported Providers:
| Provider | Model Examples | API Key Format | Additional Fields |
|---|---|---|---|
| OpenAI | gpt-4o, gpt-4o-mini, gpt-3.5-turbo |
sk-... |
Organization ID (optional) |
| Anthropic | claude-3-5-sonnet-20241022, claude-3-opus-20240229 |
sk-ant-... |
- |
| Azure OpenAI | Your deployment name | Azure API key + endpoint | Custom endpoint required |
You can change LLM backend modes at any time without losing data:
- Go to Apps → Zagalin → Configuration
- Select your desired mode card
- Configure required settings (service account token or API key if needed)
- Click Save
- Existing conversations are preserved
Note: Conversations are stored per-user and persist across mode changes. Switching modes only affects how LLM calls are made, not your conversation history.
User: Show me memory usage above 80% in the last 24 hours
Zagalin: Here's the PromQL query:
(node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes)
/ node_memory_MemTotal_bytes * 100 > 80
User: What does this dashboard show?
Zagalin: This dashboard monitors Kubernetes cluster health.
The top panels show CPU and memory usage across nodes,
the middle section displays pod status and restarts,
and the bottom shows network I/O. The red spike in
the CPU panel indicates a resource contention issue
around 14:30.
User: My application is throwing 500 errors
Zagalin: Let's investigate:
1. Check your error logs: {logql_query}
2. Look at response times: {promql_query}
3. Verify database connections
4. Check recent deployments
Based on the current metrics, I see increased latency
starting at 15:00. This correlates with...
- Personality Preset: Choose how Zagalin communicates
- Helpful (Recommended): Balanced and practical
- Technical: For experienced SREs
- Beginner-Friendly: Patient and educational
- Concise: Brief and efficient
- Custom: Write your own instructions
Enable or disable specific capabilities:
- Explain Panel: Analyze and explain dashboard panels
- Generate Queries: Create PromQL/LogQL queries from natural language
- Troubleshooting: Structured troubleshooting guidance
- Vector Search: Semantic search (requires vector service)
- Function Calling: Structured tool execution
- Temperature: 0.0 (factual) to 1.0 (creative)
- Max Tokens: Control response length (1000-4000 tokens)
- Show/hide context badge
- Display token count and cost estimates
- Auto-open chat on dashboard view
- Built with React and TypeScript
- Uses Grafana UI components
- Streaming responses with RxJS
- Context-aware message handling
- Go plugin for Grafana
- Integrates with Grafana LLM App
- Secure API key management
- Context extraction from Grafana
- Provider-agnostic through Grafana LLM App
- Streaming completions for responsive UX
- Function calling for structured actions
- Vector search for semantic context (optional)
Zagalin implements multiple layers of security to protect your data and infrastructure:
- No Data Storage: Zagalin doesn't store your queries or responses
- API Keys: Managed securely through Grafana's secrets management
- Context Optimization: Only sends relevant context to minimize data exposure
- Provider Choice: Use your own LLM provider for full control
- User Isolation: Conversations are stored per-user with access control
- Query Validation: Parser-based validation for PromQL, LogQL, and TraceQL queries
- Prevents injection attacks using official parsers
- Configurable complexity limits and function allowlists
- Comprehensive audit logging of validation events
- Datasource Governance: Allowlist-based datasource access control
- Rate Limiting: Per-user rate limiting to prevent abuse (default: 60 req/min)
- User Context: All queries execute with the user's security context and permissions
- OTel Enforcement: Automatic scope injection for multi-tenant observability
The plugin implements multiple security layers that work together:
- User authentication and identity extraction
- Per-user rate limiting
- Datasource allowlist validation
- Query injection prevention and validation
- OpenTelemetry scope enforcement
- Query execution with user permissions
- Comprehensive audit logging
For detailed security documentation, see .claude/CLAUDE.md.
This release transforms Zagalin into a production-ready observability assistant with enterprise-grade security controls.
Highlights:
- Query Validation System - Pattern-based validation for PromQL, LogQL, TraceQL
- OpenTelemetry Scope Enforcement - Automatic service/environment labeling
- Datasource Governance - Allowlist system for approved datasources
- Conversation History - Persistent storage with dual-tier architecture
- AI Development Tools - Configurations for Claude, ChatGPT, Copilot, Cursor
- Privacy-Conscious Logging - Usage analytics without exposing queries
Security Pipeline: Every query now flows through 6 security validation stages Configuration: 25+ new settings (all opt-in, disabled by default) Breaking Changes: None
Documentation:
Initial release with core AI assistant capabilities.
Highlights:
- Context-aware chat with dashboard, panel, and time range awareness
- Floating chat interface on every dashboard
- Query generation for PromQL, LogQL, TraceQL
- Skills system (explain_panel, generate_query, troubleshoot, analyze_dashboard)
- LLM integration via grafana-llm-app
- Function calling for structured tool execution
Documentation:
Next release will focus on structured investigation workflows:
- Frontend orchestration with planning and step execution
- Artifact management with syntax highlighting
- Smart routing between dashboard questions and investigations
- Enhanced context extraction and summarization
- Conversation export to JSON/Markdown
- Changelog: CHANGELOG.md - Detailed changes following Keep a Changelog format
- Version History: docs/VERSION_HISTORY.md - Comprehensive version overview
- Release Notes: docs/releases/ - Detailed release narratives
- GitHub Releases: Releases Page
| Version | Release Date | Theme | Major Features | Breaking Changes |
|---|---|---|---|---|
| 0.0.2 | Dec 27, 2025 | Security & Governance | Query validation, OTel enforcement, datasource governance, conversation history | None |
| 0.0.1 | Dec 24, 2025 | Foundation | Context-aware chat, floating UI, query generation, skills system | N/A |
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributions are welcome! Please read our Contributing Guidelines for details on how to submit pull requests, report issues, and contribute to the project.
- Documentation: GitHub README
- Issues: GitHub Issues
- Built on Grafana Plugin Tools
- Powered by Grafana LLM App
- Inspired by the Grafana community
Made by Jorge Andreu Calatayud




