/datarobot-agent-skills:datarobot-external-agent-monitoringfrom datarobot-agent-skills
Instruments any external AI agent with OpenTelemetry to send traces, logs, and metrics to DataRobot for monitoring and governance. Supports Google ADK, LangChain, LangGraph, CrewAI, LlamaIndex, PydanticAI, and generic Python agents.
Ships in datarobot-agent-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; scripts run unread.
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.
Most common use case: Instrument an existing agent project, regardless of whether it was built on DataRobot or elsewhere, with DataRobot monitoring
Examples:
Use this skill when an existing DataRobot user has built an agent elsewhere and wants to bring it in for monitoring. Specifically:
| Framework | Detection | OTel Strategy |
|---|---|---|
| Google ADK | google-adk in deps or google.adk in imports | Lazy trace injection via callback (ADK overwrites TracerProvider) |
| LangChain / LangGraph | langchain or langgraph in deps/imports | Auto-instrumentor + standard setup |
| CrewAI | crewai in deps/imports | Auto-instrumentor + standard setup |
| LlamaIndex | llama-index or llama_index in deps/imports | Auto-instrumentor + standard setup |
| PydanticAI | pydantic-ai or pydantic_ai in deps/imports | Standard setup + required Agent.instrument_all() (instrumentation is opt-in) |
| Generic Python | None of the above detected | Manual span instrumentation |
Follow these steps in order. Present the plan to the user and wait for approval before executing.
requirements.txt, pyproject.toml, setup.py, poetry.lock, or uv.lock)opentelemetry imports, existing TracerProvider/LoggerProvider/MeterProvider configuration)frameworks/ directory next to this SKILL.md:
frameworks/google-adk.mdframeworks/langchain-langgraph.mdframeworks/crewai.mdframeworks/llamaindex.mdframeworks/pydantic-ai.mdframeworks/generic-python.mdEnsure 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/.)
Check if DATAROBOT_ENDPOINT env var is set. If not, ask the user (default: https://app.datarobot.com/api/v2).
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).
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 it here risks creating a Use Case the user never approved, and a duplicate when Step 4 runs).
create_use_case.py helper will resolve it to an entity ID of the form experiment_container-<use_case_id> at execution time.Telemetry targets & the
service.namerule. The target is an entity, referenced as<entity_type>-<entity_id>. Three types exist:
- Use Case —
experiment_container-<use_case_id>(the default for this skill; resolved bycreate_use_case.py).- Shell deployment —
deployment-<deployment_id>(optional; Step 4.6).- Workload —
workload-<workload_id>, when the agent runs as a DataRobot Workload (deployed via the Workload API /dr workload up; see thedatarobot-workload-apiskill). The platform injectsWORKLOAD_IDinto the container, so setDATAROBOT_ENTITY_ID=workload-${WORKLOAD_ID}— traces then appear in the workload's own Console → Deployed workloads → Tracing tab, with no Use Case required.Critical — set
service.nameto the entity. DataRobot attributes a trace to its entity by parsing the OTLPservice.nameresource attribute as<entity_type>-<entity_id>. So the exported spans'service.namemust equalDATAROBOT_ENTITY_ID(set it on the OTelResource— seedr_otel_config.py), in addition to theX-DataRobot-Entity-Idheader. A defaultservice.name(e.g. the agent/app name) matches no entity, so the traces are accepted but silently never appear in the UI — the most common "no traces" cause.
Check if the datarobot Python SDK is available. If not, install it: pip install datarobot.
Check if OTel packages are already in the project's dependencies.
Security note: Never ask the user to paste an API token into chat, and never echo tokens or .env contents into transcripts or logs. Collect the token only via the project .env file (the user edits the file directly) and read it from there; keep .env gitignored. If credentials are accidentally exposed, rotate them immediately.
Tell the user what you detected and present the changes you will make:
dr_otel_config.py, and optionally dr_agent_metrics.py for frameworks with custom metrics)tensile>=0.12.0): see the framework reference file's Intelligent Trace Analysis via Tensile section. It records full prompt and completion text in DataRobot under the Use Case; include it unless the user declines.Wait for user approval before executing. If the user has already given explicit consent to implement or deploy, that counts as approval — no need to re-ask.
Add dependencies to the project's dependency file:
opentelemetry-sdkopentelemetry-apiopentelemetry-exporter-otlp-proto-httpGenerate dr_otel_config.py using the generic pattern below, adapted per the framework reference file.
Wire into agent entrypoint: Add import and call to configure_otel() at startup. Follow the framework reference file for specific wiring instructions (auto-instrumentors, callbacks, etc.). Add the tensile.otel.install(tracer=False) lines from that file's Intelligent Trace Analysis via Tensile section directly after configure_otel() unless the user declined it.
Generate dr_agent_metrics.py if the framework reference file specifies custom metrics callbacks.
Resolve the Use Case telemetry target (primary entity). This is the only place the helper script runs — once, here, using the choice collected in Step 2 (never during prerequisites). Validate the user's existing Use Case, or create a net new one if they have none:
set -a; source .env; set +a # load DATAROBOT_API_TOKEN etc. from .env (not the command line)
# Existing Use Case:
python <skill_scripts_dir>/create_use_case.py --use-case-id <use_case_id>
# No Use Case yet — create one (name only; description auto-generated):
python <skill_scripts_dir>/create_use_case.py --name "<project_name> Monitoring"
It returns entity_id as experiment_container-<use_case_id> — this is the OTel entity used at runtime.
(Optional) Create shell deployment — only if the user explicitly asks for deployment-level monitoring (drift, etc.). If the user chose a Use Case as the target, do not ask about or prompt for a deployment ID — the Use Case is the complete target on its own. Skip this step entirely unless the user raised it themselves.
python <skill_scripts_dir>/create_shell_deployment.py \
--name "<project_name> Monitoring" \
--description "OTel telemetry sink for <framework> agent"
The script automatically enables prediction row storage and automatic association ID generation on the deployment. If created, its deployment-<id> entity can be used as the target instead of the Use Case.
Report results: Write the resolved non-secret runtime vars into the project .env — never print the token. Confirm the Use Case ID (and deployment ID, if created):
# appended to .env (DATAROBOT_API_TOKEN already present there; do not echo it):
DATAROBOT_ENTITY_ID=experiment_container-<use_case_id>
DATAROBOT_OTEL_ENDPOINT=<otel_endpoint>
Optionally run the verification script (loads credentials from .env; don't put the token on the command line):
set -a; source .env; set +a
python <skill_scripts_dir>/verify_otel_connection.py
Provide the user with the env vars to set in their runtime environment:
DATAROBOT_API_TOKEN — DataRobot API keyDATAROBOT_ENTITY_ID — experiment_container-<use_case_id> (Use Case target; or deployment-<id> for a shell deployment; or workload-<workload_id> when the agent runs as a DataRobot Workload — typically workload-${WORKLOAD_ID}, the injected id)DATAROBOT_OTEL_ENDPOINT — {DATAROBOT_ENDPOINT}/otelExplain how to view the telemetry. For a Use Case target, use the dr CLI's xp
plugin (works in a local terminal or DataRobot Codespaces); this is the view_command
returned by create_use_case.py:
dr plugin install xp # one-time
dr xp --entity-id <use_case_id> --enable-logs --enable-metrics
# ^ the BARE use_case_id, NOT the experiment_container- prefixed form
Then open the local panel at http://127.0.0.1:8090. You'll see:
Generate a dr_otel_config.py with a configure_otel() function that the project calls at startup, before any agent code runs. The full annotated template lives in reference/dr_otel_config.md — read it before generating code. Framework-specific files in frameworks/ layer additional setup on top.
Critical rules:
endpoint= and headers= directly to exporters — NEVER use OTEL_EXPORTER_OTLP_* env vars (some frameworks detect these and create conflicting providers)SimpleSpanProcessor (not Batch) to avoid flush-before-shutdown issuesProvider initialization order: some frameworks override the global TracerProvider at startup (notably Google ADK), which drops the DataRobot exporter. The additive pattern and per-framework workarounds (e.g. lazy injection via callbacks) are covered in reference/dr_otel_config.md and the framework reference files — always check them.
DataRobot's tracing UI (Data Exploration > Traces) maps specific span attributes to table columns. Using the correct attribute names is critical for data to appear in the dashboard.
| Tracing Table Column | Span Attribute | Aggregation Rule |
|---|---|---|
| Prompt | gen_ai.prompt | First span with this attribute wins |
| Completion | gen_ai.completion | Last span with this attribute wins |
| Tools | tool_name | Lists all unique values across all spans in the trace |
| Cost | datarobot.moderation.cost | Summed across all spans in the trace |
Important: DataRobot looks for tool_name (underscore), NOT tool.name (dot). Some frameworks (e.g., LangGraph) do not set tool_name by default — you must add it manually as a span attribute inside each tool call.
| Attribute | Description | Example |
|---|---|---|
gen_ai.prompt | User input / prompt text | "Analyze policy XYZ" |
gen_ai.completion | Model output / response | "Policy matched..." |
gen_ai.request.model | Model used for the call | "gpt-4o" |
gen_ai.usage.prompt_tokens | Input token count | 150 |
gen_ai.usage.completion_tokens | Output token count | 320 |
tool_name | Name of tool/function called (required for Tools column) | "search_database" |
tool.parameters | Tool call parameters (JSON string) | '{"query": "..."}' |
datarobot.moderation.cost | Cost of this span (summed for trace total) | 0.0023 |
Resolves the primary telemetry target: validates an existing Use Case, or creates a net new one when the user has none.
# Existing Use Case:
python <scripts_dir>/create_use_case.py --use-case-id <use_case_id>
# Create new (name only; description auto-generated):
python <scripts_dir>/create_use_case.py --name "My Agent Monitoring"
Requires env vars: DATAROBOT_API_TOKEN, DATAROBOT_ENDPOINT
Returns JSON:
{
"use_case_id": "6123abc",
"entity_id": "experiment_container-6123abc",
"otel_endpoint": "https://app.datarobot.com/otel",
"view_command": "dr xp --entity-id 6123abc --enable-logs --enable-metrics"
}
Optional. Creates a shell deployment in DataRobot as a telemetry routing target, for users who also want deployment-level monitoring.
python <scripts_dir>/create_shell_deployment.py \
--name "My Agent Monitoring" \
--description "OTel telemetry sink for my agent"
Requires env vars: DATAROBOT_API_TOKEN, DATAROBOT_ENDPOINT
Returns JSON:
{
"deployment_id": "abc123",
"entity_id": "deployment-abc123",
"otel_endpoint": "https://app.datarobot.com/otel"
}
Sends test telemetry to verify the OTel pipeline is working.
python <scripts_dir>/verify_otel_connection.py
Requires env vars: DATAROBOT_API_TOKEN, DATAROBOT_ENTITY_ID, DATAROBOT_OTEL_ENDPOINT
Returns JSON:
{
"status": "success",
"traces": "sent",
"logs": "sent",
"metrics": "sent"
}
Required for instrumentation (added to user's project):
opentelemetry-sdk
opentelemetry-api
opentelemetry-exporter-otlp-proto-http
Recommended, for intelligent trace analysis via Tensile (see the framework reference file):
tensile>=0.12.0
Required for shell deployment creation (available in the skill's script environment):
datarobot
configure_otel() before any agent/framework initialization — some frameworks capture the provider at import timeOTEL_EXPORTER_OTLP_* env vars — pass endpoint and headers directly to exporters to avoid conflictsSimpleSpanProcessor over BatchSpanProcessor — avoids flush issues on short-lived processesCommon errors and solutions:
| Error | Cause | Solution |
|---|---|---|
| Traces not appearing in DataRobot | Framework overwrites TracerProvider | Use lazy injection pattern (see framework reference) |
| Uploads return 200/202 but traces never show in the UI | service.name ≠ the entity id | Set the OTel Resource service.name to DATAROBOT_ENTITY_ID (<entity_type>-<entity_id>); DataRobot files a trace by parsing service.name, so a default/app service name matches no entity and is dropped from the UI |
| 401 Unauthorized from OTel endpoint | Invalid API token | Verify DATAROBOT_API_TOKEN is correct |
| 404 from OTel endpoint | Wrong endpoint URL | Ensure DATAROBOT_OTEL_ENDPOINT ends with /otel |
| Metrics not appearing | OTEL_EXPORTER_OTLP_* env vars set | Remove env vars, use direct exporter config |
DATAROBOT_ENTITY_ID format error | Missing entity-type prefix | Must be experiment_container-<use_case_id> (Use Case), deployment-<id>, or workload-<workload_id> (Workload), not just <id> |
frameworks/crewai.md (opens in a new tab)frameworks/generic-python.md (opens in a new tab)frameworks/google-adk.md (opens in a new tab)frameworks/langchain-langgraph.md (opens in a new tab)frameworks/llamaindex.md (opens in a new tab)frameworks/pydantic-ai.md (opens in a new tab)reference/dr_otel_config.md (opens in a new tab)scripts/create_shell_deployment.py (opens in a new tab)scripts/create_use_case.py (opens in a new tab)scripts/verify_otel_connection.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub datarobot-oss/datarobot-agent-skills --plugin datarobot-agent-skills17 skills in this plugin
/datarobot-agent-assistUse when the user wants to design, build, code, simulate, or deploy an AI agent (not a predictive model) to DataRobot; mentions agent_spec.yaml, dr-assist, datarobot-agent-assist, dress rehearsal, swarm simulation, or the DataRobot agent template; wants to scaffold a LangGraph, CrewAI, LlamaIndex, NAT, or Base agent targeting DataRobot; wants to add an MCP server, backend API, or React frontend to a DataRobot agent application; or uses the DataRobot CLI (dr) to build or deploy an agentic custom application; or wants to harden, stress-test, or battle-test an agent. Covers the full workflow: agent design, agent_spec.yaml authoring, dress-rehearsal simulation via the DataRobot LLM Gateway, adversarial swarm simulation, template-based coding, and deployment./datarobot-agent-llm-selectionUse when the user wants to configure LLM integration for a DataRobot agent application. This skill helps to change LLM model, switch between the LLM integrations the project supports (LLM Gateway, a DataRobot-deployed LLM, an external provider, an LLM Blueprint, and any others its config declares), or set up provider credentials. The skill reads the project's .datarobot/cli/llm.yml for the real options, interviews the user, then runs sync_llm_env.py with the chosen values as CLI args to merge into .env.Other plugins' skills for the same job