Установка
SKILL.md
Arize Instrumentation Skill
Use this skill when the user wants to add Arize AX tracing to their application. Follow the two-phase, agent-assisted flow from the Agent-Assisted Tracing Setup and the Arize AX Tracing — Agent Setup Prompt.
Quick start (for the user)
If the user asks you to "set up tracing" or "instrument my app with Arize", you can start with:
Follow the instructions from https://arize.com/docs/PROMPT.md and ask me questions as needed.
Then execute the two phases below.
Core principles
- Prefer inspection over mutation — understand the codebase before changing it.
- Do not change business logic — tracing is purely additive.
- Use auto-instrumentation where available — add manual spans only for custom logic not covered by integrations.
- Follow existing code style and project conventions.
- Keep output concise and production-focused — do not generate extra documentation or summary files.
- NEVER embed literal credential values in generated code — always reference environment variables (e.g.,
os.environ["ARIZE_API_KEY"],process.env.ARIZE_API_KEY). This includes API keys, space IDs, and any other secrets. The user sets these in their own environment; the agent must never output raw secret values.
Phase 0: Environment preflight
Before changing code:
- Confirm the repo/service scope is clear. For monorepos, do not assume the whole repo should be instrumented.
- Identify the local runtime surface you will need for verification:<!-- -->
- package manager and app start command
- whether the app is long-running, server-based, or a short-lived CLI/script
- whether
axwill be needed for post-change verification
- Do NOT proactively check
axinstallation or version. Ifaxis needed for verification later, just run it when the time comes. If it fails, see references/ax-profiles.md. - Never silently replace a user-provided space ID, project name, or project ID. If the CLI, collector, and user input disagree, surface that mismatch as a concrete blocker.
Phase 1: Analysis (read-only)
Do not write any code or create any files during this phase.
Steps
-
Check dependency manifests to detect stack:
- Python:
pyproject.toml,requirements.txt,setup.py,Pipfile - TypeScript/JavaScript:
package.json - Java:
pom.xml,build.gradle,build.gradle.kts - Go:
go.mod
- Python:
-
Scan import statements in source files to confirm what is actually used.
-
Check for existing tracing/OTel — look for
TracerProvider,register(),opentelemetryimports,ARIZE_*,OTEL_*,OTLP_*env vars, or other observability config (Datadog, Honeycomb, etc.). -
Identify scope — for monorepos or multi-service projects, ask which service(s) to instrument.
What to identify
| Item | Examples |
|---|---|
| Language | Python, TypeScript/JavaScript, Java, Go |
| Package manager | pip/poetry/uv, npm/pnpm/yarn, maven/gradle, go modules |
| LLM providers | OpenAI, Anthropic, LiteLLM, Bedrock, etc. |
| Frameworks | LangChain, LangGraph, LlamaIndex, Vercel AI SDK, Mastra, etc. |
| Existing tracing | Any OTel or vendor setup |
| Tool/function use | LLM tool use, function calling, or custom tools the app executes (e.g. in an agent loop) |
Key rule: When a framework is detected alongside an LLM provider, inspect the framework-specific tracing docs first and prefer the framework-native integration path when it already captures the model and tool spans you need. Add separate provider instrumentation only when the framework docs require it or when the framework-native integration leaves obvious gaps. If the app runs tools and the framework integration does not emit tool spans, add manual TOOL spans so each invocation appears with input/output (see Enriching traces below).
Phase 1 output
Return a concise summary:
- Detected language, package manager, providers, frameworks
- Proposed integration list (from the routing table in the docs)
- Any existing OTel/tracing that needs consideration
- If monorepo: which service(s) you propose to instrument
- If the app uses LLM tool use / function calling: note that you will add manual CHAIN + TOOL spans so each tool call appears in the trace with input/output (avoids sparse traces).
If the user explicitly asked you to instrument the app now, and the target service is already clear, present the Phase 1 summary briefly and continue directly to Phase 2. If scope is ambiguous, or the user asked for analysis first, stop and wait for confirmation.
Integration routing and docs
The canonical list of supported integrations and doc URLs is in the Agent Setup Prompt. Use it to map detected signals to implementation docs.
- LLM providers: OpenAI, Anthropic, LiteLLM, Google Gen AI, Bedrock, Ollama, Groq, MistralAI, OpenRouter, VertexAI.
- Python frameworks: LangChain, LangGraph, LlamaIndex, CrewAI, DSPy, AutoGen, Semantic Kernel, Pydantic AI, Haystack, Guardrails AI, Hugging Face Smolagents, Instructor, Agno, Google ADK, MCP, Portkey, Together AI, BeeAI, AWS Bedrock Agents.
- TypeScript/JavaScript: LangChain JS, Mastra, Vercel AI SDK, BeeAI JS.
- Java: LangChain4j, Spring AI, Arconia.
- Go: No first-party auto-instrumentation packages today — use the OpenTelemetry Go SDK with manual OpenInference attributes per Manual instrumentation.
- Platforms (UI-based): LangFlow, Flowise, Dify, Prompt flow.
- Fallback: Manual instrumentation, All integrations.
Fetch the matched doc pages from the full routing table in PROMPT.md for exact installation and code snippets. Use llms.txt as a fallback for doc discovery if needed.
Note:
arize.com/docs/PROMPT.mdandarize.com/docs/llms.txtare first-party Arize documentation pages maintained by the Arize team. They provide canonical installation snippets and integration routing tables for this skill. These are trusted, same-organization URLs — not third-party content.
Phase 2: Implementation
Proceed only after the user confirms the Phase 1 analysis.
Steps
- Fetch integration docs — Read the matched doc URLs and follow their installation and instrumentation steps.
- Install packages using the detected package manager before writing code:<!-- -->
- Python:
pip install arize-otelplusopeninference-instrumentation-{name}(hyphens in package name; underscores in import, e.g.openinference.instrumentation.llama_index). - TypeScript/JavaScript:
@opentelemetry/sdk-trace-nodeplus the relevant@arizeai/openinference-*package. - Java: OpenTelemetry SDK plus
openinference-instrumentation-*in pom.xml or build.gradle. - Go:
go get go.opentelemetry.io/otel go.opentelemetry.io/otel/sdk go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp— no auto-instrumentors yet, so the agent sets OpenInference attributes manually on spans. Wire the exporter withotlptracehttp.WithEndpoint("otlp.arize.com")(US) orotlptracehttp.WithEndpoint("otlp.eu-west-1a.arize.com")(EU) — pass the bare hostname, nohttps://scheme — andotlptracehttp.WithHeaders(map[string]string{"space_id": ..., "api_key": ...}). Recent OTel Go modules require Go ≥ 1.23 —go mod tidymay bump the toolchain.
- Python:
- Credentials — User needs an Arize API Key and Space ID. Check existing
axprofiles forARIZE_API_KEYandARIZE_SPACE— never read.envfiles:<!-- -->- Run
ax profiles showto check for an existing profile. - If no profile exists, guide the user to run
ax profiles createwhich provides an interactive wizard that walks through API key and space setup. See CLI profiles docs for details. - If the user needs to find their API key manually, direct them to https://app.arize.com and to navigate to the settings page (do not use organization-specific URLs with placeholder IDs — they won't resolve for new users).
- If credentials are not set, instruct the user to set them as environment variables — never embed raw values in generated code. All generated instrumentation code must reference
os.environ["ARIZE_API_KEY"](Python),process.env.ARIZE_API_KEY(TypeScript/JavaScript), oros.Getenv("ARIZE_API_KEY")(Go). - See references/ax-profiles.md for full profile setup and troubleshooting.
- Run
- Centralized instrumentation — Create a single module (e.g.
instrumentation.py,instrumentation.ts,instrumentation.go) and initialize tracing before any LLM client is created. - Existing OTel — If there is already a TracerProvider, add Arize as an additional exporter (e.g. BatchSpanProcessor with Arize OTLP). Do not replace existing setup unless the user asks.
Implementation rules
- Use auto-instrumentation first; manual spans only when needed.
- Prefer the repo's native integration surface before adding generic OpenTelemetry plumbing. If the framework ships an exporter or observability package, use that first unless there is a documented gap.
- Fail gracefully if env vars are missing (warn, do not crash).
- Import order: register tracer → attach instrumentors → then create LLM clients.
- Project name attribute (required): Arize rejects spans with HTTP 500 if the project name is missing —
service.namealone is not accepted. Set it as a resource attribute on the TracerProvider (recommended — one place, applies to all spans):<!-- -->- Python:
register(project_name="my-app")handles it automatically (sets"openinference.project.name"on the resource). For routing spans to different projects, useset_routing_context(space_id=..., project_name=...)fromarize.otel. - TypeScript: Arize accepts both
"model_id"(shown in the official TS quickstart) and"openinference.project.name"viaSEMRESATTRS_PROJECT_NAMEfrom@arizeai/openinference-semantic-conventions(shown in the manual instrumentation docs) — both work. - Go: Pass
attribute.String("openinference.project.name", "my-app")toresource.New(...)and apply viasdktrace.WithResource(res). The Go SDK has no helper for this, so it must be set manually on every TracerProvider.
- Python:
- CLI/script apps — flush before exit:
provider.shutdown()(TS) /provider.force_flush()thenprovider.shutdown()(Python) /tp.Shutdown(ctx)(Go) must be called before the process exits, otherwise async OTLP exports are dropped and no traces appear. - When the app has tool/function execution: add manual CHAIN + TOOL spans (see Enriching traces below) so the trace tree shows each tool call and its result — otherwise traces will look sparse (only LLM API spans, no tool input/output).
Enriching traces: manual spans for tool use and agent loops
Why doesn't the auto-instrumentor do this?
Provider instrumentors (Anthropic, OpenAI, etc.) only wrap the LLM client — the code that sends HTTP requests and receives responses. They see:
- One span per API call: request (messages, system prompt, tools) and response (text, tool_use blocks, etc.).
They cannot see what happens inside your application after the response:
- Tool execution — Your code parses the response, calls
run_tool("check_loan_eligibility", {...}), and gets a result. That runs in your process; the instrumentor has no hook into yourrun_tool()or the actual tool output. The next API call (sending the tool result back) is just anothermessages.createspan — the instrumentor doesn't know that the message content is a tool result or what the tool returned. - Agent/chain boundary — The idea of "one user turn → multiple LLM calls + tool calls" is an application-level concept. The instrumentor only sees separate API calls; it doesn't know they belong to the same logical "run_agent" run.
So TOOL and CHAIN spans have to be added manually (or by a framework instrumentor like LangChain/LangGraph that knows about tools and chains). Once you add them, they appear in the same trace as the LLM spans because they use the same TracerProvider.
To avoid sparse traces where tool inputs/outputs are missing:
- Detect agent/tool patterns: a loop that calls the LLM, then runs one or more tools (by name + arguments), then calls the LLM again with tool results.
- Add manual spans using the same TracerProvider (e.g.
opentelemetry.trace.get_tracer(...)afterregister()):<!-- -->- CHAIN span — Wrap the full agent run (e.g.
run_agent): setopeninference.span.kind="CHAIN",input.value= user message,output.value= final reply. - TOOL span — Wrap each tool invocation: set
openinference.span.kind="TOOL",input.value= JSON of arguments,output.value= JSON of result. Use the tool name as the span name (e.g.check_loan_eligibility).
- CHAIN span — Wrap the full agent run (e.g.
OpenInference attributes (use these so Arize shows spans correctly):
| Attribute | Use |
|---|---|
openinference.span.kind | Pick the right value: "LLM" for raw provider API calls (OpenAI, Anthropic, etc.); "CHAIN" for orchestration / agent-loop boundaries; "TOOL" for tool/function execution; "RETRIEVER" for vector-store / search lookups; "EMBEDDING" for embedding API calls; "AGENT" for an autonomous sub-agent run nested inside a larger chain; "RERANKER" for rerank API calls; "GUARDRAIL" for guardrail/policy checks; "EVALUATOR" for online eval calls. |
input.value | string (e.g. user message or JSON of tool args) |
output.value | string (e.g. final reply or JSON of tool result) |
LLM-span attributes (set these in addition to the three above when the span is an actual LLM call):
| Attribute | Use |
|---|---|
llm.model_name | model identifier (e.g. "gpt-4o-mini") |
llm.provider / llm.system | provider name (e.g. "openai", "anthropic") |
llm.input_messages.{i}.message.role | "system" / "user" / "assistant" / "tool" для i-го входного сообщения |
llm.input_messages.{i}.message.content | текстовое содержимое i-го входного сообщения |
llm.output_messages.{i}.message.role | роль i-го выходного сообщения |
llm.output_messages.{i}.message.content | текстовое содержимое i-го выходного сообщения |
llm.token_count.prompt | int — токены промпта/входа |
llm.token_count.completion | int — токены завершения/выхода |
llm.token_count.total | int — всего токенов |
В Python и TypeScript эти имена доступны через openinference-semantic-conventions пакеты; в Go их нужно вводить вручную как строки выше.
Шаблон Python: Получите глобальный tracer (тот же провайдер, что и Arize), затем используйте контекстные менеджеры, чтобы спаны инструментов были дочерними по отношению к спану CHAIN и появлялись в том же трейсе, что и спаны LLM:
from opentelemetry.trace import get_tracer
tracer = get_tracer("my-app", "1.0.0")
# In your agent entrypoint:
with tracer.start_as_current_span("run_agent") as chain_span:
chain_span.set_attribute("openinference.span.kind", "CHAIN")
chain_span.set_attribute("input.value", user_message)
# ... LLM call ...
for tool_use in tool_uses:
with tracer.start_as_current_span(tool_use["name"]) as tool_span:
tool_span.set_attribute("openinference.span.kind", "TOOL")
tool_span.set_attribute("input.value", json.dumps(tool_use["input"]))
result = run_tool(tool_use["name"], tool_use["input"])
tool_span.set_attribute("output.value", result)
# ... append tool result to messages, call LLM again ...
chain_span.set_attribute("output.value", final_reply)
Шаблон Go: Получите tracer из глобального TracerProvider (зарегистрированного через otel.SetTracerProvider), затем вложите спаны с помощью tracer.Start чтобы спаны инструментов стали дочерними по отношению к спану CHAIN.
Критично для короткоживущих процессов: никогда не вызывайте
log.Fatalf/os.Exitпосле запуска спана — они пропускают отложенныйtp.Shutdown(ctx)и активные спаны CHAIN/LLM так и не сбрасываются. Используйтеlog.Printf+returnизmainвместо этого, и держитеtp.Shutdown(ctx)отложенным в началеmain.
import (
"context"
"encoding/json"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
)
var tracer = otel.Tracer("my-app")
func runAgent(ctx context.Context, userMessage string) string {
ctx, chainSpan := tracer.Start(ctx, "run_agent")
defer chainSpan.End()
chainSpan.SetAttributes(
attribute.String("openinference.span.kind", "CHAIN"),
attribute.String("input.value", userMessage),
)
// ... LLM call ...
for _, toolUse := range toolUses {
ctx, toolSpan := tracer.Start(ctx, toolUse.Name)
argsJSON, err := json.Marshal(toolUse.Input)
if err != nil {
toolSpan.RecordError(err)
}
toolSpan.SetAttributes(
attribute.String("openinference.span.kind", "TOOL"),
attribute.String("input.value", string(argsJSON)),
)
result := runTool(toolUse.Name, toolUse.Input)
toolSpan.SetAttributes(attribute.String("output.value", result))
toolSpan.End()
// ... append tool result to messages, call LLM again ...
}
chainSpan.SetAttributes(attribute.String("output.value", finalReply))
return finalReply
}
См. Manual instrumentation для других видов спанов и атрибутов.
Проверка
Считайте инструментирование завершённым только когда выполнены все следующие условия:
- Приложение по-прежнему собирается или проходит проверку типов после изменения трассировки.
- Приложение успешно запускается с новой конфигурацией трассировки.
- Вы вызываете хотя бы один реальный запрос или запуск, который должен порождать спаны.
- Вы либо проверяете полученный трейс в Arize, либо предоставляете точную блокировку, отличающую успех на стороне приложения от сбоя на стороне Arize.
После реализации:
- Запустите приложение и вызовите хотя бы один вызов LLM.
- Используйте
arize-traceнавык чтобы подтвердить, что трейсы поступили. Если пусто, повторите попытку вскоре. Убедитесь, что спаны имеют ожидаемыеopeninference.span.kind,input.value/output.value, и связи родитель-потомок. - Если трейсов нет: проверьте
ARIZE_SPACEиARIZE_API_KEY, убедитесь, что tracer инициализирован до инструментаторов и клиентов, проверьте подключение кotlp.arize.com:443, и изучите логи экспортёра приложения/среды выполнения, чтобы понять, испускаются ли спаны локально, но отклоняются удалённо. Для отладки установитеGRPC_VERBOSITY=debugили передайтеlog_to_console=Truetoregister(). Частые ошибки: (a) отсутствие атрибута ресурса с именем проекта вызывает отклонения HTTP 500 —service.nameсамого по себе недостаточно; Python: передайтеproject_nametoregister(); TypeScript: установите"model_id"orSEMRESATTRS_PROJECT_NAMEна ресурсе; Go: добавьтеattribute.String("openinference.project.name", "my-app")toresource.New(...); (b) процессы CLI/скриптов завершаются до сброса экспортов OTLP — вызовитеprovider.force_flush()затемprovider.shutdown()(Python/TS) илиtp.Shutdown(ctx)(Go) перед выходом; (c) видимые в CLI пространства/проекты могут не совпадать с ID пространства, на которое нацелен коллектор — сообщите о несоответствии вместо молчаливого перезаписывания учётных данных. - Если приложение использует инструменты: убедитесь, что спаны CHAIN и TOOL появляются с
input.value/output.valueчтобы вызовы инструментов и результаты были видны.
Когда проверка заблокирована проблемами CLI или учётной записи, завершите конкретным статусом:
- статус инструментирования приложения
- последний локальный ID трейса или ID запуска
- показывают ли логи экспортёра локальное испускание спанов
- является ли сбой проблемой учётных данных, разрешения пространства/проекта, сети или отклонения коллектором
Использование Tracing Assistant (MCP)
Для более глубокого руководства по инструментированию внутри IDE пользователь может включить:
- Arize AX Tracing Assistant MCP — руководства по инструментированию, примеры фреймворков и поддержка. В Cursor: Settings → MCP → Add и используйте:<!-- -->
"arize-tracing-assistant": { "command": "uvx", "args": ["arize-tracing-assistant@latest"] } - Arize AX Docs MCP — документация с поиском. В Cursor:<!-- -->
"arize-ax-docs": { "url": "https://arize.com/docs/mcp" }
Затем пользователь может спрашивать, например: "Инструментируй это приложение с помощью Arize AX", "Можешь использовать ручное инструментирование, чтобы у меня было больше контроля над трейсами?", "Как я могу скрыть конфиденциальную информацию из своих спанов?"
См. полную настройку в Agent-Assisted Tracing Setup.
Ссылки для справки
| Ресурс | URL |
|---|---|
| Agent-Assisted Tracing Setup | https://arize.com/docs/ax/alyx/tracing-assistant |
| Agent Setup Prompt (full routing + phases) | https://arize.com/docs/PROMPT.md |
| Arize AX Docs | https://arize.com/docs/ax |
| Full integration list | https://arize.com/docs/ax/integrations |
| Doc index (llms.txt) | https://arize.com/docs/llms.txt |
Save Credentials for Future Use
См. references/ax-profiles.md § Save Credentials for Future Use.
Вставить в README
Ссылка на карточку для вашего README — без картинок и счётчиков.
[DarkPlay: arize-instrumentation](https://darkplay.ru/ai/skills/github-awesome-copilot-arize-instrumentation)
Описание
Добавляет трассировку Arize AX в LLM-приложение впервые. Следует двухфазному процессу с участием агента: сначала анализ кодовой базы, затем внедрение инструментации после подтверждения пользователем. Используй, когда пользователь хочет инструментировать приложение, добавить трассировку с нуля, настроить наблюдаемость LLM, интегрировать OpenTelemetry или openinference либо начать работу с трассировкой Arize.
Из того же репозитория
Похожие скиллы и другие разделы каталога
Самые востребованные скиллов раздела по установкам и звёздам.
find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.Соседние разделы каталога: возможно, нужный инструмент живёт там.
boxanthropics · Работа с контентом Box прямо из Claude Code — поиск файлов, организация папок, совместная…
honeycombanthropics · Навыки, агенты и рабочие процессы для наблюдаемости Honeycomb: шаблоны запросов, разбо�…
logfireanthropics · Добавляет наблюдаемость Logfire в Python-приложения с автоинструментацией для FastAPI…
rememberanthropics · Непрерывная память для Claude Code: извлекает, суммирует и сжимает диалоги в…
boxanthropics · Работа с контентом Box прямо из Claude Code — поиск файлов, организация папок, совместная…
honeycombanthropics · Навыки, агенты и рабочие процессы для наблюдаемости Honeycomb: шаблоны запросов…
product-tracking-skillsanthropics · Навыки AI-агента, которые готовят данные SaaS-продуктов к продуктовой аналитике — от…
product-skillsalirezarezvani · 13 продуктовых навыков с 22 Python-инструментами: fork-orchestrator с циклом continuous…
research-summarizeralirezarezvani · Структурированное резюмирование исследований: научные статьи, маркетинговые исследования…
waza-readtw93 · Читает URL и PDF, извлекая содержимое: краткие сводки по умолчанию и чистый Markdown при…Лучшие ИИ-инструменты для программирования
Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные
GenAPIGenapi
Notepad++ AINotepad-plus-plus
Creatium MaxCremax
Emacs AIGnu
KiteKite
Amazon Q DeveloperAmazonЛучшие ИИ-инструменты для автоматизации и ассистентов
Подборка ИИ-ассистентов для автоматизации рутины и ускорения рабочих процессов. Сервисы, которые берут на себя переписку, анализ данных, ведение базы знаний и подготовку продаж, эк
Give Me Public
AITunnelAitunnel
STIVAStiva
Wikibot (Викибот)Wikibot
mymeet.aiMymeet
InsighterInsighter
TGHuntTghunt
LegiscanLegiscan
RouterAIRouterai
Wikibot 1.0 (Викибот)WikibotЛучшие ИИ-инструменты для генерации видео
Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,
VEED.IOVeed
MootionMootion
Sora (OpenAI)OpenAI
viralpulse.appViralpulse
Viral Maker AIViral-maker