Skip to content

About

AI-powered observability assistant for Grafana that helps you query data, investigate issues, and manage dashboards through natural language.

Resources

Contributing

Security policy

Stars

48 stars

Watchers

3 watching

Forks

Latest commit

 

History

228 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ask O11y - AI-Powered Observability Assistant for Grafana

Ask O11y is a Grafana app plugin that brings AI assistance into your observability workflow. Query metrics, analyze logs, create dashboards, and troubleshoot issues through natural language—no need to write PromQL, LogQL, or navigate complex UIs.

License Grafana CI GitHub release Ask DeepWiki


Prerequisites

Ask O11y requires:

  1. Grafana LLM Plugin — installed and configured with an AI provider (OpenAI, Anthropic, etc.)
  2. Grafana Service Account — used to authenticate LLM calls and MCP tool execution
  3. Grafana MCP Server — either the built-in toggle (Org 1 only) or an external mcp-grafana instance

Without these, the plugin will not work. See User Guide for setup instructions.


Quick Start

For End Users

See the User Guide for installation and configuration.

For Developers

git clone https://github.com/Consensys/ask-o11y-plugin.git
cd ask-o11y-plugin
npm install
npm run server
# Access Grafana at http://localhost:3000 (admin/admin)

See AGENTS.md for detailed development documentation.


Features

  • Natural Language Queries: Prometheus (PromQL), Loki (LogQL), Tempo (TraceQL), Pyroscope (profiles), AWS CloudWatch
  • 8 Visualization Types: Time Series, Stats, Gauge, Table, Pie Chart, Bar Chart, Heatmap, Histogram
  • MCP Integration: 56+ built-in Grafana tools, dynamic tool discovery, custom server support
  • Agent Skills: Modular SKILL.md instruction sets (Agent Skills open standard) activated per request — from the chat picker, by trigger keywords, or on demand by the assistant itself; admins can customize or add skills
  • RBAC: Admin/Editor (full access) vs Viewer (read-only), enforced per operation
  • Session Management: Auto-save, history, sharing with expiration, import shared sessions
  • Alert Investigation: One-click RCA from alert notifications
  • Organization Isolation: Sessions and data scoped per Grafana org

Agent Skills

Skills are modular instruction sets (Agent Skills format: a SKILL.md with YAML frontmatter) that teach the assistant specialized workflows — alert investigation, performance analysis, dashboard building, TraceQL, PromQL/LogQL, Pyroscope profiling, CloudWatch, and rendering visualizations. The always-on base prompt keeps the safety rules (anti-hallucination contract, write guardrails); skills add domain workflows only when relevant, keeping token usage low.

A skill activates three ways:

  1. Explicitly — type / in the chat input to open the skill command menu (filter with the keyboard, Tab/Enter to complete), then write your message: /querying-profiles find CPU hot spots. The active command is shown as a chip above the input while composing, and as a chip on the reply. Deep links work too: /a/consensys-asko11y-app?skill=analyzing-cloudwatch; the legacy alert link ?type=investigation&alertName={alertName} keeps working and maps to the investigating-alerts skill.
  2. Automatically — skills with triggers metadata (a regex) activate when the message matches; a pasted [FIRING:...] alert notification always activates the alert-investigation workflow, including its larger iteration budget and runbook-first guardrails.
  3. On demand — the assistant sees a catalog of skill names/descriptions in its system prompt and calls the internal load_skill tool when a task matches, loading the full instructions only then (progressive disclosure). Loaded skills are visualized as chips on the reply and as a friendly "Skill: name" entry in the tool execution panel.

Skill metadata can also steer the run: model: large|base, max-iterations: 60, and a user-prompt template for the legacy investigation/performance request types. Active skills are shown as chips on the assistant's reply.

Administering skills (Grafana Admin, plugin Configuration → Skills tab): edit any bundled skill's SKILL.md to customize it for your organization, disable it, or add your own (org-specific runbooks, naming conventions, query patterns). Custom skills live in the plugin's jsonData; GET /api/skills lists skill metadata for all roles, and ?include=content (Admin) returns the SKILL.md sources. Bundled skills ship in pkg/skills/bundled/.


Workflows

Workflows run agent skills unattended on a schedule. A workflow entry is pure configuration — a skill, an interval, a model, an iteration budget, a tool allowlist, and a timeout — so the same plugin serves any automation without custom code: NOC alert triage, recurring health reports, or cleanup sweeps. Everything a workflow does goes through your MCP servers, so it acts on the systems those servers reach.

Define workflows in the plugin configuration (jsonData.workflows) or the provisioning file:

jsonData:
  workflows:
    - name: alert-triage
      enabled: true
      orgId: 1
      skill: investigating-alerts        # an enabled, public skill
      message: "Check the alert queue and investigate what is due."
      model: base                         # base | large | unset (skill decides)
      intervalSeconds: 300                # default 300, minimum 60
      maxIterations: 25                   # optional, overrides the skill budget
      sessionTimeoutSeconds: 300          # watchdog, default 300, minimum 60
      toolAllowlist:                      # exact MCP tools the sessions may call
        - mcp-grafana_alerting_rules_read
        - mcp-grafana_list_alert_groups
        - mcp-grafana_add_activity_to_incident
      spawnableSkills: [investigating-alerts]   # skills it may start per item
      maxConcurrentSessions: 5            # cross-replica cap for spawned sessions
      fallbackSkill: escalate             # optional, runs once after a failure

How it runs:

  • The backend starts one scheduler per enabled entry. Each tick elects a single leader across replicas through a Redis lock, so multiple Grafana replicas never double-run a workflow. Redis is required for workflows.
  • A tick starts a headless agent session under a synthetic identity: the skill is active, approvals are off, and only the allowlisted tools are offered and callable.
  • Sessions persist like interactive ones and appear under the synthetic user. A dispatcher session can start bounded sub-sessions with the internal spawn_session tool and publish human-readable results with share_session, which returns a share link through the standard sharing mechanism.
  • A watchdog cancels any session that exceeds its timeout and can run a fallback skill once. Read-only rollout is an allowlist choice: omit write tools and the workflow can only observe and report.
  • The org identity (URL and service-account token) seeds from the first user request in that org; until then ticks skip with a warning.

Every workflow emits Prometheus metrics (asko11y_workflow_ticks_total, asko11y_workflow_sessions_total, asko11y_workflow_active_spawned, asko11y_workflow_run_duration_seconds), all labeled by workflow name, so a dead loop is visible at a glance. Workflow configuration never ships with the plugin; it is tenant content.


Production High Availability

Ask O11y works with Grafana OSS. In multi-replica Grafana deployments, configure Redis for Ask O11y state or use sticky sessions at the load balancer.

Without shared state, a request can create a detached run on one Grafana replica while a later poll or session update lands on another replica. The common symptom is:

Agent detached request failed (404): session not found

Redis is the recommended production fix. It backs chat sessions, active agent runs, share links, share rate limits, and approval coordination across replicas. Sticky sessions can reduce the symptom, but Redis is still preferred for restarts, rollouts, and approval routing.

For Kubernetes examples, see:

  • deploy/helm/grafana-values-ask-o11y-ha.yaml
  • deploy/helm/redis.yaml

Validate the Grafana values example with:

helm repo add grafana https://grafana.github.io/helm-charts
helm template ask-o11y grafana/grafana -f deploy/helm/grafana-values-ask-o11y-ha.yaml

The Redis URL is configured through Grafana plugin provisioning as secureJsonData.redisURL.

Monitoring Token Usage

The plugin exposes an asko11y_agent_user_tokens_total Prometheus counter (labels: user, login, model, type, org, org_name), scraped from Grafana core's per-plugin diagnostics endpoint — not Grafana's own /metrics:

GET /api/plugins/consensys-asko11y-app/metrics

Minimal Grafana Alloy scrape config:

prometheus.scrape "asko11y_plugin" {
  targets      = [{ "__address__" = "grafana.internal:3000" }]
  metrics_path = "/api/plugins/consensys-asko11y-app/metrics"
  forward_to   = [prometheus.remote_write.mimir.receiver]
}

A sample dashboard is provisioned at provisioning/dashboards/agent-usage.json (query with increase(asko11y_agent_user_tokens_total[$__range])).

Privacy note: the login label carries the operator's own usernames (or email, as a fallback) into the TSDB, which typically has different access control and longer retention than Grafana itself. Anyone able to query that datasource can enumerate users via label_values(login) — worth considering before scraping in privacy-sensitive deployments.


Architecture

┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│   React UI      │────▶│   Go Backend     │────▶│  MCP Servers    │
│   (Frontend)    │◀────│   (Plugin)       │◀────│  (Grafana API)  │
└─────────────────┘     └──────────────────┘     └─────────────────┘
                               │
                               ▼
                        ┌──────────────────┐
                        │  Grafana LLM     │
                        │  (AI Provider)   │
                        └──────────────────┘

Frontend: React + TypeScript, real-time streaming, interactive visualizations

Backend: Go plugin, MCP aggregation, RBAC, multi-tenant support

Integration: Multiple MCP transport types with dynamic tool discovery


API Reference

OpenAPI 3.0.3 spec available at: /api/plugins/consensys-asko11y-app/resources/openapi.json

Key endpoints:

Method Endpoint Description
POST /api/agent/run Start AI conversation (SSE streaming)
GET /api/sessions List user sessions
GET /api/mcp/tools List available MCP tools (RBAC-filtered)
POST /api/mcp/call-tool Execute MCP tool
POST /api/sessions/share Create share link

All endpoints require Grafana session authentication. See the OpenAPI spec for the full list.


Using ask-o11y as a Remote MCP Server

You can configure ask-o11y as a remote MCP server in your MCP client (e.g., Claude Code) to access all Grafana observability tools:

Claude Code configuration (.claude/settings.json):

"ask-o11y-tools": {
  "command": "npx",
  "args": [
    "-y", "mcp-remote",
    "https://grafana.o11y.web3factory.consensys.net/api/plugins/consensys-asko11y-app/resources/mcp",
    "--header", "Authorization: Bearer glsa_XXXXXXXXX"
  ]
}

Requirements:

  • mcp-remote npm package (install via npm install -g mcp-remote)
  • Grafana service account token (format: glsa_XXXXXXXXX)
  • Token must have permissions to access the ask-o11y plugin

Token format: glsa_ prefix indicates a Grafana service account token. Generate via Grafana UI: Configuration → Service Accounts → Create Token.


Development

Prerequisites

  • Node.js >= 22
  • Go >= 1.21
  • Docker & Docker Compose
  • Mage

Commands

npm run build                # Full production build
npm run build:frontend:prod  # Frontend only
npm run build:backend        # Backend only (current platform)
mage buildAll                # Backend all platforms

npm test                     # Frontend tests (watch)
npm run test:ci              # Frontend tests (CI)
go test ./pkg/...            # Backend tests
npm run e2e                  # E2E tests

npm run lint                 # Lint
npm run lint:fix             # Lint + format

Workflow

  1. Frontend changes: Auto-reload via Docker volume mounts when using npm run server
  2. Backend changes: Rebuild and restart:
    npm run build:backend
    docker compose restart grafana

See AGENTS.md for detailed development documentation.


Contributing

See CONTRIBUTING.md for development setup, code standards, testing guidelines, and PR process.


Troubleshooting

See TROUBLESHOOTING.md for:

  • Grafana Cloud issues
  • Self-hosted / Docker issues
  • Common problems across all deployments

Support


License

MIT License - see LICENSE for details.

About

AI-powered observability assistant for Grafana that helps you query data, investigate issues, and manage dashboards through natural language.

Resources

Contributing

Security policy

Stars

48 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages