К основному содержанию
скилл CX Codex

retrieving-mlflow-traces — скилл для Claude Code: поиск трасс MLflow

Скилл retrieving-mlflow-traces для Claude Code. Достаёт трассы MLflow по ID или фильтрам через CLI и Python API. Находит упавшие трассы и анализирует медленные запуски.

Apache-2.0 991 установок ★ 91 обновлён 2026-10-23

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add mlflow/skills --skill retrieving-mlflow-traces -a claude-code
Открыть на GitHub

Что делает retrieving-mlflow-traces

Скилл учит агента получать трассы MLflow двумя способами: точечно по ID через mlflow traces get или поиском по критериям через mlflow traces search. Фильтровать можно по статусу, тегам, метаданным, времени выполнения, сессии, пользователю и оценкам.

Для поиска в Unity Catalog скилл требует временную границу trace.timestamp_ms >= <start_time_ms> в строке фильтра. Без неё даже маленький --max-results не спасёт: сканируется вся история трасс. В Python временное условие передаётся через filter_string, потому что у mlflow.search_traces() нет аргумента start_time.

Отдельный режим — проверка свежей инструментовки. На неё отводится 60 секунд и максимум одна повторная попытка после быстрого фикса. Если чтение не сработало, скилл заставляет агента отчитаться, что проверено, что нет и что нужно от пользователя: API-ключ, права, доступность склада.

Какие задачи решает

  • Найти трассу по точному ID
  • Отфильтровать упавшие трассы по статусу ERROR
  • Вытащить все трассы одной сессии для отладки
  • Найти запуски медленнее заданного порога
  • Проверить, что новая инструментовка пишет трассы

Примеры запросов агенту

  • Найди трассу tr-69f72a3772570019f2f91b75b8b5ded9
  • Покажи упавшие трассы в эксперименте 1
  • Найди все трассы сессии session_abc123, отсортируй по времени

Как установить retrieving-mlflow-traces

1Через Skills CLI (Vercel)

npx skills add mlflow/skills --skill retrieving-mlflow-traces -a claude-code

2Вручную: положить файлы

~/.claude/skills/retrieving-mlflow-traces/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/retrieving-mlflow-traces/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о retrieving-mlflow-traces

Как установить retrieving-mlflow-traces в Claude Code?

Выполни npx skills add mlflow/skills --skill retrieving-mlflow-traces -a claude-code. Файл скилла появится в ~/.claude/skills/retrieving-mlflow-traces/SKILL.md.

Что делает retrieving-mlflow-traces?

Получает трассы MLflow через CLI или Python API. Умеет искать по ID, статусу, тегам, метаданным, времени выполнения и тексту.

Почему скилл требует временную границу при поиске в Unity Catalog?

Потому что без trace.timestamp_ms >= <start_time_ms> поиск сканирует всю историю трасс. Ограничение числа результатов тут не помогает. Если нужный период неизвестен, скилл просит пользователя уточнить его до запуска широкого поиска.

Исходный текст

SKILL.md · Apache-2.0
---
name: retrieving-mlflow-traces
description: Retrieves MLflow traces using CLI or Python API. Use when the user asks to get a trace by ID, find traces, filter traces by status/tags/metadata/execution time, query traces, or debug failed traces. Triggers on "get trace", "search traces", "find failed traces", "filter traces by", "traces slower than", "query MLflow traces".
---

# Retrieving MLflow Traces

## Bound Unity Catalog Searches by Time

When searching traces stored in Unity Catalog, include `trace.timestamp_ms >= <start_time_ms>` in the filter string, with an upper bound when known. This also applies when searching by experiment ID, run ID, session, or other filters: a small result limit does not prevent a scan across the full trace history. In Python, pass the time condition through `filter_string`; `mlflow.search_traces()` has no `start_time` argument.

Use the time window requested by the user or established by the run or incident. For setup verification, record the time immediately before the instrumented run. Do not silently restrict historical investigations to the last hour. If the relevant period cannot be determined, ask for it before starting a broad UC search. The examples below demonstrate individual filters; combine them with the relevant time bounds for UC.

## Keep Setup Verification Brief

For verifying newly added instrumentation, follow the verification workflow in `instrumenting-with-mlflow-tracing`. Enforce a 60-second wall-clock deadline for readback, cancelling the verification command at the deadline even if a call is still retrying internally: make one fetch by a known trace ID, or one time-bounded search with `--max-results 1` (Python: `max_results=1`). Retry at most once after a concrete, quick fix, within the same budget. Stop once one trace and its expected spans are confirmed.

If readback is slow or fails, report what was verified, what remains unverified, and the observed blocker and required user action (such as configuring a missing API key, logging in, obtaining permission, or resolving warehouse availability/capacity). Do not start parallel searches or fall back to direct SQL, raw REST, alternate authentication, or repeated agent runs just to complete setup verification. A dedicated retrieval or debugging request can require broader investigation; preserve the user's scope.

## Single Fetch vs Search

Choose the right approach based on what you have:

| You have... | Use | Command |
|-------------|-----|---------|
| **Trace ID** | Single fetch | `mlflow traces get --trace-id <id>` |
| **Session/user/filters** | Search | `mlflow traces search --experiment-id <id> --filter-string "..."` |

**Single fetch** - Use when you have a specific trace ID (e.g., from UI, logs, or API response):
```bash
mlflow traces get --trace-id tr-69f72a3772570019f2f91b75b8b5ded9
```

**Search** - Use when you need to find traces by criteria (session, user, status, time range, etc.):
```bash
mlflow traces search --experiment-id 1 --filter-string "metadata.\`mlflow.trace.session\` = 'session_abc'"
```

---

## Trace Data Structure

- **TraceInfo**: `trace_id`, `status` (OK/ERROR), `timestamp_ms`, `execution_time_ms`, `tags`, `metadata`, `assessments` (human feedback, evaluation results)
- **Spans**: Tree of operations with `name`, `type`, `attributes`, `start_time`, `end_time`

## Workflow

1. **Check CLI usage** (required): `mlflow traces search --help`
2. **Build filter query** using syntax below
3. **Execute search** with appropriate flags
4. **Retrieve details** for specific traces if needed

## Prerequisite: Check CLI Usage

```bash
mlflow traces search --help
```

Always run this first to get accurate flags for the installed MLflow version.

## Searching Traces

The `mlflow traces search` command is used to search for traces in an MLflow experiment.

### By Run ID

Filter traces associated with a specific MLflow run:

```bash
# All traces for a run
mlflow traces search --run-id <run_id>

# Failed traces for a run
mlflow traces search --run-id <run_id> --filter-string "trace.status = 'ERROR'"

# Can combine with experiment-id
mlflow traces search --experiment-id 1 --run-id <run_id>
```

### By Session or User (Common for Debugging)

When debugging an issue from the MLflow UI, filter by session or user ID to get all related traces:

```bash
# All traces for a specific session (use backticks for special characters in key)
mlflow traces search --experiment-id 1 --filter-string "metadata.\`mlflow.trace.session\` = 'session_abc123'"

# All traces for a specific user
mlflow traces search --experiment-id 1 --filter-string "metadata.\`mlflow.trace.user\` = 'user_456'"

# Failed traces in a session (for root cause analysis)
mlflow traces search --experiment-id 1 --filter-string "metadata.\`mlflow.trace.session\` = 'session_abc123' AND trace.status = 'ERROR'"

# Session traces ordered by time (to see sequence of events)
mlflow traces search --experiment-id 1 --filter-string "metadata.\`mlflow.trace.session\` = 'session_abc123'" --order-by "timestamp_ms ASC"
```

### By Status

```bash
mlflow traces search --experiment-id 1 --filter-string "trace.status = 'ERROR'"
mlflow traces search --experiment-id 1 --filter-string "trace.status = 'OK'"
```

### By Time Range

```bash
# Timestamps are in milliseconds since epoch
# Get current time in ms: $(date +%s)000
# Last hour: $(( $(date +%s)000 - 3600000 ))

mlflow traces search --experiment-id 1 --filter-string "trace.timestamp_ms > $(( $(date +%s)000 - 3600000 ))"
```

### By Execution Time (Slow Traces)

```bash
# Traces slower than 1 second
mlflow traces search --experiment-id 1 --filter-string "trace.execution_time_ms > 1000"
```

### By Tags and Metadata

```bash
# By tag
mlflow traces search --experiment-id 1 --filter-string "tag.environment = 'production'"

# By metadata
mlflow traces search --experiment-id 1 --filter-string "metadata.user_id = 'user_123'"

# Escape special characters in key names with backticks
mlflow traces search --experiment-id 1 --filter-string "tag.\`model-name\` = 'gpt-4'"
mlflow traces search --experiment-id 1 --filter-string "metadata.\`user.id\` = 'abc'"
```

### By Assessment/Feedback

```bash
mlflow traces search --experiment-id 1 --filter-string "feedback.rating = 'positive'"
```

### Full Text Search

```bash
mlflow traces search --experiment-id 1 --filter-string "trace.text LIKE '%error%'"
```

### Pagination

Control result count and iterate through pages:

```bash
# Limit results per page
mlflow traces search --experiment-id 1 --max-results 50

# Output includes "Next page token: <token>" if more results exist
# Use --page-token to fetch next page
mlflow traces search --experiment-id 1 --max-results 50 --page-token "eyJvZmZzZXQiOiA1MH0="
```

### Output Options

```bash
# Output format (table or json)
mlflow traces search --experiment-id 1 --output json

# Include span details in output
mlflow traces search --experiment-id 1 --include-spans

# Order results
mlflow traces search --experiment-id 1 --order-by "timestamp_ms DESC"
```

## Retrieving Single Trace

When you need to retrieve details about a specific trace, use the `mlflow traces get` command.

```bash
mlflow traces get --trace-id <trace_id>
```

## Filter Syntax

For detailed syntax, fetch from documentation:
```
WebFetch(
  url: "https://mlflow.org/docs/latest/genai/tracing/search-traces.md",
  prompt: "Extract the filter syntax table showing supported fields, operators, and examples."
)
```

**Common filters:**
- `trace.status`: OK, ERROR, IN_PROGRESS
- `trace.execution_time_ms`, `trace.timestamp_ms`: numeric comparison
- `metadata.\`mlflow.trace.session\``, `metadata.\`mlflow.trace.user\``: session/user filtering
- `tag.<key>`, `metadata.<key>`: exact match or pattern
- `span.name`, `span.type`: exact match or pattern
- `feedback.<name>`, `expectation.<name>`: assessments

**Pattern operators:** `LIKE`, `ILIKE` (case-insensitive), `RLIKE` (regex)

## Python API

For `mlflow.search_traces()`, see: https://mlflow.org/docs/latest/genai/tracing/search-traces.md

© mlflow · Apache-2.0 · mlflow/skills

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

Все скиллы по теме «ИИ и ML» →
exploring-llm-traces PostHog Скилл exploring-llm-traces для Claude Code разбирает трассы LLM-агентов через инструменты PostHog MCP. Запускается по ссылке на трассу или сессию, а также при вопросах об ошибках, инструментах, контексте и расходе токенов. CX Codex +1 440установок databricks-mlflow-evaluation databricks Скилл databricks-mlflow-evaluation для запуска mlflow.genai.evaluate(), проектирования скорёров и датасетов, настройки судей через MemAlign и мониторинга качества в проде. CX Codex +1 355установок mlops-mlflow Orchestra Research Скилл mlops-mlflow учит Claude работать с MLflow: логировать параметры и метрики, вести реестр моделей и воспроизводить запуски. CX Codex +1 64установок sentry-fix-stack-traces getsentry Скилл sentry-fix-stack-traces разбирает нечитаемые кадры в Sentry: находит нужный артефакт, загружает его и проверяет результат на новом событии. CX Codex +1 1 800установок adk-debugger botpress Скилл adk-debugger для Claude Code помогает выяснить, почему ADK-агент отвечает неверно, зависает или не проходит сборку. Разбирает логи и трассировки, а также ведёт по шагам проверки после исправления. CX Codex +1 1 700установок langsmith-trace-analyzer soba-labs Скилл langsmith-trace-analyzer для Claude Code скачивает и разбирает трассы LangSmith. Он включается при отладке агентов и оценке результатов по логам запусков. CX Codex +1 ★ 106звёзд репо

Из того же набора17

Весь набор →
instrumenting-with-mlflow-tracing Скилл instrumenting-with-mlflow-tracing добавляет или чинит MLflow tracing в Python и TypeScript: автологирование фреймворков, свои спаны, проверка сохранённых трейсов. CX Codex +1 1 100установок searching-mlflow-docs Скилл searching-mlflow-docs находит официальную документацию MLflow по трейсингу и GenAI через индекс llms.txt и забирает чистые примеры кода. CX Codex +1 1 100установок agent-evaluation Скилл agent-evaluation для Claude Code: системная оценка LLM-агентов через MLflow — датасеты, скореры, трейсинг. Выявляет ошибки в выборе инструментов и неполные ответы. CX Codex +1 1 100установок analyzing-mlflow-trace Скилл analyzing-mlflow-trace разбирает один трейс MLflow по его ID: находит ошибки, объясняет поведение и указывает, где именно всё сломалось. CX Codex +1 1 000установок analyzing-mlflow-session Скилл analyzing-mlflow-session для Claude Code и Codex, разбирает сессию MLflow — цепочку трейсов одного многоходового чата. Восстанавливает разговор по шагам, когда диалог с агентом сломался и надо найти, на каком ходу. CX Codex +1 966установок querying-mlflow-metrics Скилл querying-mlflow-metrics для Claude Code тянет агрегированные метрики трейсов из MLflow: расход токенов, задержки, число трейсов и оценки качества. Смотрит статистику эксперимента прямо из чата. CX Codex +1 959установок mlflow-agent Маршрутизирует задачи по MLflow к нужному скиллу: от трассировки и оценки до разбора сбоев агента. Подходит для запросов без выбранного сценария. CX Codex +1 882установок sagemaker-mlflow Скилл sagemaker-mlflow подключает агента к SageMaker Managed MLflow по ARN ресурса (mlflow-app или mlflow-tracking-server), после чего передаёт управление другим MLflow-скиллам через MLFLOW_TRACKING_URI. CX Codex +1 394установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой