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
27 lines (26 loc) • 1.28 kB
TypeScript
/**
* Alloy Pipeline Service
*
* Plugin service that manages the lifecycle of the Alloy pipeline system:
* - Creates AlloyClient for HTTP API communication
* - Creates PipelineStore for state persistence
* - Runs drift detection on startup
* - Provides getters for tools to access client and store
*
* Follows createMetricsCollectorService / createAlertWebhookService pattern:
* - Factory function returning { service, getClient, getStore }
* - start() initializes everything, stop() cleans up
* - Non-blocking startup: logs warnings if Alloy is unreachable but doesn't fail
*/
import type { OpenClawPluginService } from "openclaw/plugin-sdk/core";
import type { GrafanaLensConfig, ValidatedGrafanaLensConfig } from "../config.js";
export type AlloyConfig = NonNullable<GrafanaLensConfig["alloy"]>;
import type { ExportTargets } from "../alloy/types.js";
import { AlloyClient } from "../alloy/alloy-client.js";
import { PipelineStore } from "../alloy/pipeline-store.js";
export declare function createAlloyService(alloyConfig: AlloyConfig, otlpConfig?: ValidatedGrafanaLensConfig["otlp"]): {
service: OpenClawPluginService;
getClient: () => AlloyClient | null;
getStore: () => PipelineStore | null;
getExportTargets: () => ExportTargets;
};