Логотип Vm Trace Analyzer

Vm Trace Analyzer

Організація
VictoriaMetrics
vm-trace-analyzer

Analyze VictoriaMetrics query trace JSON to diagnose slow queries and produce a structured performance report with time breakdown, bottleneck analysis, and optimization recommendations. ALWAYS use this skill when: (1) the user mentions a VictoriaMetrics or VM trace, query trace, or trace JSON, (2) the user provides or references a JSON file containing duration_msec/message/children fields, (3) the user asks why a VictoriaMetrics/VM query is slow and has trace output, (4) the user asks about vmstorage node distribution, cache misses, or rollup performance in the context of a trace, (5) the user mentions vmselect trace, trace=1, or query performance debugging with VictoriaMetrics. This skill provides a structured report template that ensures consistent, thorough analysis — do not attempt to analyze VM traces without it.

Add to TypingMind

Огляд

ВидавецьVictoriaMetrics
Репозиторійskills
Назва навичкиvm-trace-analyzer
Зірки
62
Форки
9
Файли в пакеті
2
ЛіцензіяApache-2.0
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 2

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Видавець на GitHub: VictoriaMetrics. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Vm Trace Analyzer у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки на GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до розділу «Плагіни» → «Навички».
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/VictoriaMetrics/skills/tree/main/plugins/diagnostics/skills/vm-trace-analyzer
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/VictoriaMetrics/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/plugins/diagnostics/skills/vm-trace-analyzer .claude/skills/vm-trace-analyzer
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Vm Trace Analyzer в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Vm Trace Analyzer, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Vm Trace Analyzer не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

VictoriaMetrics Query Trace Analyzer

You are analyzing a VictoriaMetrics query trace — a JSON tree that records every step of a PromQL query execution. Your goal is to read this tree, understand what happened, and produce a clear performance report with actionable recommendations.

Background

In Cluster mode two components are involved in query processing:

  • vmselect — query frontend that accepts PromQL or MetricsQL queries, fetches data from vmstorage nodes, and applies calculations
  • vmstorage — stores time series data and serves it to vmselect over RPC

Single-node mode runs everything in one process. The trace structure is similar but without RPC wrappers.

You can tell which mode you're looking at from the root message in trace:

  • Cluster traces contains vmselect-<version>: /select/...,
  • Single-node traces contains /victoria-metrics-<version>: /api/v1/....

What is a query trace?

When you add trace=1 to a VictoriaMetrics HTTP query, it returns a JSON tree describing every internal operation. Each node looks like this:

json
{
  "duration_msec": 123.456,
  "message": "description of what happened",
  "children": [ ... ]
}

The tree is rooted at vmselect. It captures the full query execution pipeline: parsing, series search, data fetch from storage, rollup computation, aggregation, and response generation.

How to analyze the trace

Step 0: Run the parse script

Before manually reading the trace file, run the analysis script to extract structured data:

bash
python3 <skill_base_dir>/scripts/parse_trace.py <trace_file>

This outputs: root info, trace tree (depth 3), key nodes with durations, per-vmstorage RPC breakdown, and computed totals (bytes, samples, series). Use this output as your primary data source for the report.

Additional subcommands for deeper investigation:

  • python3 <script> <trace> tree --depth N — print the trace tree to depth N
  • python3 <script> <trace> nodes --pattern "fetch unique" — find all nodes matching a substring

Only drill deeper if the summary output reveals ambiguities or missing information.

After running the summary, also check for relevant performance improvements in newer VictoriaMetrics versions:

bash
python3 <skill_base_dir>/scripts/check_changelog.py <version> <mode>

Where <version> is the semver from the parse script output (e.g., v1.130.0) and <mode> is cluster or single-node. This fetches changelogs from GitHub and shows performance-relevant fixes/features in versions newer than what the trace was captured on. If the fetch fails, skip this section gracefully.

Step 1: Start at the root

Read the trace JSON file the user provides (or use the script output from Step 0). The root node tells you the big picture. Extract:

  • Endpoint: /api/v1/query (instant) or /api/v1/query_range (range)
  • Query: the PromQL expression after query=
  • Time parameters: start=, end=, step= (for range queries)
  • Result count: series= at the end
  • Total duration: the root duration_msec
  • Version: printed in the very start of the trace.

Step 2: Identify the phases

Walk the top-level children and classify each into one of these phases. Not every trace has all of them — just report what's there.

For large traces, focus on the top-level children first. Drill into subtrees only when they are relevant to the bottleneck or when durations are surprising.

A query trace typically has these phases, roughly in this order. Not all phases appear in every trace. Identify them by matching the message patterns described here.

Expression evaluation — nodes matching: eval: query=..., timeRange=..., step=..., mayCache=...: series=N, points=N, pointsPerSeries=N These trace the recursive PromQL/MetricsQL expression tree. These trace the recursive evaluation of the PromQL/MetricsQL expression tree. Each eval node may have children for sub-expressions. Key numbers:

  • series — number of time series produced by this sub-expression
  • points — total data points across all series
  • pointsPerSeries — data points per series

Functions and aggregations — nodes matching:

  • transform <func>(): series=N — PromQL functions (histogram_quantile, clamp, etc.)
  • aggregate <func>(): series=N — aggregation operators (sum, avg, max, etc.)
  • binary op "<op>": series=N — binary operations

Series search (index lookup) — where label matchers get resolved to internal series IDs:

  • In Cluster traces, wrapped in rpc at vmstorage <addr> → rpc call search_v7(), in Single-node - appears directly without RPC wrappers
  • Key messages:
    • init series search,
    • search TSIDs,
    • search N indexDBs in parallel — parallel index database search,
    • search indexDB — individual index partition,
    • found N metric ids for filter=... — metric ID, unique time series identifier within vmstorage,
    • found N TSIDs for N metricIDs — same as metric ID,
    • sort N TSIDs
  • Cache-related messages in this phase:
    • search for metricIDs in tag filters cache followed by cache miss or a cache hit (no cache miss child)
    • put N metricIDs in cache / stored N metricIDs into cache

Data fetch — getting raw data:

  • Cluster: fetch matching series: ... wraps RPC calls to each vmstorage node:
    • rpc at vmstorage <addr> — per-node RPC,
    • sent N blocks to vmselect — amount of raw data transmitted back,
    • fetch unique series=N, blocks=N, samples=N, bytes=N — aggregate summary across all vmstorage nodes,
  • Single-node: search for parts with data for N series followed by data scan messages. The bytes value in fetch unique series tells you total data transferred and is a good indicator of I/O load.

Rollup computation — computing rate(), increase(), avg_over_time(), etc.:

  • rollup <func>(): timeRange=..., step=N, window=N
  • rollup <func>() with incremental aggregation <agg>() over N series — this is an optimization
  • the rollup evaluation needs an estimated N bytes of RAM for N series and N points per series — memory estimate
  • parallel process of fetched data: series=N, samples=N — the actual computation over raw samples
  • series after aggregation with <func>(): N; samplesScanned=N — post-aggregation result This phase often dominates execution time for queries that scan large amounts of raw data.

Response generation — usually trivial:

  • sort series by metric name and labels
  • generate /api/v1/query_range response for series=N, points=N Usually trivially fast. Could be a bottleneck if response is huge (hundreds of series and thousands of datapoints per-series) and client's speed on reading the response is slow.

Step 3: Build the time breakdown

For each phase, note the duration_msec. In Cluster traces, the same phases repeat for each vmstorage node — aggregate for the summary but also track per-node numbers to spot imbalances.

Step 4: Find the bottleneck

Identify which phase consumed the most time and explain why in concrete terms. For instance, "The rollup scanned 212M raw samples" is useful; "the query was slow" is not.

Step 5: Write recommendations

Base recommendations only on what the trace actually shows. If the query is fast and healthy, say so — don't invent problems.

Follow this algorithm to select recommendations:

  • Step 5a: From the time breakdown, identify which single phase dominates (>60% of total latency). Map it to the matching pattern in the "Recommendation patterns" section below.
  • Step 5b: Use ONLY that pattern's recommendations, in the listed priority order. Do not pull recommendations from other patterns.
  • Step 5c: If no single phase exceeds 60%, pick the pattern with the highest contribution and note secondary factors, but still do not mix recommendations across patterns.

Report format

markdown
## Query Overview

- **Query:** `<the PromQL/MetricsQL expression>`
- **Type:** instant / range query
- **Time range:** <start> to <end> (<duration>)
- **Step:** <step>
- **Result:** <N> series, <N> points
- **Version:** vmselect or VM single-node version

## Performance Summary

- **Total duration:** <N>ms
- **Duration score:** <Fast / Acceptable / Slow / Very Slow>
- **Matched series:** <N> (across all storage nodes)
- **Raw samples scanned:** <N>
- **Bytes transferred:** <N>

"Duration score" thresholds:
- Fast: < 500ms
- Acceptable: 500ms–5s
- Slow: 5s–10s
- Very Slow: > 10s

## Execution Time Breakdown

| Phase | Duration | % of Total | Notes |
|-------|----------|------------|-------|
| Series search (index) | Xms | X% | |
| Data fetch | Xms | X% | |
| Rollup computation | Xms | X% | |
| Aggregation / functions | Xms | X% | |
| Response generation | Xms | X% | |

(Adapt the phases to what actually appears in the trace. 
For cluster traces, break down data fetch per storage node.)

## Storage Node Breakdown (cluster only)

| Node | Series | Bytes sent | Duration |
|------|--------|-------------|----------|
| vmstorage-1 | N | N | Xms |
| vmstorage-2 | N | N | Xms |

## Bottleneck Analysis

Name the single biggest contributor to total query time. Explain why it's slow with specific numbers from the trace.

## Recommendations

Provide actionable suggestions to reduce query latency (see guidance below).

## Upgrade Recommendations (if applicable)

If the changelog check found performance-relevant improvements in newer versions,
list them here with version, release date, and description.
Only include this section if there are concrete relevant entries. Omit entirely otherwise.

Report generation rules

  • Do not speculate about issues that are not evidenced in the trace. If the trace looks healthy and the query is fast, say so.
  • Don't show information about blocks in report - it useless for users and can be confusing. Focus on bytes instead.
  • Don't inform about imbalance in Duration between vmstorage nodes unless it exceeds 1-2s.
  • For durations use format "Xm" / "Xs" / "Xms" (e.g., "123ms"), use minutes only for durations above 60s, seconds for durations above 1000ms, and ms for shorter durations.
  • For data volumes, use human-readable formats (e.g., "268 MB" instead of "268000000 bytes"). Use appropriate units (KB, MB, GB) based on the size.
  • Use the duration_msec values directly from the trace — don't estimate durations by subtraction
  • In cluster traces, the same phases (index search, data scan) appear for each vmstorage node. Aggregate these for the summary but also show per-node breakdown so the user can spot imbalances.
  • If the trace is too large to read in a single pass, read the top-level structure first, identify the slowest branches by duration_msec, and drill into those.
  • Some traces may include subquery or @ modifier evaluation — treat these like nested eval phases.
  • mayCache=false in eval messages is informational, not a problem

Recommendation patterns

CRITICAL: Pattern selection rules

  1. First, identify which ONE pattern below matches your bottleneck from the time breakdown.
  2. Use ONLY the recommendations from that single pattern, in the listed priority order.
  3. Do NOT mix recommendations from different patterns. If the dominant phase exceeds 60% of total latency, all recommendations MUST come from that pattern only.
  4. If a recommendation appears in multiple patterns, that does not make it pattern-independent — only use it if it's listed in YOUR selected pattern.

Base recommendations on what the trace actually shows sorted by priority. Here are common patterns and the corresponding advice:

High series cardinality (many matched series)

  1. Suggest adding more specific label matchers to reduce series count
  2. Suggest using recording rules to pre-aggregate if this is a dashboard query
  3. Suggest using stream aggregation to pre-aggregate series before storing if possible
  4. Suggest narrowing the time range if the matched metric has a high churn rate

Large raw sample scan (high samplesScanned)

  1. If the amount of samplesScanned significantly exceeds samples fetched, then query is using too short [window] or too agressive subqueries.
  2. For rate()/irate()/increase() suggest shorter [window] if semantically acceptable
  3. Suggest increasing the query step to reduce points per series
  4. Suggest narrowing the time range

Slow index lookups (series search dominates)

  1. Tag filter cache misses are normal on first query; note that repeated queries should be faster
  2. Large number of metric IDs per day partition suggests high churn or high cardinality issue
  3. Suggest more selective filters if possible
  4. Suggest increasing the amount of memory on vmstorage nodes if possible

Slow data fetch / high bytes transferred (cluster)

  1. Large sent bytes suggests vmstorage is doing heavy I/O
  2. For resource saturation recommend checking resource usage on the official Grafana dashboard for VictoriaMetrics.
  3. Suggest checking vmstorage disk I/O and network bandwidth
  4. Multiple vmstorage nodes with very uneven durations (more than 1-2 seconds) may indicate resource saturation or hardware issues.
  5. Suggest adding more vmstorage nodes if possible to horizontally scale I/O capacity

Slow data fetch / high bytes transferred (Single-node)

  1. Large sent bytes suggests VM single-node is doing heavy I/O
  2. For resource saturation recommend checking resource usage on the official Grafana dashboard for VictoriaMetrics.
  3. Suggest checking VM single-node disk I/O and CPU
  4. Suggest increasing disk I/O limits
  5. If optimizing the query or data it queries isn't possible, suggest switching to cluster topology for horizontal scaling of I/O capacity

Rollup computation dominates (often caused by scanning millions of raw samples)

  1. Suggest increasing vmselect CPU limits to improve computation speed.
  2. Suggest adding more specific label matchers to reduce the number of series being processed.
  3. Suggest narrowing the time range to reduce the volume of raw samples.
  4. Suggest increasing the query step to reduce points per series.
  5. For recurring dashboard queries, suggest recording rules to pre-compute the result.

Version upgrade opportunities If the check_changelog.py script found relevant performance improvements in newer versions, mention the upgrade as an additional recommendation in the "Upgrade Recommendations" report section. This is the ONE exception to the "single pattern only" rule — upgrade recommendations are supplementary and can be appended regardless of which bottleneck pattern was selected. Only include entries that are directly relevant to the observed bottleneck or the components involved in the trace.

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Vm Trace Analyzer?

Analyze VictoriaMetrics query trace JSON to diagnose slow queries and produce a structured performance report with time breakdown, bottleneck analysis, and optimization recommendations. ALWAYS use this skill when: (1) the user mentions a VictoriaMetrics or VM trace, query trace, or trace JSON, (2) the user provides or references a JSON file containing duration_msec/message/children fields, (3) the user asks why a VictoriaMetrics/VM query is slow and has trace output, (4) the user asks about vmstorage node distribution, cache misses, or rollup performance in the context of a trace, (5) the u...

Навіщо використовувати Vm Trace Analyzer у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Vm Trace Analyzer — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Vm Trace Analyzer у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/VictoriaMetrics/skills/tree/main/plugins/diagnostics/skills/vm-trace-analyzer. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Vm Trace Analyzer?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Vm Trace Analyzer?

Зі скількома забажаєте. У TypingMind ви можете використовувати Vm Trace Analyzer із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Vm Trace Analyzer?

Так. На GitHub цю навичку публікує VictoriaMetrics за ліцензією Apache-2.0. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі
Логотип openclaw

Clawsweeper

openclaw
ОрганізаціяПопулярне

Використовуйте для будь-якої роботи з ClawSweeper: звітів про перевірку завдань і PR в OpenClaw, завдань із виправленнями, PR із хмарними виправленнями, команд згадки супроводжувача @clawsweeper, довірених автоматичних виправлень і автоматичного злиття, перевірених ClawSweeper, моніторингу GitHub Actions…

82.2K
391K
Файлів: 1
Відкрити
Логотип openclaw

Control Ui E2e

openclaw
ОрганізаціяПопулярне

Використовуйте під час проєктування, тестування, виправлення або розширення графічного інтерфейсу OpenClaw Control UI, зокрема для галерей стрес-тестування інтерфейсу зі зворотним зв’язком, наскрізних перевірок за допомогою Vitest + Playwright, сценаріїв Gateway із заглушками…

82.2K
391K
Файлів: 1
Відкрити
Логотип openclaw

Deslop

openclaw
ОрганізаціяПопулярне

Очищення змін у поточній гілці від AI-slop: перед автоматичним переглядом приберіть зайві коментарі, надмірні захисні перевірки, підміну типів і відхилення від стилю.

82.2K
391K
Інструкції
Відкрити
Логотип openclaw

Discord Clawd

openclaw
ОрганізаціяПопулярне

Використовуйте, щоб спілкуватися з агентом або сеансом OpenClaw, підключеним до Discord; не для пошуку в архіві.

82.2K
391K
Файлів: 1
Відкрити

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇