| Use when adding, debugging, or modifying LLMObs plugins for an LLM library completions / streaming / embeddings / agent runs / orchestration / tool calls / retrieval", "LLMObsPlugin", "getLLMObsSpanRegisterOptions", "setLLMObsTags", "SPAN_KINDS", "span kind", any provider tag ("openai" / "anthropic" / "genai" / "google" / "langchain" / "langgraph" / "ai" llmobs), "VCR cassettes".
npx skills add https://github.com/DataDog/dd-trace-js --skill llmobs-integration
This skill covers creating LLMObs plugins that instrument LLM library operations and emit span events. Supported
operations: chat completions (streaming and non-streaming), embeddings, agent runs, orchestration (workflows /
graphs), tool calls, retrieval (RAG / vector DB).
LLM libraries iterate fast — six-month-old assumptions about an SDK's response shape, streaming contract, or tool-call
format are usually wrong. Before category detection or any plugin work, read the upstream library's source for the
installed version (versions/<lib>@<range>/node_modules/<lib>). The shape checklist below depends on facts the
source carries (does this package make HTTP calls? does it orchestrate? does it support multiple providers?). See
apm-integrations § Read Upstream Source First for the
shallow-clone / npm pack shapes.
Leaf plugins extend LLMObsPlugin and implement two methods:
getLLMObsSpanRegisterOptions(ctx) — returns a required kind plus any available name, model and session fields.setLLMObsTags(ctx) — tags the operation's input, output, metrics, and metadata.A composite root such as ai/index.js extends CompositePlugin and selects leaf plugins.
On the usual promise-backed channel, start(ctx) registers the span and captures context, end(ctx) restores the
parent after the wrapped call returns, and asyncEnd(ctx) calls setLLMObsTags() after the operation settles.
See references/plugin-architecture.md for the full implementation surface.
Settle each instrumented surface's shape before writing anything — it decides which methods to hook and how the
operation gets its response. These are working categories for reasoning, not constants in the codebase, so classify
by reading the source rather than looking for an enum.
chat / completion methods.
in separate packages. Hook the provider abstraction layer.
workflow lifecycle (invoke, stream, run).
protocol handlers.
The shape decides the response source and test harness. The instrumented operation decides its span kind and fields.
Hybrid packages such as ai and LangChain must be classified per operation. Test strategy per shape lives in
llmobs-testing.
See references/category-detection.md for heuristics and worked examples.
SPAN_KINDS in packages/dd-trace/src/llmobs/constants/tags.js lists llm, agent, workflow, task, tool,
embedding, retrieval. Chat completions and text generation are llm; graph or chain execution is workflow;
agent runs are agent; vector-DB and RAG lookups are retrieval. Only the public SDK validates against that list,
so a plugin may register a kind outside it — ai v7 and claude-agent-sdk both use step.
llm operations convert provider-specific messages to the tagger's message shape:
Common shape: [{ content?: string, role: string, toolCalls?: object[], toolResults?: object[] }]
role defaults to an empty string. Tool-call or tool-result-only messages may omit content.
Provider-specific handling:
function_call and tool_callsrole values, flatten nested content arraysparts arrays, map role namesSee references/message-extraction.md for provider-specific patterns.
packages/dd-trace/src/llmobs/plugins/{integration}/ extending LLMObsPlugin.getLLMObsSpanRegisterOptions(ctx) — span kind plus any available name, model and session fields.setLLMObsTags(ctx) — input, output, metrics and metadata from the fields the instrumentationpublishes on ctx, tagged through this._tagger.
Export the class itself when the package needs one plugin (openai, anthropic, genai), or an array when several
operations each need their own (langchain, langgraph, modelcontextprotocol-sdk, claude-agent-sdk). Use a
CompositePlugin root when one integration selects between child implementations, as ai does. The required static
fields and the rest of the surface are in references/plugin-architecture.md.
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
Access NCBI GEO for gene expression/genomics data. Search/download microarray and RNA-seq datasets (GSE, GSM, GPL), retrieve SOFT/Matrix files, for transcriptomics and expression analysis.
Bayesian modeling with PyMC. Build hierarchical models, MCMC (NUTS), variational inference, LOO/WAIC comparison, posterior checks, for probabilistic programming and inference.
Multi-objective optimization framework. NSGA-II, NSGA-III, MOEA/D, Pareto fronts, constraint handling, benchmarks (ZDT, DTLZ), for engineering design and optimization problems.
Statistical modeling toolkit. OLS, GLM, logistic, ARIMA, time series, hypothesis tests, diagnostics, AIC/BIC, for rigorous statistical inference and econometric analysis.
Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.
Convert PyTorch AT_DISPATCH macros to AT_DISPATCH_V2 format in ATen C++ code. Use when porting AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, or other dispatch macros to the new v2 API. For ATen kernel files, CUDA kernels, and native operator implementations.
Write docstrings for PyTorch functions and methods following PyTorch conventions. Use when writing or updating docstrings in PyTorch code.
Take datadog/llmobs-integration from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.