$npx -y skills add datarobot-oss/datarobot-agent-skills --skill datarobot-external-agent-monitoringInstrument any external or existing AI agent with OpenTelemetry to send traces, logs, and metrics to DataRobot for monitoring, observability, and governance. Use when the user says "add tracing/observability/monitoring to my agent", wants to instrument an existing agent project i
| 1 | # DataRobot External Agent Monitoring Skill |
| 2 | |
| 3 | This skill helps you instrument any AI agent — regardless of framework or deployment environment — to send OpenTelemetry telemetry (traces, logs, metrics) to DataRobot. It also creates a shell deployment in DataRobot as the telemetry routing target. |
| 4 | |
| 5 | ## Quick Start |
| 6 | |
| 7 | **Most common use case**: Instrument an existing agent project, regardless of whether it was built on DataRobot or elsewhere, with DataRobot monitoring |
| 8 | |
| 9 | 1. The user invokes the skill from inside their project — typically: "Add tracing to my agent" |
| 10 | 2. The skill resolves the target project (current IDE workspace / working directory if no path is given), then detects the framework and any existing OTel setup |
| 11 | 3. It resolves a **Use Case** as the telemetry target (asks for the user's Use Case ID, or offers to create one), generates instrumentation code, and wires it in |
| 12 | 4. The agent sends traces, logs, and metrics to DataRobot, where they appear under the Use Case's Tracing tab |
| 13 | |
| 14 | **Examples**: |
| 15 | - "Add tracing to my agent" (resolves to the current workspace) |
| 16 | - "Instrument my agent in ./my_agent for DataRobot monitoring" |
| 17 | |
| 18 | ## When to use this skill |
| 19 | |
| 20 | Use this skill when an existing DataRobot user has built an agent elsewhere and wants to bring it in for monitoring. Specifically: |
| 21 | - Bring an externally-built (brownfield) agent into DataRobot for monitoring under a Use Case |
| 22 | - Add OpenTelemetry tracing to an agent project |
| 23 | - Send agent traces, logs, and metrics to DataRobot |
| 24 | - Instrument a Google ADK, LangChain, LangGraph, CrewAI, LlamaIndex, PydanticAI, or any Python agent |
| 25 | |
| 26 | ## Supported Frameworks |
| 27 | |
| 28 | | Framework | Detection | OTel Strategy | |
| 29 | |-----------|-----------|---------------| |
| 30 | | Google ADK | `google-adk` in deps or `google.adk` in imports | Lazy trace injection via callback (ADK overwrites TracerProvider) | |
| 31 | | LangChain / LangGraph | `langchain` or `langgraph` in deps/imports | Auto-instrumentor + standard setup | |
| 32 | | CrewAI | `crewai` in deps/imports | Auto-instrumentor + standard setup | |
| 33 | | LlamaIndex | `llama-index` or `llama_index` in deps/imports | Auto-instrumentor + standard setup | |
| 34 | | PydanticAI | `pydantic-ai` or `pydantic_ai` in deps/imports | Standard setup + required `Agent.instrument_all()` (instrumentation is opt-in) | |
| 35 | | Generic Python | None of the above detected | Manual span instrumentation | |
| 36 | |
| 37 | ## Workflow |
| 38 | |
| 39 | Follow these steps in order. Present the plan to the user and wait for approval before executing. |
| 40 | |
| 41 | ### Step 1: Detect & Analyze |
| 42 | |
| 43 | 1. Read the project's dependency file (`requirements.txt`, `pyproject.toml`, `setup.py`, `poetry.lock`, or `uv.lock`) |
| 44 | 2. Scan Python source files for framework imports |
| 45 | 3. Check for existing OTel setup (look for `opentelemetry` imports, existing TracerProvider/LoggerProvider/MeterProvider configuration) |
| 46 | 4. Identify the framework using the detection table above |
| 47 | 5. Read the corresponding framework reference file from the `frameworks/` directory next to this SKILL.md: |
| 48 | - Google ADK → `frameworks/google-adk.md` |
| 49 | - LangChain/LangGraph → `frameworks/langchain-langgraph.md` |
| 50 | - CrewAI → `frameworks/crewai.md` |
| 51 | - LlamaIndex → `frameworks/llamaindex.md` |
| 52 | - PydanticAI → `frameworks/pydantic-ai.md` |
| 53 | - Generic Python → `frameworks/generic-python.md` |
| 54 | |
| 55 | ### Step 2: Check Prerequisites |
| 56 | |
| 57 | 1. Ensure `DATAROBOT_API_TOKEN` is available **without having the user paste it into chat** (a pasted token would be logged in the transcript). Check the environment and the project `.env`. If the token is missing, create or update a project `.env` file with the DataRobot variables and have the user paste their Personal API key into **that file** directly (in their editor); read it from there. Ensure `.env` is gitignored. This skill targets existing DataRobot users: create a Personal API key at `<your DataRobot URL>/account/developer-tools` (Personal API keys tab; see the `datarobot-setup` skill). (No DataRobot account at all? https://www.datarobot.com/trial/.) |
| 58 | 2. Check if `DATAROBOT_ENDPOINT` env var is set. If not, ask the user (default: `https://app.datarobot.com/api/v2`). |
| 59 | 3. Derive `DATAROBOT_OTEL_ENDPOINT` automatically: if `DATAROBOT_ENDPOINT` ends with `/api/v2`, strip it and append `/otel` (e.g., `https://app.datarobot.com/api/v2` → `https://app.datarobot.com/otel`). |
| 60 | 4. **Determine the telemetry target (Use Case)** — this is the primary entity, and works the same whether the agent was built on DataRobot or elsewhere. Only **collect** the choice here; do **not** run any script or create/validate anything yet — that happens once in Step 4, after the user approves the plan (running |