/arize-skills:arize-span-routingfrom arize-skills
Routes OpenTelemetry spans from a single Python service to the correct Arize space and project based on application metadata. For multi-tenant apps and custom agent builders.
Ships in arize-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill to send each traced operation from one Python service to its correct Arize space and project. Each operation must resolve to exactly one space_id and project_name before its first span starts.
Do not use this skill for ordinary single-project tracing; use arize-instrumentation. This skill does not reroute spans after export, backfill historical spans, create Arize spaces/projects, or invent a customer-specific metadata mapping.
ARIZE_API_KEY from the environment.Read only until the routing contract is clear.
space_idproject_nameInspect only the target app's configuration. Do not search unrelated repositories, sibling services, shell startup files, or arbitrary .env files for credentials.
If service scope, metadata fields, mapping source, or destination behavior is ambiguous, stop and ask the minimum question needed. Do not install packages or edit code first. If the user requested implementation and all four are clear, summarize the contract briefly and continue.
Use the project's package manager to require arize-otel>=0.11.0. Do not change unrelated dependencies.
For an app without an existing OpenTelemetry provider, initialize routing before instrumentors and LLM clients:
import os
from arize.otel import register_with_routing
tracer_provider = register_with_routing(
api_key=os.environ["ARIZE_API_KEY"],
)
If the app already owns a provider with non-Arize telemetry, keep it and add the routing processor:
import os
from arize.otel import ArizeRoutingSpanProcessor, Endpoint, Transport
tracer_provider.add_span_processor(
ArizeRoutingSpanProcessor(
api_key=os.environ["ARIZE_API_KEY"],
endpoint=Endpoint.ARIZE,
transport=Transport.GRPC,
)
)
Reuse the app's configured endpoint and transport when present. Never call register_with_routing after another global provider has already been installed. If the provider also has a fixed Arize processor/exporter, remove that fixed path in its initialization before adding routing; OpenTelemetry processors cannot be safely removed after startup.
Adapt the app's existing metadata model; do not introduce a framework for one lookup. The resolver must return both non-empty values or no target. Keep mapping data in its existing source of truth rather than duplicating it in tracing code.
from dataclasses import dataclass
@dataclass(frozen=True)
class RoutingTarget:
space_id: str
project_name: str
Use this type only when the codebase lacks an equivalent. Validate the result before any traced work begins.
Enter routing context at the highest boundary that has the metadata and encloses every child span:
Replace RoutingLookupError below with the resolver's specific existing lookup/configuration exception.
from opentelemetry import context as context_api
from arize.otel import set_routing_context
def run_without_arize_routing(request):
token = context_api.attach(context_api.Context())
try:
return run_agent(request)
finally:
context_api.detach(token)
def handle_agent_request(request):
try:
target = resolve_routing_target(request.agent_metadata)
except RoutingLookupError:
logger.warning("Arize routing lookup failed; spans will not be exported")
return run_without_arize_routing(request)
if target is None or not target.space_id or not target.project_name:
logger.warning("No Arize routing target; spans will not be exported")
return run_without_arize_routing(request)
with set_routing_context(
space_id=target.space_id,
project_name=target.project_name,
):
return run_agent(request)
Catch only the resolver's expected lookup/configuration exceptions; do not hide unrelated application failures. A fresh context on the no-target path intentionally prevents inherited routing values from reaching Arize. It may start a new trace for other exporters; tenant isolation takes priority. If preserving the distributed parent is mandatory, report the missing public routing-clear API as an SDK follow-up rather than using private context keys.
All auto-instrumented and manual child spans created inside the routing context inherit arize.space_id and arize.project.name. Do not set routing after spans have started.
For background work, propagate the OpenTelemetry context explicitly or resolve and enter a new routing context in the worker. Never rely on request-local context after a queue or thread boundary.
See references/REFERENCE.md for agent experiment endpoints, existing-provider details, concurrency rules, testing, verification, and troubleshooting.
arize-trace with the same credential context to confirm each trace exists only in its intended destination.For short-lived scripts, call force_flush() and shutdown() before exit. Finish as confirmed, confirmed with warnings, or a precise blocker; never report completion from unit tests alone when live verification was requested.
ArizeRoutingSpanProcessor creates and caches one processor per unique space. Flag unbounded or high-cardinality space IDs before implementation.arize-otel capability, stop and propose a separate SDK change instead of adding a compatibility hack.arize-instrumentation: first-time or single-destination tracingarize-trace: post-export verification and debuggingarize-admin: inspect or manage authorized spaces and API keysWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub arize-ai/arize-skills --plugin arize-skills18 skills in this plugin
/arize-adminManages Arize users, organizations, spaces, projects, roles, role bindings, resource restrictions, and API keys via the ax CLI. Use for enterprise admin workflows: inviting and offboarding users, onboarding new teams, creating custom roles for SAML/SSO mappings, assigning roles to users, restricting project-level access, and managing service keys for multi-tenant architectures. Covers ax users, ax organizations, ax spaces, ax projects, ax roles, ax role-bindings, and ax api-keys./arize-ai-provider-integrationCreates, reads, updates, and deletes Arize AI integrations that store LLM provider credentials used by evaluators and other Arize features. Supports the LLM providers in the `--provider` enum (e.g. OpenAI, Anthropic, Azure OpenAI, AWS Bedrock, Vertex AI, Gemini, NVIDIA NIM, Fireworks AI, Together AI, DeepSeek). Use when the user mentions AI integration, LLM provider credentials, create integration, list integrations, update credentials, delete integration, or connecting an LLM provider to Arize./arize-annotationCreates and manages annotation configs (categorical, continuous, freeform label schemas) and annotation queues (human review workflows) on Arize. Applies human annotations to project spans via the Python SDK. Use when the user mentions annotation config, annotation queue, label schema, human feedback, bulk annotate spans, update_annotations, labeling queue, annotate record, or human review.Other plugins' skills for the same job