Troubleshoot Ssi 标志

Troubleshoot Ssi

组织
datadog-labs
troubleshoot-ssi

诊断并修复 Kubernetes 上的 Single Step Instrumentation(SSI)问题——SSI 可自动为应用进行 APM 插桩,无需修改代码。仅当 Agent 和 SSI 均已配置,但跟踪缺失或插桩未正常运行时使用。

Add to TypingMind

概览

发布者datadog-labs
代码仓库agent-skills
技能名称troubleshoot-ssi
星标数
172
复刻数
28
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

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

  • 兼容任何大语言模型

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

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

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

安装

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

1

安装到 TypingMind

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

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

安装到其他智能体

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

Claude Code — .claude/skills
git clone --depth 1 https://github.com/datadog-labs/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/dd-apm/k8s-ssi/troubleshoot-ssi .claude/skills/troubleshoot-ssi
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

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

一旦请求与技能匹配,模型就会自动加载 Troubleshoot Ssi。

兼容任何 AI 模型

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

  • 仅在需要时加载

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

  • 在聊天中切换模型

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

技能指令

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

Troubleshoot APM SSI on Kubernetes

Triggers

Invoke this skill when the user expresses intent to:

  • Debug why a pod is not being instrumented
  • Investigate why traces are not appearing in Datadog
  • Diagnose admission webhook or init container injection failures
  • Follow up on failed checks from verify-ssi
  • Report that a specific service or pod has no traces

Do NOT invoke this skill if:

  • SSI has not been enabled yet — run enable-ssi first

Prerequisites

  • kubectl configured to target cluster — kubectl config current-context

pup-cli: check, install, and authenticate

Claude runs

bash
pup --version

If not found, install it (OS-aware):

Claude runs

bash
if [[ "$(uname)" == "Darwin" ]]; then
  brew tap datadog-labs/pack && brew install pup
else
  PUP_VERSION=$(curl -s https://api.github.com/repos/datadog-labs/pup/releases/latest | grep '"tag_name"' | cut -d'"' -f4)
  curl -L "https://github.com/datadog-labs/pup/releases/download/${PUP_VERSION}/pup_linux_amd64.tar.gz" | tar xz -C /usr/local/bin pup
  chmod +x /usr/local/bin/pup
fi
pup --version

Check auth:

bash
pup auth status

If not authenticated:

Claude runs

bash
pup auth login

This opens a browser tab for OAuth. Complete the login there — Claude will continue once the command exits.

If no browser available: export DD_APP_KEY=<your-app-key>.


Context to resolve before acting

VariableHow to resolve
AGENT_NAMESPACENamespace where Datadog Agent is installed
APP_NAMESPACENamespace of the application with missing traces
CLUSTER_NAMEkubectl config current-context or spec.global.clusterName in datadog-agent.yaml
SERVICE_NAMEtags.datadoghq.com/service label on the Deployment, or ask the user
ENVtags.datadoghq.com/env label on the Deployment, or ask the user
POD_NAMEkubectl get pods -n <APP_NAMESPACE> — use the specific pod the user mentioned
DEPLOYMENT_NAMECheck metadata.name in the Deployment manifest, or ask the user
APP_LABELCheck spec.selector.matchLabels.app in the Deployment manifest

How SSI Works — Domain Knowledge

Read this before investigating. It gives you the mental model to reason about novel failures, not just known ones.

Injection chain:

  1. Admission webhook (registered by Cluster Agent) intercepts pod creation
  2. Webhook mutates the pod spec — adds a datadog-lib-<language>-init init container
  3. Init container downloads the tracer library onto a shared volume
  4. LD_PRELOAD env var is set pointing to the library .so file
  5. Application process loads the library automatically on startup via LD_PRELOAD

What each diagnostic layer can see:

  • pup — sees what Datadog's backend received. Blind to cluster-side injection failures. If pup shows no tracer telemetry for the service, the tracer was either never injected (cluster-side — confirm with the kubectl init-container check) or injected but unable to report yet (connectivity, DD_SITE, API key, or telemetry lag). Don't assume the cluster; cross-check kubectl.
  • kubectl — sees cluster state. Blind to whether data reached Datadog. If kubectl shows the init container but pup shows no traces, the problem is post-injection.

What healthy looks like:

  • pup fleet tracers list shows the service as active, with the expected language
  • kubectl get pod -o jsonpath='{.spec.initContainers[*].name}' includes datadog-lib-<language>-init

Known silent failures — SSI produces no error when these occur:

  • Existing ddtrace or OTel instrumentation — SSI detects it and silently disables itself
  • Unsupported runtime version — silently skipped
  • admission.datadoghq.com/enabled: "false" annotation — webhook skips the pod entirely
  • Pod not restarted after SSI enabled — injection happens at startup; existing pods keep running uninstrumented
  • Pod in Agent namespace — SSI never instruments its own namespace

Reasoning shortcuts:

  • No init container → webhook didn't fire → check: namespace targeting, pod-selector, opt-out annotation, webhook registration, pod not restarted
  • Init container present + no traces → check whether the service is in pup fleet tracers list: absent → tracer not reporting (Agent connectivity, DD_SITE mismatch, API key, blocked egress; or the tracer never loaded — existing ddtrace/OTel, unsupported runtime); present → reporting telemetry but spans not arriving (no traffic, sampling, ingestion/retention filter)

Step 1: Triage

Run all seven simultaneously and surface them back to the user as the diagnostics you're running. Everything after this is driven by what you find here. Resolve <NODE_HOSTNAME> from kubectl get pod <POD_NAME> -n <APP_NAMESPACE> -o jsonpath='{.spec.nodeName}' once you have a pod name; if no pod context yet, run the pup commands without --hostname first.

Claude runs

bash
pup traces search --query "service:<SERVICE_NAME>" --from 1h --limit 5
pup fleet tracers list --filter "service:<SERVICE_NAME>"
pup apm troubleshooting list --hostname <NODE_HOSTNAME> --timeframe 1h
pup apm service-library-config get --service-name <SERVICE_NAME> --env <ENV>
kubectl get pod <POD_NAME> -n <APP_NAMESPACE> \
  -o jsonpath='{.spec.initContainers[*].name}'
kubectl describe pod <POD_NAME> -n <APP_NAMESPACE> | grep -A 10 "Events:"
kubectl get mutatingwebhookconfigurations | grep datadog

The last command confirms the Admission Controller webhook is registered cluster-wide — this is the precondition for SSI injection working at all and must be checked even when most other services are being instrumented (any deviation in one webhook config can silently skip a subset of pods).

pup apm troubleshooting list surfaces injection errors that Datadog's backend received from the cluster — these point to cluster-side mutation failures that may not be visible from kubectl describe alone. pup apm service-library-config get shows the runtime SDK config the tracer is operating under; an empty result with ddTraceConfigs configured, or unexpected values, points to UST/config-propagation issues.


Presenting your findings (required)

Your final response is the deliverable — not your investigation transcript. It must include every diagnostic from this skill that you ran or that applies, each with its purpose and what you found. Three failure modes to avoid:

  • Running a check but not reporting it. If you ran kubectl get mutatingwebhookconfigurations, the namespace admission.datadoghq.com/mutate-pods label check, or any other command during investigation, state the command and its result in your response. A check you ran but didn't surface gives the reader nothing — and the namespace-label and webhook checks in particular must appear explicitly.

  • Omitting the two required pup diagnostics. Every diagnosis must explicitly include these two commands, by name, for each affected service — they are mandatory triage output, not optional:

    • pup apm troubleshooting list --hostname <NODE_HOSTNAME> — surfaces injection errors Datadog received from the node
    • pup apm service-library-config get --service-name <SERVICE_NAME> --env <ENV> — shows the tracer's runtime SDK config

    Run them if pup is available; recommend them for the user to run if it isn't. Do not substitute pup traces search for these — it is a different check and does not satisfy the runbook. If you don't know <ENV>, state your assumed value and run the command anyway.

  • Stopping at the first root cause. When multiple services are affected, investigate and report each one independently — they may have different causes — and give per-service remediation.


Step 2: State Your Hypotheses

Before investigating, explicitly state your ranked hypotheses based on triage output. Do not skip this step.

When the user reports multiple affected services in the same namespace, diagnose each independently. Two pods can fail injection for entirely different reasons (one opt-out annotation, one missing namespace label, one with pre-existing ddtrace). Do not assume a shared root cause — investigate each service's pod spec, annotations, and runtime separately and surface findings per-service.

Triage signalStrong hypothesis
Traces arriving + service in tracers listBoth signals are service-scoped, so on a partial rollout they can be positive while the specific pod the user named is uninstrumented. First confirm this pod is instrumented (init container present in the triage kubectl check, or the admission.datadoghq.com/status: injected annotation). If it is, it's likely a UI filter or time window — tell the user and stop
No traces + no init container on this podInjection never happened for this pod — investigate: namespace targeting, webhook, pod-selector, opt-out annotation, pod not restarted (partial rollout). The per-pod init-container check is authoritative: on a partial rollout the service can still appear in tracers list from other pods, so a service-scoped positive must not mask this pod being uninstrumented
No traces + service NOT in tracers list + init container presentTracer injected but not reporting — tracers list is telemetry-derived, so a correctly injected pod is absent when it can't report or hasn't yet. Investigate: Agent connectivity, DD_SITE mismatch, API key, blocked egress, or telemetry lag. (A true injection failure shows up as an absent init container or as init-container errors — the CrashLoopBackOff row below — not here.)
No traces + service in tracers list + init container presentTracer is reporting telemetry (so Agent connectivity, API key, and DD_SITE are working) but spans aren't arriving — investigate trace-specific causes: no traffic / the app isn't serving requests yet, sampling rules, an ingestion/retention filter, or the trace-agent receiver
Pod events show CrashLoopBackOff or init container errorsInit container failure — check existing ddtrace, runtime version
Traces arriving but wrong service/envUST labels missing or misconfigured on the Deployment

State your top 1-3 hypotheses explicitly: "Based on triage, I think the most likely cause is X because Y."


Step 3: Investigate

Use only the tools relevant to your hypotheses. Each observation informs your next action.


Cluster-side investigation tools

Is the pod in the Agent namespace? SSI never instruments pods in the same namespace as the Datadog Agent.

bash
kubectl get pods -n <AGENT_NAMESPACE>

Were pods restarted after SSI was enabled?

Confirm with the user before restarting. Tell the user: "Pods must be restarted for SSI to inject into them. I'll restart <DEPLOYMENT_NAME> in <APP_NAMESPACE>. Ready to proceed?" Wait for confirmation.

Claude runs

bash
kubectl rollout restart deployment/<DEPLOYMENT_NAME> -n <APP_NAMESPACE>
kubectl wait --for=condition=Ready pod -l app=<APP_LABEL> -n <APP_NAMESPACE> --timeout=120s

Claude runs

bash
# Primary — authoritative and immediate: confirm the freshly-restarted pods carry the init container.
# Label-scoped, not by <POD_NAME>: a rolling restart replaces the old pod with new-suffixed ones.
kubectl get pod -l app=<APP_LABEL> -n <APP_NAMESPACE> \
  -o jsonpath='{.items[0].spec.initContainers[*].name}'
# Secondary — eventual: the service reappears here once the restarted pod reports telemetry
# (subject to a propagation delay of a minute or more, and only if the pod serves traffic)
pup fleet tracers list --filter "service:<SERVICE_NAME>"

The kubectl init-container check is the authoritative post-restart signal — the pod is injected the moment that init container appears. tracers list is telemetry-derived and lags, so don't read an empty result immediately after a restart as "injection didn't happen."

Does the namespace carry the Admission Controller opt-in label? When the Admission Controller runs with mutateUnlabelled: false, injection happens only in namespaces explicitly labeled admission.datadoghq.com/mutate-pods=true. A namespace missing this label silently has SSI skipped for every pod in it — a common cause when most cluster services are instrumented but one namespace's services aren't.

bash
kubectl get namespace <APP_NAMESPACE> -o jsonpath='{.metadata.labels}'
kubectl get namespace <APP_NAMESPACE> --show-labels

Fix: label the namespace, then restart the affected deployments so the AC mutates them on pod recreate.

bash
kubectl label namespace <APP_NAMESPACE> admission.datadoghq.com/mutate-pods=true

Is namespace targeting filtering the pod out?

bash
kubectl get datadogagent datadog -n <AGENT_NAMESPACE> -o yaml | grep -A 15 instrumentation

Fix: update enabledNamespaces in datadog-agent.yaml.

Claude runs

bash
kubectl apply -f datadog-agent.yaml

Is a podSelector target filtering the pod out? If targets with podSelector is configured, only pods whose labels match the selector are instrumented. Check whether the app pod's labels match any target:

bash
kubectl get datadogagent datadog -n <AGENT_NAMESPACE> -o yaml | grep -A 20 targets
kubectl get pod <POD_NAME> -n <APP_NAMESPACE> --show-labels

Fix: add a matching label to the pod template, or broaden the podSelector, then apply and restart.

Is a pod annotation opting it out — or missing the AC's injection-success annotation? Two annotations to look for:

  • admission.datadoghq.com/enabled: "false" — explicit opt-out, AC skips the pod.
  • admission.datadoghq.com/status: injected — set by the AC after successful mutation; its absence on a running pod is positive evidence the AC never mutated it.
bash
kubectl get pod <POD_NAME> -n <APP_NAMESPACE> -o jsonpath='{.metadata.annotations}'
kubectl get pod <POD_NAME> -n <APP_NAMESPACE> -o yaml | grep -A 10 annotations

Fix: remove an opt-out annotation from the Deployment pod template, then apply and restart.

Are the expected DD_* environment variables present in the running pod? SSI injects DD_SERVICE, DD_ENV, DD_VERSION, DD_TRACE_*, and LD_PRELOAD into the container env when it mutates a pod. Their absence confirms the mutation did not run; their presence with unexpected values points to UST label mismatches or ddTraceConfigs issues.

bash
kubectl exec -n <APP_NAMESPACE> <POD_NAME> -- env | grep -E '^(DD_|LD_PRELOAD)'
kubectl describe pod <POD_NAME> -n <APP_NAMESPACE> | grep -E 'DD_|LD_PRELOAD'

Claude runs

bash
kubectl apply -f <your-app-deployment.yaml>

Confirm with the user before restarting. Tell the user: "I need to restart <DEPLOYMENT_NAME> in <APP_NAMESPACE> for this change to take effect. Ready to proceed?" Wait for confirmation.

Claude runs

bash
kubectl rollout restart deployment/<DEPLOYMENT_NAME> -n <APP_NAMESPACE>

Does the app have existing custom instrumentation? SSI silently disables itself when it detects existing tracer code. Scan source files for:

  • Python: import ddtrace, ddtrace.patch_all()
  • Node.js: require('dd-trace'), DD.init()
  • Java: GlobalTracer.register(, dd-java-agent
  • .NET: Tracer.Instance, DD.Trace
  • Ruby: require 'ddtrace', Datadog.configure
  • PHP: DDTrace\

Also check dependency manifests: requirements.txt, package.json, Gemfile, pom.xml.

Fix: remove the import/package, rebuild image, reload into cluster, restart pod.

Is the base image Alpine (musl libc)? K8s SSI injects LD_PRELOAD as an environment variable into the pod — it does not rely on /etc/ld.so.preload, so musl/Alpine images are supported. This is not a blocker for Kubernetes SSI.

Is the runtime version supported?

bash
kubectl exec -n <APP_NAMESPACE> <POD_NAME> -- python --version
kubectl exec -n <APP_NAMESPACE> <POD_NAME> -- node --version
kubectl exec -n <APP_NAMESPACE> <POD_NAME> -- java -version

Verify against SSI compatibility matrix.

Is the admission webhook registered?

bash
kubectl get mutatingwebhookconfigurations | grep datadog
kubectl get pods -n <AGENT_NAMESPACE> -l app=datadog-cluster-agent
kubectl logs -n <AGENT_NAMESPACE> -l app=datadog-cluster-agent --tail=100

Did injection produce errors? Get the node hostname first, then query Datadog for injection errors:

bash
kubectl get pod <POD_NAME> -n <APP_NAMESPACE> -o jsonpath='{.spec.nodeName}'
pup apm troubleshooting list --hostname <NODE_HOSTNAME> --timeframe 1h

Is the Agent sending data to Datadog?

bash
kubectl exec -n <AGENT_NAMESPACE> \
  $(kubectl get pod -n <AGENT_NAMESPACE> -l app=datadog-agent -o name | head -1) \
  -- agent status | grep -A 5 "APM Agent"

Datadog-side investigation tools

Is the tracer reporting?

bash
pup fleet tracers list --filter "service:<SERVICE_NAME>"

Does APM recognise the service?

bash
pup apm services list --env <ENV>

What SDK configuration is the service running with? Shows env vars the tracer is configured with (e.g. DD_TRACE_ENABLED, DD_SERVICE, DD_ENV, sampling rules). Empty output is expected if ddTraceConfigs was not set in enable-ssi; a populated output mismatching what was configured indicates the change didn't propagate.

bash
pup apm service-library-config get --service-name <SERVICE_NAME> --env <ENV>

Are traces arriving?

bash
pup traces search --query "service:<SERVICE_NAME>" --from 1h --limit 10

Which agent is the tracer connected to? Use if connectivity between tracer and Agent is suspected.

bash
pup fleet agents list --filter "hostname:<NODE_HOSTNAME>"
pup fleet agents tracers <AGENT_KEY> --filter "service:<SERVICE_NAME>"

Step 4: Reflect Before Concluding

Before applying any fix, answer:

  1. What evidence confirms my hypothesis?
  2. What evidence would contradict it — and have I checked?
  3. Is there a simpler explanation I haven't considered?

If the conclusion doesn't hold up, return to Step 2 with new hypotheses. Keep iterating until you can defend the conclusion against all three questions.


Step 5: Fix

Apply the fix for the confirmed root cause. If the fix requires a code or Dockerfile change, rebuild and reload:

Claude runs

bash
docker build -f <DOCKERFILE_PATH> -t <IMAGE_NAME> <BUILD_CONTEXT>

[DECISION: cluster type]

  • kind (local): load the image into the cluster

Claude runs

bash
kind load docker-image <IMAGE_NAME> --name <CLUSTER_NAME>
  • Registry-based: skip — image will be pulled on next deployment

Confirm with the user before restarting. Tell the user: "I need to restart <DEPLOYMENT_NAME> in <APP_NAMESPACE> to apply the fix. Ready to proceed?" Wait for confirmation.

Claude runs

bash
kubectl rollout restart deployment/<DEPLOYMENT_NAME> -n <APP_NAMESPACE>
kubectl wait --for=condition=Ready pod -l app=<APP_LABEL> -n <APP_NAMESPACE> --timeout=120s

Step 6: Verify

Re-run triage to confirm the fix worked:

Claude runs

bash
pup traces search --query "service:<SERVICE_NAME>" --from 1h --limit 5
pup fleet tracers list --filter "service:<SERVICE_NAME>"

If traces are arriving — resolved (the service may take a minute to reappear in pup fleet tracers list; an empty tracers list immediately after the restart is expected telemetry lag, not a failure). Automatically proceed to onboarding-summary now — do not ask the user for permission.

ERROR: No traces arriving — return to Step 2 with the new triage data and form updated hypotheses.


Security constraints

  • Never write a raw API key into any file or chat message
  • Never run kubectl delete without user confirmation
  • Never modify admissionController settings directly
  • docker push to a registry always requires user confirmation

常见问题

Troubleshoot Ssi AI 技能有什么作用?

诊断并修复 Kubernetes 上的 Single Step Instrumentation(SSI)问题——SSI 可自动为应用进行 APM 插桩,无需修改代码。仅当 Agent 和 SSI 均已配置,但跟踪缺失或插桩未正常运行时使用。

为什么在 TypingMind 中使用 Troubleshoot Ssi?

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

如何在 TypingMind 中安装 Troubleshoot Ssi?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/datadog-labs/agent-skills/tree/main/dd-apm/k8s-ssi/troubleshoot-ssi。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Troubleshoot Ssi?

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

Troubleshoot Ssi 可以搭配多少个 AI 模型使用?

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

Troubleshoot Ssi AI 技能免费吗?

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

什么是 AI 技能?

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

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

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

查看全部

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

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