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
72 lines (71 loc) • 2.08 kB
TypeScript
/**
* grafana_query_traces tool
*
* Run TraceQL queries against any Tempo datasource via Grafana's datasource proxy.
* Supports two query types:
* - search: TraceQL expression → flat trace summaries
* - get: Trace ID → flattened span list with resolved attributes
* Mirrors grafana_query_logs structure for consistency.
*/
import type { GrafanaClientRegistry } from "../grafana-client-registry.js";
export declare const MAX_SEARCH_TRACES = 50;
export declare const MAX_TRACE_SPANS = 200;
export declare function createQueryTracesToolFactory(registry: GrafanaClientRegistry): (_ctx: unknown) => {
name: string;
label: string;
description: string;
parameters: {
type: "object";
properties: {
datasourceUid: {
type: string;
description: string;
};
query: {
type: string;
description: string;
};
queryType: {
type: string;
enum: string[];
description: string;
};
start: {
type: string;
description: string;
};
end: {
type: string;
description: string;
};
limit: {
type: string;
description: string;
};
minDuration: {
type: string;
description: string;
};
maxDuration: {
type: string;
description: string;
};
dashboardUid: {
type: string;
description: string;
};
panelId: {
type: string;
description: string;
};
};
required: never[];
};
execute(_toolCallId: string, params: Record<string, unknown>): Promise<{
content: Array<{
type: "text";
text: string;
}>;
details: unknown;
}>;
};