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
97 lines (96 loc) • 3.15 kB
TypeScript
/**
* grafana_push_metrics tool
*
* Four actions in one tool:
* - push (default): Push data points into Prometheus via custom metrics
* - register: Pre-register a metric with explicit schema
* - list: List all custom metrics
* - delete: Remove a custom metric
*
* This is the bridge that turns Grafana into a general-purpose analytics
* platform. Once data is pushed, all existing tools (query, dashboard,
* alert, share, annotate) work on it automatically.
*/
import type { GrafanaClientRegistry } from "../grafana-client-registry.js";
import { type CustomMetricsStore } from "../services/custom-metrics-store.js";
export declare function createPushMetricsToolFactory(_registry: GrafanaClientRegistry, getCustomMetricsStore: () => CustomMetricsStore | null): (_ctx: unknown) => {
name: string;
label: string;
description: string;
parameters: {
type: "object";
properties: {
action: {
type: string;
enum: string[];
description: string;
};
metrics: {
type: string;
description: string;
items: {
type: string;
properties: {
name: {
type: string;
description: string;
};
value: {
type: string;
description: string;
};
labels: {
type: string;
description: string;
};
type: {
type: string;
enum: string[];
description: string;
};
help: {
type: string;
description: string;
};
timestamp: {
type: string;
description: string;
};
};
required: string[];
};
};
name: {
type: string;
description: string;
};
type: {
type: string;
enum: string[];
description: string;
};
help: {
type: string;
description: string;
};
labelNames: {
type: string;
items: {
type: string;
};
description: string;
};
ttlDays: {
type: string;
description: string;
};
};
};
execute(_toolCallId: string, params: Record<string, unknown>): Promise<{
content: Array<{
type: "text";
text: string;
}>;
details: unknown;
}>;
};