Influxdb

From G1Joshi/Agent-Skills · View interactive version

Influxdb is an AI agent skill from the GitHub repository G1Joshi/Agent-Skills. Expert InfluxDB time-series assistance covering Line Protocol, Flux/InfluxQL, retention policies, downsampling, and bucket management. Use when storing IoT metrics, application telemetry, or financial time-series data.

How to use this skill

Skill file

InfluxDB

InfluxDB is a purpos-built time series database. Version 3.0 (IOx) is a complete rewrite in Rust, using Parquet/Arrow for massive performance gains.

When to Use

Quick Start

InfluxDB 3.0 supports SQL!

SELECT room, MEAN(temp)
FROM sensors
WHERE time > now() - 1h
GROUP BY room

Core Concepts

Line Protocol Data Ingestion

The compact text format for streaming time-series data:

# Syntax: <measurement>,<tag_set> <field_set> <timestamp>
cpu_usage,host=serverA,region=us-east idle=84.2,system=3.8,user=12.0 1727420400000000000
mem_usage,host=serverA,region=us-east used_percent=64.1 1727420400000000000

InfluxQL / SQL Engine Architecture (InfluxDB 3.0 / IOx)

Powered by Apache Arrow and DataFusion, supporting standard SQL over columnar Parquet files:

-- Query time-series telemetry in InfluxDB 3.0 SQL
SELECT
  date_bin(INTERVAL '5 minutes', time) AS window_time,
  host,
  avg(idle) AS avg_idle_cpu,
  max(user) AS peak_user_cpu
FROM cpu_usage
WHERE time >= now() - INTERVAL '6 hours'
  AND region = 'us-east'
GROUP BY window_time, host
ORDER BY window_time DESC;

Tags vs Fields (Index Cardinality)

Common Patterns

Line Protocol Ingestion with Nanosecond Precision

Problem: High-throughput telemetry ingestion bottlenecks when formatted as bloated JSON objects.

Solution:

Use compact InfluxDB Line Protocol:

# Line Protocol syntax: measurement,tag_set field_set timestamp
curl -XPOST "http://localhost:8086/api/v2/write?bucket=telemetry&org=myorg"   -H "Authorization: Token $INFLUX_TOKEN"   --data-raw 'cpu_usage,host=server01,region=us-west cpu_idle=72.5,cpu_system=12.1 1711530000000000000'

Best Practices

Do:

Don't:

Troubleshooting

| Error | Cause | Solution |

| :----------------------------------------- | :------------------------------------------------------------------ | :---------------------------------------------------------------------------------- |

| write: series cardinality limit exceeded | Creating too many unique tag combinations (e.g. using UUID as tag). | Move high-cardinality values (IDs, hashes) from tags to fields. |

| 401 Unauthorized | Missing or invalid InfluxDB 2.x API authentication token. | Pass header Authorization: Token <token> with bucket write permissions. |

| rejected line protocol syntax | Formatting error in measurement, tag comma, or field type mismatch. | Check string escaping and ensure integers are suffixed with i (e.g. count=42i). |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.