一键导入
integrate-tracing
Orchestrates end-to-end MLflow tracing integration into an agent template, coordinating all sub-skills from research through verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Orchestrates end-to-end MLflow tracing integration into an agent template, coordinating all sub-skills from research through verification.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Deploy agents to OpenShift with auto-detected cluster config and refresh MLflow tracking tokens.
Add integration deployment tests (health-check on OpenShift) to any agent in the agentic-starter-kits repo — standard, external-registry, or pre-deployed. Creates conftest.py, test_deployment.py, __init__.py, adds test-integration Makefile target, and updates the CI workflow matrix. Use when implementing integration tests, deployment tests, or health-check tests for a new agent.
Validate whether a new agent template or example belongs in the agentic-starter-kits repo. Two modes: idea mode (interactive questionnaire, no code yet) or existing agent mode (auto-extract from code). Produces a GitHub Discussion draft with fit score and recommendations. Use when proposing a new agent, reviewing an existing contribution's fit, or before writing code for a new template.
Add behavioral testing (pytest + EvalHub) to an agent in the agentic-starter-kits repo. Covers runner compatibility, test files, golden queries, thresholds, EvalHub fixture, Containerfile, docs, and MLflow tracing verification. Use when implementing behavioral tests for a new agent or when the user mentions btest, behavioral tests, eval coverage, or test harness integration.
Adds manual MLflow trace wrapping for tool and agent spans in Level B and C agents where autolog doesn't cover everything.
Researches and classifies a framework's MLflow autolog support level (A, B, or C) to determine what manual tracing is needed.
| name | integrate-tracing |
| description | Orchestrates end-to-end MLflow tracing integration into an agent template, coordinating all sub-skills from research through verification. |
| argument-hint | <framework> <agent_path> |
Usage:
/integrate-tracing <framework> <agent_path>Example:/integrate-tracing autogen agents/autogen/chat_agent
You are integrating MLflow tracing into a new agent template in this repository. This is the orchestrator skill that coordinates the full end-to-end process by following a structured sequence of steps, deferring to reference skills for each step.
The framework name and agent path are: $ARGUMENTS
Expected format: <framework> <agent_path>
Example: autogen agents/autogen/chat_agent
If either is missing, ask the user for both.
Read tracing.md at the repo root for full context on the tracing architecture, design principles, and how the existing four agents integrate with MLflow. This is essential background.
IMPORTANT: You must follow these steps in exact sequential order (1 → 2 → 3 → ... → 10). Do not skip ahead, reorder, or combine steps. Each step depends on the output of previous steps — especially the autolog report from Step 1, which drives decisions in Steps 4, 5, 6, and 7. Complete each step fully before moving to the next.
IMPORTANT: Always create a demo agent first (Step 2) and implement all tracing and testing on the demo copy (Steps 3–7). Only after everything works correctly on the demo — traces land in MLflow, spans are correct, both streaming and non-streaming paths are verified — apply the same changes to the actual agent template (Steps 4–9). Never modify the real agent template until the demo is fully working.
Goal: Determine what MLflow autolog covers for this framework.
Invoke the check-autolog-support skill (i.e., /agentic-starter-kits-skills:check-autolog-support) with the framework name. This will produce an autolog support report classifying the framework as:
Save the report — it drives all subsequent decisions.
Goal: Create a working demo copy of the agent for testing tracing before modifying the actual agent.
agents/demo/<framework>_<agent_name>_demo/search_knowledge_base(query) — looks up a hardcoded knowledge base dictsearch_price(brand) — returns "Price of {brand} is $400"search_reviews(brand) — returns "Reviews of {brand} are good"current_time() — returns current datetimecalculate(query) — evaluates a math expression__init__.py or equivalent) to include all new tools.env file with OpenAI credentials and MLflow config for local testingmain.py so it can run with dummy tools when the dependency is unavailableThis step is critical — without proper tools, you cannot verify that tool spans appear in traces.
Goal: Map the agent's architecture before making changes.
Read these files in the agent directory:
README.md — What the agent does, its architecture, tools, and any framework-specific detailsmain.py — FastAPI app, lifespan, _handle_chat, _handle_streamsrc/<package>/agent.py — Agent class/factory, how tools are registeredsrc/<package>/tools.py — Tool definitionspyproject.toml — Package name and dependenciesIdentify:
pyproject.toml or src/ directory)Goal: Create tracing.py with the correct pattern for this framework.
Invoke the create-tracing-module skill (i.e., /agentic-starter-kits-skills:create-tracing-module), providing:
This creates src/<package>/tracing.py with:
enable_tracing() with framework autolog onlyenable_tracing() with framework + provider autolog, plus wrap_func_with_mlflow_trace()enable_tracing() with provider autolog only, plus wrap_func_with_mlflow_trace()Goal: Connect tracing to the app startup.
Invoke the wire-into-lifespan skill (i.e., /agentic-starter-kits-skills:wire-into-lifespan), providing:
This adds the import and enable_tracing() call to main.py.
Goal: Wrap tools and agent entry points with trace spans where autolog doesn't cover.
Skip this step entirely for Level A — autolog handles everything.
For Level B or C, invoke the add-manual-tracing skill (i.e., /agentic-starter-kits-skills:add-manual-tracing), providing:
This adds wrap_func_with_mlflow_trace() calls for:
span_type="tool"span_type="agent"Goal: Confirm traces land correctly in MLflow.
Invoke the verify-traces skill (i.e., /agentic-starter-kits-skills:verify-traces), which in turn invokes review-tracing-code and test-tracing. You must do everything hands-on — install MLflow if needed, start the MLflow server, start the agent, send requests, query the MLflow API, inspect spans. Do NOT stop here and tell the user to test manually. Do NOT summarize what the user should do. Execute it all yourself.
After verification, always report these three values to the user:
http://localhost:5000)agentic-rag-experiment)"How much does a Lenovo laptop cost?")If verification fails, the report will indicate which step to revisit.
Goal: Ensure make run auto-installs MLflow when MLFLOW_TRACKING_URI is set.
In the agent's Makefile, add $${MLFLOW_TRACKING_URI:+--extra tracing} to the uv run command in the run target (and run-cli if it exists). For example:
run:
@set -a && source .env && set +a && \
uv run $${MLFLOW_TRACKING_URI:+--extra tracing} uvicorn main:app --host 127.0.0.1 --port $${PORT:-8000} --reload --reload-exclude .venv
This bash parameter expansion adds --extra tracing only when MLFLOW_TRACKING_URI is set, which tells uv run to install the tracing optional dependency from pyproject.toml.
Goal: Add MLflow environment variables to .env.example so users know which variables to configure.
Add the following sections to the agent's .env.example file (if not already present):
# LOCAL TRACING
# MLFLOW_TRACKING_URI=
# MLFLOW_EXPERIMENT_NAME=
# MLFLOW_HEALTH_CHECK_TIMEOUT= # (default is 5s)
# MLFLOW_HTTP_REQUEST_TIMEOUT= # (default is 120s)
# MLFLOW_HTTP_REQUEST_MAX_RETRIES=
## OPENSHIFT CLUSTER TRACING
# Openshift Cluster
# MLFLOW_TRACKING_URI=
# MLFLOW_TRACKING_TOKEN=
# MLFLOW_EXPERIMENT_NAME=
# MLFLOW_TRACKING_INSECURE_TLS=
# MLFLOW_WORKSPACE=
# MLFLOW_TRACKING_AUTH= # Use Kubernetes service account for authentication (if running inside the cluster)
Goal: Document tracing setup for both local and OpenShift deployments.
Find an existing agent README that already has a ### Tracing (optional) section and use it as a reference for structure, content, and tone. Add a ### Tracing (optional) section to the new agent's README.md with:
MLFLOW_TRACKING_URI, MLFLOW_EXPERIMENT_NAME, MLFLOW_HTTP_REQUEST_TIMEOUT, MLFLOW_HTTP_REQUEST_MAX_RETRIES)uv run --extra tracing mlflow server --port 5000make run (or equivalent) will automatically install the tracing dependency when MLFLOW_TRACKING_URI is setMLFLOW_TRACKING_URI, MLFLOW_TRACKING_TOKEN, MLFLOW_EXPERIMENT_NAME, MLFLOW_TRACKING_INSECURE_TLS, MLFLOW_WORKSPACE)MLFLOW_TRACKING_URI is not set, the app runs without tracingMLFLOW_HEALTH_CHECK_TIMEOUT controls wait time (default: 5s)Place the section where it makes sense in the README's flow — typically as part of the .env configuration phase, before the environment setup or run steps. Do not use a fixed position; adapt to the README's existing structure.
Goal: Ensure containerized deployments include MLflow.
If the agent has a Dockerfile, make sure the package install step includes the tracing extra (e.g., ".[tracing]" instead of ".").
Without this, deployed agents with MLFLOW_TRACKING_URI set will fail at startup because mlflow won't be installed.
All files that must be created or updated when integrating tracing:
| # | File | Action | Description |
|---|---|---|---|
| 1 | src/<package>/tracing.py | Create | enable_tracing(), health check, autolog, wrap_func_with_mlflow_trace() (Level B/C) |
| 2 | main.py | Edit | Import enable_tracing, call it first in lifespan() |
| 3 | main.py | Edit (Level B/C only) | Import wrap_func_with_mlflow_trace, wrap tools/agent entry points |
| 4 | .env.example | Edit | Add local + OpenShift MLflow variable sections |
| 5 | README.md | Edit | Add local tracing config, OpenShift tracing config, MLflow server start |
| 6 | pyproject.toml | Edit | Add tracing = ["mlflow>=3.10.0"] to [project.optional-dependencies] |
| 7 | Makefile | Edit | Add $${MLFLOW_TRACKING_URI:+--extra tracing} to uv run in run and run-cli targets |
| 8 | Dockerfile | Edit | Change "." to ".[tracing]" in uv pip install line |
| Step | Skill | Level A | Level B | Level C |
|---|---|---|---|---|
| 1. Check autolog | check-autolog-support | Run | Run | Run |
| 2. Create demo agent | (inline) | Run | Run | Run |
| 3. Read agent code | (inline) | Run | Run | Run |
| 4. Create tracing.py | create-tracing-module | Run | Run | Run |
| 5. Wire into lifespan | wire-into-lifespan | Run | Run | Run |
| 6. Add manual tracing | add-manual-tracing | Skip | Run | Run |
| 7. Verify | verify-traces | Run | Run | Run |
| 8. Update Makefile | (inline) | Run | Run | Run |
| 9. Update .env.example | (inline) | Run | Run | Run |
| 10. Update README.md | (inline) | Run | Run | Run |
| 11. Update Dockerfile | (inline) | Run | Run | Run |
If at any point during this workflow you deviate from a skill's instructions because they were inaccurate, outdated, or insufficient — and your deviation works — propose the specific changes to the user and only update the skill file if they approve. This includes:
Also update tracing.md at the repo root: