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

75 lines (74 loc) 2.27 kB
/** * alloy_pipeline Consolidated Agent Tool * * Creates and manages Alloy data collection pipelines that continuously * feed metrics, logs, and traces into the LGTM stack. * * Actions: create, list, update, delete, recipes, status, diagnose * * Design rationale (from tool-design skill consolidation principle): * One tool for all Alloy operations. The agent needs exactly one name to * remember for anything pipeline-related. This matches the grafana_check_alerts * pattern (8 actions, both mutation and observation in one tool). */ import type { AlloyClient } from "../alloy/alloy-client.js"; import { PipelineStore } from "../alloy/pipeline-store.js"; import type { ExportTargets } from "../alloy/types.js"; type ToolDeps = { getClient: () => AlloyClient | null; getStore: () => PipelineStore | null; getExportTargets: () => ExportTargets; }; export declare function createAlloyPipelineToolFactory(deps: ToolDeps): (_ctx: unknown) => { name: string; label: string; description: string; parameters: { type: "object"; properties: { action: { type: string; enum: string[]; description: string; }; recipe: { type: string; description: string; }; params: { type: string; description: string; }; config: { type: string; description: string; }; name: { type: string; description: string; }; category: { type: string; enum: string[]; description: string; }; signal: { type: string; enum: string[]; description: string; }; sampleQueries: { type: string; description: string; }; }; }; execute(_toolCallId: string, rawParams: Record<string, unknown>): Promise<{ content: Array<{ type: "text"; text: string; }>; details: unknown; }>; }; export {};