Логотип Planetscale Query Insights And Tags

Planetscale Query Insights And Tags

Организация
planetscale
planetscale-query-insights-and-tags

Use PlanetScale Insights and SQLCommenter-style query tags to attribute database load, identify risky queries, and prepare safe Traffic Control or schema recommendations.

Add to TypingMind

Обзор

Издательplanetscale
Репозиторийskills
Название навыкаplanetscale-query-insights-and-tags
Звёзды
136
Форки
6
Файлы в комплекте
Только инструкции
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Всё необходимое — в инструкциях

    Всё необходимое для модели содержится в инструкциях — никаких дополнительных файлов для синхронизации.

  • Открытый исходный код

    Издатель навыка на GitHub — planetscale. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Planetscale Query Insights And Tags в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/planetscale/skills/tree/main/planetscale-query-insights-and-tags
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/planetscale/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/planetscale-query-insights-and-tags .claude/skills/planetscale-query-insights-and-tags
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Planetscale Query Insights And Tags в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Planetscale Query Insights And Tags, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Planetscale Query Insights And Tags не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Query Insights and tags

Purpose

Use PlanetScale Insights to understand query behavior, then recommend SQLCommenter-compatible tags that make future diagnosis and Traffic Control possible. Do not change database settings or repository code without approval.

What to inspect

Query behavior

For the selected database and branch, inspect:

  • Top queries by total time.
  • Top queries by time per execution.
  • Top queries by rows read.
  • Top queries by execution count.
  • For Postgres, top queries by CPU usage (sort=cpuTime or sort=percentCpuTime on the Insights API).
  • Queries with errors.
  • Notable queries and active anomalies.
  • Query patterns affected by recent deploys.
  • Query patterns attached to schema recommendations.
  • For sharded Vitess databases, vindex usage for each query pattern: the percentage of traffic using relevant vindexes and the vindex-usage trend over time. The API exposes per-pattern index_usages and routing_index_usages; get the trend from the dashboard Vindexes tab or by comparing API windows. Treat missing or declining relevant-vindex usage as an indexing or routing investigation input, not as proof that a new index is required.

Insights API surface

Query Insights is public API: read-only GET endpoints under organizations/{org}/databases/{db}/branches/{branch}, authorized by a service token or OAuth token with read_databases/read_database.

  • /insights — aggregated statistics per query pattern over the requested window. Set the window with from/to (ISO 8601) or period (for example 1h, 24h); search SQL patterns with q; sort server-side with sort and dir — sort keys include count, errorCount, rowsRead, totalTime, cpuTime, ioTime, percentTime, percentCpuTime, p50Latency, p99Latency, maxLatency, egressBytes, and the trafficControlWarnings/trafficControlThrottled family. Filter with tablet_type (primary, replica, rdonly) and type (SELECT, INSERT, UPDATE, DELETE); trim responses with fields; paginate with page/per_page.
  • /insights/{fingerprint} — individual collected executions for a pattern (timestamps, duration, rows, username, client address, error message). Available regardless of raw query collection; raw collection adds literal parameter values to these records. /insights/{fingerprint}/summary returns the single-pattern aggregate; /insights/queries/{id} fetches one execution.
  • /insights/errors — error fingerprints with counts and messages (q searches the error message; sort by count, lastRun, totalTime, or timePerQuery). /insights/errors/{fingerprint} lists the failing executions behind one error fingerprint.
  • /insights/anomalies and /insights/anomalies/{id} — anomaly windows with per-query correlation coefficients identifying which patterns moved with the anomaly.
  • /insights/tags — tag keys with observed values (values_limit, literal_values_only, and fingerprint/keyspace filters); /insights/tags/{tag} for a single key. /insights/tags/summaries groups the full statistics schema by one or more tag keys via the tags parameter — use it to attribute load to routes, jobs, or features without client-side aggregation.
  • /insights/{fingerprint}/traffic/budgets — the Traffic Control budgets and rules that affect a fingerprint (Postgres).

Aggregates cover the requested window. Duration fields use names like sum_total_duration_millis, with explicit share-of-window percent fields (sum_total_duration_percent); both totals and percentages are reliable for the window requested.

The response schema is shared across engines, but some fields are engine-specific: CPU/IO durations and block-cache statistics (sum_cpu_duration_millis, blocks_read, block_cache_hit_ratio, …) are populated for Postgres; shard queries, keyspaces, tablet_type, and routing-index (vindex) usage are populated for Vitess.

Tag coverage

For each expensive or anomalous query, determine:

  • Is it tagged?
  • Which service produced it?
  • Which route, job, controller, or action produced it?
  • Which deployment SHA produced it?
  • Is the tag cardinality safe?
  • Are tags consistent across frameworks and languages?
  • Use the tags API to answer these questions: /insights/tags shows which keys and values are present, and /insights/tags/summaries?tags=... attributes load per tag value. In the Vitess dashboard, filter the query table with tag:key:value and drill into query details to see tags on individual executions. Built-in query metadata and SQLCommenter tags are both valid attribution sources.

Raw query collection

Check whether raw query / complete query collection is enabled. On Postgres the effective state is the pginsights.raw_queries cluster parameter (per branch, dashboard Extensions tab, default false); the database API object's insights_raw_queries field is a separate surface. When the two differ, report the cluster parameter as the effective state and do not describe the difference as an inconsistency. On Vitess there is no cluster parameter; the database API's insights_raw_queries field is the effective state.

Report it as a capability state, not a risk posture. Raw query collection records literal parameter values per execution, which pattern-level Insights data does not provide. It is the mechanism for isolating which specific invocation of a pattern is pathological. Execution-level records are retrievable from /insights/{fingerprint} with or without raw collection; raw collection adds the literal parameter values to those records.

When it is disabled, the finding is a capability gap: identify the query patterns in this assessment where pattern-level data is insufficient (unexplained latency variance within a fingerprint, tenant- or parameter-dependent behavior) and state that raw collection would resolve them. State the operational property once, as fact: literal values become visible to the observability pipeline. Where the customer's data-handling requirements constrain this, scoped enablement (incident windows, defined retention) and leaving collection disabled are both valid outcomes — record the rationale rather than a default judgment in either direction.

Tags and raw collection are complementary instruments: tags attribute a pattern to a code path; raw collection identifies the specific invocation. Assessments should evaluate both.

SQLCommenter tag schema

Recommend this baseline tag set:

  • application: stable app name.
  • service: service or process name.
  • environment: production, staging, development.
  • route: normalized route template, for example /accounts/:id/orders, not /accounts/123/orders.
  • controller: framework controller name where applicable.
  • action: framework action name where applicable.
  • job: background job class or worker name.
  • queue: background queue.
  • feature: bounded feature name for traffic classes like export, report, search, billing, checkout.
  • release_sha: short git SHA or deploy identifier.
  • source: app, worker, script, agent, mcp, bi, integration.
  • tenant_tier: free, pro, enterprise, internal, only if bounded.

Do not recommend these tags by default:

  • user_id
  • request_id
  • tenant_id
  • email
  • session_id
  • raw URL
  • unbounded GraphQL operation text
  • access token
  • secret

If the customer needs tenant-level isolation, recommend a bounded abstraction first, such as tenant tier, cell, shard, or customer class. Tenant ID is only acceptable with explicit approval after cardinality and privacy review.

Cardinality rules

Flag a tag as unsafe when:

  • Values are unbounded.
  • Values include IDs, UUIDs, emails, slugs, or raw paths.
  • The same query pattern emits many unique tag combinations.
  • The tag would make Insights or Traffic Control aggregation noisy.

Recommend normalizing at the application boundary.

Analysis output

For each top query pattern, produce:

  • Fingerprint or normalized query.
  • Current metrics.
  • Current tags.
  • Missing tags.
  • Likely source in application code.
  • Whether it is a schema recommendation candidate.
  • Whether it is a Traffic Control candidate.
  • Whether it is an application optimization candidate.

Recommendation classes

Add tags

Recommend SQLCommenter instrumentation when query attribution is weak.

Improve tag normalization

Recommend replacing high-cardinality tags with bounded values.

Add Traffic Control warning budget

For Postgres only, recommend warn mode budgets for expensive but important routes, jobs, analytics, exports, or third-party integrations.

Add schema recommendation workflow

For Vitess, recommend turning open schema recommendations into branch/deploy-request work. For Postgres, recommend turning them into reviewed migrations against a non-production branch.

Fix code path

Recommend a repository PR when the expensive query is caused by N+1, missing pagination, accidental eager load, unbounded export, broad search, or polling.

Safety rules

Do not:

  • Enable raw query collection.
  • Add tags to code.
  • Change Traffic Control budgets.
  • Apply schema recommendations.
  • Run production EXPLAIN ANALYZE on expensive queries.

Without explicit approval.

Output

Return:

  • Query risk table.
  • Tag coverage table.
  • Bad/high-cardinality tag table.
  • Recommended tag schema for this application.
  • Candidate Traffic Control slices.
  • Candidate schema and code changes.
  • Proposed changes requiring approval.

End with:

“No Insights, tag, repository, or Traffic Control changes have been applied.”

Часто задаваемые вопросы

Что делает навык ИИ Planetscale Query Insights And Tags?

Use PlanetScale Insights and SQLCommenter-style query tags to attribute database load, identify risky queries, and prepare safe Traffic Control or schema recommendations.

Зачем использовать Planetscale Query Insights And Tags в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Planetscale Query Insights And Tags — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Planetscale Query Insights And Tags в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/planetscale/skills/tree/main/planetscale-query-insights-and-tags. TypingMind прочитает файл SKILL.md и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Planetscale Query Insights And Tags?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Planetscale Query Insights And Tags?

С любым количеством. В TypingMind вы можете использовать Planetscale Query Insights And Tags с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Planetscale Query Insights And Tags?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — planetscale. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все
Логотип pytorch

Ci Metrics

pytorch
ОрганизацияПопулярный

Запрос данных о CI PyTorch, GitHub Actions, HUD, Grafana и показателях инфраструктуры. Используйте этот навык, когда пользователи спрашивают о длительности CI, сбоях заданий, времени ожидания в очереди, тенденциях рабочих процессов, состоянии раннеров, данных панелей мониторинга или показателях…

31K
103.6K
Файлы: 1
Открыть
Логотип openclaw

Notcrawl

openclaw
ОрганизацияПопулярный

Архив Notion: поиск, актуальность синхронизации, страницы и базы данных, экспорт в Markdown, подсчёт записей в SQL и работа с репозиторием Notcrawl.

82.2K
391K
Файлы: 1
Открыть
Логотип openclaw

Openclaw Test Heap Leaks

openclaw
ОрганизацияПопулярный

Исследуйте рост потребления памяти при тестировании OpenClaw с pnpm, ошибки нехватки памяти (OOM) в Vitest, скачки RSS и изменения в снимках кучи.

82.2K
391K
Файлы: 2
Открыть
Логотип openclaw

Prototype Openclaw Tui

openclaw
ОрганизацияПопулярный

Создавайте временные прототипы OpenClaw Clack или Pi TUI на основе тестовых данных и сравнивайте несколько интерактивных вариантов рядом в tmux — без запуска всего приложения и доступа к рабочим данным.

82.2K
391K
Файлы: 2
Открыть

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇