← 返回 Skills 市场
ivangdavila

InfluxDB

作者 Iván · GitHub ↗ · v1.0.0
linuxdarwinwin32 ✓ 安全检测通过
952
总下载
3
收藏
4
当前安装
1
版本数
在 OpenClaw 中安装
/install influxdb
功能描述
Store and query time-series data with proper schema design and retention.
使用说明 (SKILL.md)

Version Differences

  • InfluxDB 2.x uses Flux query language, 1.x uses InfluxQL—syntax completely different
  • 2.x: buckets, organizations, tokens; 1.x: databases, retention policies, users
  • Don't mix documentation—check version before copying queries

Tags vs Fields (Critical)

  • Tags are indexed, fields are not—filter on tags, aggregate on fields
  • Tag values must be strings—numbers as tags work but waste index space
  • Fields support numbers, strings, booleans—store metrics as fields
  • Wrong choice kills query performance—can't change after data written

Cardinality Trap

  • High-cardinality tags destroy performance—unique user IDs as tags = disaster
  • Cardinality = unique combinations of tag values—grows multiplicatively
  • Check with SHOW CARDINALITY (1.x) or influx bucket inspect (2.x)
  • Rule of thumb: \x3C100K series per measurement; millions = problems

Line Protocol

  • Format: measurement,tag1=v1,tag2=v2 field1=1,field2="str" timestamp
  • No spaces around = in tags—space separates tags from fields
  • String fields need quotes, tag values don't—field="text" vs tag=text
  • Timestamps in nanoseconds by default—specify precision to avoid mistakes

Timestamps

  • Default precision is nanoseconds—sending seconds without precision flag = year 2000 data
  • Specify on write: precision=s for seconds, precision=ms for milliseconds
  • Missing timestamp uses server time—usually fine for real-time ingestion
  • Timestamps are UTC—client timezone doesn't matter

Retention and Downsampling

  • Set retention policy/bucket duration—data older than retention auto-deleted
  • Raw data at 10s intervals for 7 days, downsample to 1min for 30 days, 1h for 1 year
  • 2.x: Tasks for downsampling; 1.x: Continuous Queries
  • Without downsampling, storage grows forever and queries slow down

Flux Query Patterns (2.x)

  • Always start with from(bucket:) then |> range(start:)—range is required
  • |> filter(fn: (r) => r._measurement == "cpu") for filtering
  • |> aggregateWindow(every: 1h, fn: mean) for time-based aggregation
  • Chain transforms with |> pipe operator—order matters for performance

InfluxQL Patterns (1.x)

  • SELECT mean("value") FROM "measurement" WHERE time > now() - 1h GROUP BY time(5m)
  • Double quotes for identifiers, single quotes for string literals
  • GROUP BY time() for time-based aggregation—required for most dashboards
  • FILL(none) to skip empty intervals, FILL(previous) to carry forward

Schema Design

  • Measurement name = table name—one per metric type (cpu, memory, requests)
  • Tag for dimensions you filter/group by—host, region, service
  • Field for values you aggregate—usage_percent, count, latency_ms
  • Avoid encoding data in measurement names—cpu.host1 wrong, cpu + host=host1 right

Write Performance

  • Batch writes—individual points have HTTP overhead
  • Telegraf for production ingestion—handles batching, buffering, retry
  • Write to localhost if possible—network latency adds up at high throughput
  • async writes in client libraries—don't block on each write

Query Performance

  • Always include time range—unbounded queries scan everything
  • Filter on tags before fields—tags use index, fields scan data
  • Limit results with LIMIT or |> limit()—dashboard doesn't need 1M points
  • Use GROUP BY / aggregateWindow to reduce data before returning

Common Errors

  • "partial write: field type conflict"—same field with different types; fix at source
  • "max-values-per-tag limit exceeded"—cardinality too high; redesign schema
  • "database not found"—2.x uses buckets, not databases; check API version
  • Query timeout—add narrower time range or aggregate more aggressively
安全使用建议
This skill is instructional only and appears coherent with its stated purpose. Before enabling: ensure you trust the skill owner (no homepage/source provided), and be aware that using it may cause the agent to run the 'influx' CLI or curl against local or networked InfluxDB instances — those commands can read or modify your time-series data if run. The skill does not request credentials, so if you supply tokens/URLs to the agent at runtime, follow least-privilege practices (use read-only tokens when appropriate, restrict network access). If you run no InfluxDB instances or don't want the agent to access local/network databases, there is minimal risk because the skill has no install steps or hidden code.
功能分析
Type: OpenClaw Skill Name: influxdb Version: 1.0.0 The skill bundle contains standard metadata and a `SKILL.md` file that provides educational content and best practices for using InfluxDB. It declares dependencies on `influx` and `curl` binaries, which are legitimate tools for interacting with InfluxDB. There are no instructions for the AI agent to perform any malicious actions, such as data exfiltration, unauthorized command execution, persistence, or prompt injection attempts. The content is purely informational and aligns with the stated purpose.
能力评估
Purpose & Capability
The name/description (InfluxDB — store and query time-series data) align with the SKILL.md content (schema guidance, Flux/InfluxQL examples, line protocol, retention/downsampling). The declared requirement that at least one of 'influx' or 'curl' be available is appropriate for the documented commands. Note: source/homepage are missing from metadata (owner ID present), but that affects provenance rather than functional coherence.
Instruction Scope
SKILL.md is a focused set of operational and query recommendations (examples like `SHOW CARDINALITY`, `influx bucket inspect`, Flux and InfluxQL snippets, line protocol rules). It does not instruct reading unrelated files, accessing unrelated environment variables, or transmitting data to third‑party endpoints. It does imply the agent may run the 'influx' CLI or use curl to contact an InfluxDB endpoint, which is expected for this skill's purpose.
Install Mechanism
No install spec and no code files — lowest-risk, instruction-only skill. Nothing will be downloaded or written to disk by the skill itself.
Credentials
The skill declares no required environment variables or credentials, which is proportionate for a documentation/guidance skill. Practical use may require the agent/operator to supply connection details or tokens at runtime (not declared), but that is typical and not inherently suspicious.
Persistence & Privilege
always:false and default model invocation settings. The skill does not request persistent system changes or privilege expansion and does not modify other skills or system-wide settings.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install influxdb
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /influxdb 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
Slug influxdb
版本 1.0.0
许可证
累计安装 4
当前安装数 4
历史版本数 1
常见问题

InfluxDB 是什么?

Store and query time-series data with proper schema design and retention. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 952 次。

如何安装 InfluxDB?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install influxdb」即可一键安装,无需额外配置。

InfluxDB 是免费的吗?

是的,InfluxDB 完全免费(开源免费),可自由下载、安装和使用。

InfluxDB 支持哪些平台?

InfluxDB 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux, darwin, win32)。

谁开发了 InfluxDB?

由 Iván(@ivangdavila)开发并维护,当前版本 v1.0.0。

💬 留言讨论