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

29 lines (28 loc) 1.3 kB
/** * Sensitive data redaction — local implementation following openclaw's convention. * * `redactSensitiveText` is NOT in the published npm package (v2026.2.15) — * only in openclaw source. When it becomes available via plugin-sdk, switch to it. * * Format: `${first6}…${last4}` for tokens >= 18 chars, `***` for shorter tokens. * Patterns cover common API key formats, Bearer tokens, and PEM blocks. */ export declare function flattenLogKeys(attrs: Record<string, string | number | boolean>): Record<string, string | number | boolean>; /** * Redact sensitive tokens and credentials from a text string. * * Covers: API keys (sk-*, ghp_*, github_pat_*, xox*, gsk_*, AIza*, pplx-*, * npm_*, glsa_*), Bearer tokens, PEM blocks, Telegram bot tokens. * * @param text - The input text to redact * @returns Text with sensitive values replaced */ export declare function redactSecrets(text: string): string; /** * Apply `redactSecrets` to all string values in an attributes record. * Non-string values are passed through unchanged. * * @param attrs - Record of attribute key-value pairs * @returns New record with string values redacted */ export declare function redactAttributes(attrs: Record<string, string | number | boolean>): Record<string, string | number | boolean>;