Datarobot External Agent Monitoring 标志

Datarobot External Agent Monitoring

组织
datarobot-oss
datarobot-external-agent-monitoring

使用 OpenTelemetry 为任何外部或现有 AI 智能体添加监测能力,并将跟踪记录、日志和指标发送到 DataRobot,以便进行监控、可观测性分析和治理。当用户说“为我的智能体添加跟踪记录/可观测性/监控”,希望在 IDE 中为现有智能体项目添加监测能力,希望将智能体的跟踪记录、日志或指标发送到 DataRobot,或希望根据 DataRobot 跟踪记录记录并重放智能体执行轨迹(Tensile)时使用。

Add to TypingMind

概览

发布者datarobot-oss
代码仓库datarobot-agent-skills
技能名称datarobot-external-agent-monitoring
星标数
33
复刻数
27
附带文件
10
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 10 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 datarobot-oss 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Datarobot External Agent Monitoring AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/datarobot-oss/datarobot-agent-skills/tree/main/skills/datarobot-external-agent-monitoring
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/datarobot-oss/datarobot-agent-skills.git /tmp/datarobot-agent-skills
mkdir -p .claude/skills
cp -r /tmp/datarobot-agent-skills/skills/datarobot-external-agent-monitoring .claude/skills/datarobot-external-agent-monitoring
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Datarobot External Agent Monitoring,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Datarobot External Agent Monitoring。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Datarobot External Agent Monitoring 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

DataRobot External Agent Monitoring Skill

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.

Quick Start

Most common use case: Instrument an existing agent project, regardless of whether it was built on DataRobot or elsewhere, with DataRobot monitoring

  1. The user invokes the skill from inside their project — typically: "Add tracing to my agent"
  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
  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
  4. The agent sends traces, logs, and metrics to DataRobot, where they appear under the Use Case's Tracing tab

Examples:

  • "Add tracing to my agent" (resolves to the current workspace)
  • "Instrument my agent in ./my_agent for DataRobot monitoring"

When to use this skill

Use this skill when an existing DataRobot user has built an agent elsewhere and wants to bring it in for monitoring. Specifically:

  • Bring an externally-built (brownfield) agent into DataRobot for monitoring under a Use Case
  • Add OpenTelemetry tracing to an agent project
  • Send agent traces, logs, and metrics to DataRobot
  • Instrument a Google ADK, LangChain, LangGraph, CrewAI, LlamaIndex, PydanticAI, or any Python agent

Supported Frameworks

FrameworkDetectionOTel Strategy
Google ADKgoogle-adk in deps or google.adk in importsLazy trace injection via callback (ADK overwrites TracerProvider)
LangChain / LangGraphlangchain or langgraph in deps/importsAuto-instrumentor + standard setup
CrewAIcrewai in deps/importsAuto-instrumentor + standard setup
LlamaIndexllama-index or llama_index in deps/importsAuto-instrumentor + standard setup
PydanticAIpydantic-ai or pydantic_ai in deps/importsStandard setup + required Agent.instrument_all() (instrumentation is opt-in)
Generic PythonNone of the above detectedManual span instrumentation

Workflow

Follow these steps in order. Present the plan to the user and wait for approval before executing.

Step 1: Detect & Analyze

  1. Read the project's dependency file (requirements.txt, pyproject.toml, setup.py, poetry.lock, or uv.lock)
  2. Scan Python source files for framework imports
  3. Check for existing OTel setup (look for opentelemetry imports, existing TracerProvider/LoggerProvider/MeterProvider configuration)
  4. Identify the framework using the detection table above
  5. Read the corresponding framework reference file from the frameworks/ directory next to this SKILL.md:
    • Google ADK → frameworks/google-adk.md
    • LangChain/LangGraph → frameworks/langchain-langgraph.md
    • CrewAI → frameworks/crewai.md
    • LlamaIndex → frameworks/llamaindex.md
    • PydanticAI → frameworks/pydantic-ai.md
    • Generic Python → frameworks/generic-python.md

Step 2: Check Prerequisites

  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/.)
  2. Check if DATAROBOT_ENDPOINT env var is set. If not, ask the user (default: https://app.datarobot.com/api/v2).
  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).
  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 it here risks creating a Use Case the user never approved, and a duplicate when Step 4 runs).
    • Ask the user for their Use Case ID. DataRobot users typically already organize work in a Use Case.

    • If they don't have one (a brand-new or externally-built project), offer to create one. Ask only for a name; the description is auto-generated.

    • Record the choice (existing Use Case ID, or the name for a new one) to use in Step 4. The 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.name rule. 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 by create_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 the datarobot-workload-api skill). The platform injects WORKLOAD_ID into the container, so set DATAROBOT_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.name to the entity. DataRobot attributes a trace to its entity by parsing the OTLP service.name resource attribute as <entity_type>-<entity_id>. So the exported spans' service.name must equal DATAROBOT_ENTITY_ID (set it on the OTel Resource — see dr_otel_config.py), in addition to the X-DataRobot-Entity-Id header. A default service.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.

  5. Check if the datarobot Python SDK is available. If not, install it: pip install datarobot.
  6. 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.

Step 3: Present Plan

Tell the user what you detected and present the changes you will make:

  • Framework detected (or generic Python)
  • Existing OTel setup found (if any)
  • New dependencies to add
  • New files to create (dr_otel_config.py, and optionally dr_agent_metrics.py for frameworks with custom metrics)
  • Existing files to modify (agent entrypoint, dependency file)
  • Intelligent trace analysis via Tensile (recommended, adds 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.
  • Telemetry target: enter an existing Use Case ID, or if user does not have one, generate a net new Use Case container and ID for user. Only list a shell deployment in the plan if the user explicitly asked for deployment-level monitoring; if they chose a Use Case, do not mention or ask about a deployment.

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.

Step 4: Execute

  1. Add dependencies to the project's dependency file:

    • opentelemetry-sdk
    • opentelemetry-api
    • opentelemetry-exporter-otlp-proto-http
    • Framework-specific packages (see framework reference file)
  2. Generate dr_otel_config.py using the generic pattern below, adapted per the framework reference file.

  3. 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.

  4. Generate dr_agent_metrics.py if the framework reference file specifies custom metrics callbacks.

  5. 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:

    bash
    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.

  6. (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.

    bash
    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.

  7. 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):

    bash
    # 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>

Step 5: Verify & Provide Runtime Instructions

  1. Optionally run the verification script (loads credentials from .env; don't put the token on the command line):

    bash
    set -a; source .env; set +a
    python <skill_scripts_dir>/verify_otel_connection.py
  2. Provide the user with the env vars to set in their runtime environment:

    • DATAROBOT_API_TOKEN — DataRobot API key
    • DATAROBOT_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}/otel
  3. Explain 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:

    bash
    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:

    • Tracing: Span hierarchy (agent orchestration, LLM calls, tool calls)
    • Logs: Structured logs correlated with traces via traceId
    • Metrics: Custom metrics (request count, latency, LLM calls, tool calls)

Generic OTel Configuration Pattern

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:

  1. Always pass endpoint= and headers= directly to exporters — NEVER use OTEL_EXPORTER_OTLP_* env vars (some frameworks detect these and create conflicting providers)
  2. Be additive — add DataRobot as an additional span processor to any existing TracerProvider, don't replace it
  3. Use SimpleSpanProcessor (not Batch) to avoid flush-before-shutdown issues
  4. Use DELTA temporality for metrics (required by DataRobot)

Provider 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 Tracing Table — Span Attribute Mapping

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.

Column Mapping

Tracing Table ColumnSpan AttributeAggregation Rule
Promptgen_ai.promptFirst span with this attribute wins
Completiongen_ai.completionLast span with this attribute wins
Toolstool_nameLists all unique values across all spans in the trace
Costdatarobot.moderation.costSummed 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.

All Recognized Span Attributes

AttributeDescriptionExample
gen_ai.promptUser input / prompt text"Analyze policy XYZ"
gen_ai.completionModel output / response"Policy matched..."
gen_ai.request.modelModel used for the call"gpt-4o"
gen_ai.usage.prompt_tokensInput token count150
gen_ai.usage.completion_tokensOutput token count320
tool_nameName of tool/function called (required for Tools column)"search_database"
tool.parametersTool call parameters (JSON string)'{"query": "..."}'
datarobot.moderation.costCost of this span (summed for trace total)0.0023

Helper Scripts

create_use_case.py

Resolves the primary telemetry target: validates an existing Use Case, or creates a net new one when the user has none.

bash
# 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:

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"
}

create_shell_deployment.py

Optional. Creates a shell deployment in DataRobot as a telemetry routing target, for users who also want deployment-level monitoring.

bash
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:

json
{
  "deployment_id": "abc123",
  "entity_id": "deployment-abc123",
  "otel_endpoint": "https://app.datarobot.com/otel"
}

verify_otel_connection.py

Sends test telemetry to verify the OTel pipeline is working.

bash
python <scripts_dir>/verify_otel_connection.py

Requires env vars: DATAROBOT_API_TOKEN, DATAROBOT_ENTITY_ID, DATAROBOT_OTEL_ENDPOINT

Returns JSON:

json
{
  "status": "success",
  "traces": "sent",
  "logs": "sent",
  "metrics": "sent"
}

Dependencies

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

Best practices

  1. Call configure_otel() before any agent/framework initialization — some frameworks capture the provider at import time
  2. Never set OTEL_EXPORTER_OTLP_* env vars — pass endpoint and headers directly to exporters to avoid conflicts
  3. Use SimpleSpanProcessor over BatchSpanProcessor — avoids flush issues on short-lived processes
  4. DELTA temporality for metrics — DataRobot requires delta aggregation for counters and histograms
  5. Check framework reference files for initialization order issues before generating code

Error handling

Common errors and solutions:

ErrorCauseSolution
Traces not appearing in DataRobotFramework overwrites TracerProviderUse lazy injection pattern (see framework reference)
Uploads return 200/202 but traces never show in the UIservice.name ≠ the entity idSet 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 endpointInvalid API tokenVerify DATAROBOT_API_TOKEN is correct
404 from OTel endpointWrong endpoint URLEnsure DATAROBOT_OTEL_ENDPOINT ends with /otel
Metrics not appearingOTEL_EXPORTER_OTLP_* env vars setRemove env vars, use direct exporter config
DATAROBOT_ENTITY_ID format errorMissing entity-type prefixMust be experiment_container-<use_case_id> (Use Case), deployment-<id>, or workload-<workload_id> (Workload), not just <id>

Resources

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Datarobot External Agent Monitoring AI 技能有什么作用?

使用 OpenTelemetry 为任何外部或现有 AI 智能体添加监测能力,并将跟踪记录、日志和指标发送到 DataRobot,以便进行监控、可观测性分析和治理。当用户说“为我的智能体添加跟踪记录/可观测性/监控”,希望在 IDE 中为现有智能体项目添加监测能力,希望将智能体的跟踪记录、日志或指标发送到 DataRobot,或希望根据 DataRobot 跟踪记录记录并重放智能体执行轨迹(Tensile)时使用。

为什么在 TypingMind 中使用 Datarobot External Agent Monitoring?

因为您只需安装一次,就能搭配任何模型使用。Datarobot External Agent Monitoring 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Datarobot External Agent Monitoring?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/datarobot-oss/datarobot-agent-skills/tree/main/skills/datarobot-external-agent-monitoring。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Datarobot External Agent Monitoring?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Datarobot External Agent Monitoring 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Datarobot External Agent Monitoring 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Datarobot External Agent Monitoring AI 技能免费吗?

是的。datarobot-oss 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇