Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

influxdb

БесплатноБез исполняемых скриптовНе проверен

InfluxDB is an open-source time-series database for metrics, events and sensor data. Use when a user needs to run InfluxDB 2 or InfluxDB 3 Core, create…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

InfluxDB

Overview

Configure InfluxDB for time-series data storage and analysis. Two generations are in use and they are not interchangeable:

  • InfluxDB 2 (OSS 2.9.1, port 8086): buckets, the Flux language, tasks, checks, a built-in UI, the influx CLI. Tasks A–F below. Flux is in maintenance mode — still supported on 1.x and 2.x, never coming to 3.
  • InfluxDB 3 Core (3.11.5, port 8181): databases and tables, SQL and InfluxQL, the influxdb3 CLI, no Flux and no tasks (a Python processing engine replaces them). Task G.

Instructions

Task A: Initial Setup and Configuration

# Deploy InfluxDB 2 with Docker. Pin the tag: `latest` is announced to move to InfluxDB 3 Core.
docker run -d --name influxdb \
  -p 8086:8086 \
  -v influxdb_data:/var/lib/influxdb2 \
  -v influxdb_config:/etc/influxdb2 \
  -e DOCKER_INFLUXDB_INIT_MODE=setup \
  -e DOCKER_INFLUXDB_INIT_USERNAME=admin \
  -e DOCKER_INFLUXDB_INIT_PASSWORD="$INFLUXDB_ADMIN_PASSWORD" \
  -e DOCKER_INFLUXDB_INIT_ADMIN_TOKEN="$INFLUX_TOKEN" \
  -e DOCKER_INFLUXDB_INIT_ORG=myorg \
  -e DOCKER_INFLUXDB_INIT_BUCKET=metrics \
  -e DOCKER_INFLUXDB_INIT_RETENTION=30d \
  influxdb:2.9
# /etc/influxdb2/config.yml — InfluxDB 2 options are flat keys, the same names as the influxd flags.
# 1.x-style sections ([http], [logging]) make influxd refuse to start.
# Keep both paths and use YAML with the Docker image: without them data lands outside the volume,
# and its entrypoint misreads a TOML bolt-path, re-runs setup and the container exits on restart.
bolt-path: /var/lib/influxdb2/influxd.bolt
engine-path: /var/lib/influxdb2/engine
http-bind-address: ":8086"
log-level: info
storage-cache-snapshot-memory-size: 26214400
storage-max-concurrent-compactions: 2
reporting-disabled: true
# Point the influx CLI at the server once; later commands need no --host or --token
influx config create --config-name production \
  --host-url http://localhost:8086 --org myorg --token "$INFLUX_TOKEN" --active

Task B: Bucket and Token Management

# Create buckets via CLI
influx bucket create --name infrastructure --retention 30d --org myorg
influx bucket create --name app-metrics --retention 90d --org myorg
influx bucket create --name downsampled --retention 365d --org myorg
# Scoped tokens take bucket IDs, not names
INFRA_ID=$(influx bucket list --name infrastructure --hide-headers | cut -f 1)
APP_ID=$(influx bucket list --name app-metrics --hide-headers | cut -f 1)

# Write-only token for Telegraf
influx auth create --org myorg --description "Telegraf write token" \
  --write-bucket "$INFRA_ID" --write-bucket "$APP_ID"

# Read-only token for Grafana
influx auth create --org myorg --description "Grafana read token" \
  --read-bucket "$INFRA_ID" --read-bucket "$APP_ID"

Copy the token from the auth create output immediately. Since 2.9.0 tokens are stored hashed: influx auth list no longer shows them and they cannot be recovered.

Task C: Write Data via API

# Write metrics using line protocol: measurement,tags fields timestamp
curl -X POST "http://localhost:8086/api/v2/write?org=myorg&bucket=app-metrics&precision=s" \
  -H "Authorization: Token ${INFLUX_TOKEN}" \
  -H "Content-Type: text/plain" \
  --data-binary '
http_requests,service=api-gateway,method=GET,status=200 count=1523,latency_ms=45.2 1790848800
http_requests,service=api-gateway,method=POST,status=201 count=234,latency_ms=120.5 1790848800
http_requests,service=payment,method=POST,status=500 count=3,latency_ms=5020.0 1790848800
queue_depth,service=order-processor queue_size=142,consumers=5 1790848800
'

A successful write returns HTTP 204 with an empty body. Numbers are floats unless suffixed with i (consumers=5i); a field keeps the type of its first write, and a later write with another type is rejected.

Task D: Flux Queries

// Query: CPU usage over last hour, grouped by host
from(bucket: "infrastructure")
  |> range(start: -1h)
  |> filter(fn: (r) => r._measurement == "cpu" and r._field == "usage_percent" and r.cpu == "cpu-total")
  |> aggregateWindow(every: 5m, fn: mean)
  |> yield(name: "cpu_usage")
// Query: Top 5 services by error count in last 24h
from(bucket: "app-metrics")
  |> range(start: -24h)
  |> filter(fn: (r) => r._measurement == "http_requests" and r._field == "count" and r.status =~ /^5/)
  |> group(columns: ["service"])
  |> sum()
  |> group()
  |> sort(columns: ["_value"], desc: true)
  |> limit(n: 5)
// Query: Calculate error rate percentage per service
errors = from(bucket: "app-metrics")
  |> range(start: -1h)
  |> filter(fn: (r) => r._measurement == "http_requests" and r._field == "count" and r.status =~ /^5/)
  |> group(columns: ["service"])
  |> sum()

total = from(bucket: "app-metrics")
  |> range(start: -1h)
  |> filter(fn: (r) => r._measurement == "http_requests" and r._field == "count")
  |> group(columns: ["service"])
  |> sum()

join(tables: {errors:
Полный SKILL.md на GitHub

Установить influxdb в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл influxdb?

InfluxDB is an open-source time-series database for metrics, events and sensor data. Use when a user needs to run InfluxDB 2 or InfluxDB 3 Core, create buckets, databases and API tokens, write line protocol, query with Flux, SQL or InfluxQL, set retention periods, downsample data with tasks, or alert on thresholds.

Как установить скилл influxdb?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл influxdb запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить influxdb с