UNPKG

openclaw-grafana-lens

Version:

OpenClaw plugin that gives AI agents full Grafana access — 18 composable tools for PromQL/LogQL/TraceQL queries, dashboard creation, alerting, SRE investigation, security monitoring, data collection pipeline management via Grafana Alloy (29 recipes), and

48 lines (47 loc) 1.59 kB
/** * grafana_investigate tool * * Multi-signal investigation triage: gathers metrics, logs, traces, and context * signals in parallel, then generates hypothesis suggestions with specific * tool+params for follow-up. * * Design: This is a "first step" accelerator — use it to quickly gather * evidence across all signal types, then follow up with individual tools * (grafana_query, grafana_query_logs, grafana_query_traces) for deep-dives. * * Follows the same resilient pattern as grafana_security_check: * Promise.allSettled for graceful degradation when signal sources are unavailable. */ import { GrafanaClientRegistry } from "../grafana-client-registry.js"; import type { AlertStore } from "../services/alert-webhook.js"; export declare function createInvestigateToolFactory(registry: GrafanaClientRegistry, store: AlertStore): (_ctx: unknown) => { name: string; label: string; description: string; parameters: { type: "object"; properties: { focus: { type: string; description: string; }; timeWindow: { type: string; enum: string[]; description: string; }; service: { type: string; description: string; }; }; required: string[]; }; execute(_toolCallId: string, params: Record<string, unknown>): Promise<{ content: Array<{ type: "text"; text: string; }>; details: unknown; }>; };