Index of every page on this site: llms.txt
All skills
datadog-labs avatar

/dd-instrument-shipdog

@1a0cdd0 official
Run it yourself

Datadog Shipdog backend setup. Gets one service's traces and logs into Datadog, turns on Live Debugger (logpoints that capture variable values from running code), and proves it with a real logpoint. Supports Python and Node.js today, sending straight to Datadog with no Agent (agentless mode) or through an existing working Agent. Use when the user wants to add logpoints to their app, see variable values from a running or production service without print statements or redeploys, set up or fix Live Debugger ("service isn't available", logpoints never capture), send traces and logs to Datadog without an Agent, or set up or onboard to Shipdog. Not for installing the Datadog Agent on hosts, frontend RUM, or adding log statements to code.

Use this Skill: https://skilld.dev/gh/datadog-labs/agent-skills/dd-instrument-shipdog

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencespython.md

≈1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Python (ddtrace)

Install

ddtrace>=4.15.0 (the first version with agentless mode) in the manifest the deploy installs from, with the project's own tool (uv add, poetry add, pipenv install, or requirements.txt plus pip install), then install it locally. If requirements.txt is generated from requirements.in (its header says so), add packages to requirements.in and rerun the command in the header. Raise an older constraint and say so in the report. Pin exactly only if the project pins everything.

Load it first

Prefix every launch command with ddtrace-run. If a command can't be wrapped, make import ddtrace.auto the entrypoint's first import, after any docstring and from __future__ imports.

App Command
Django ddtrace-run gunicorn <project>.wsgi (or uvicorn <project>.asgi:application)
FastAPI, Starlette ddtrace-run uvicorn main:app (multiple --workers are fine)
Flask ddtrace-run gunicorn app:app, or ddtrace-run python app.py
Celery workers ddtrace-run celery -A <app> worker: a separate service, set up the same way
  • Reloaders (flask run --debug, uvicorn --reload, Django runserver) restart the process and drop logpoints. Verify without them.
  • On macOS, gunicorn's forked workers can crash under ddtrace. Keep ddtrace-run gunicorn in deploy config (production is Linux), verify with a non-forking server (ddtrace-run flask --app <module> run --no-reload), and report gunicorn as unverified until it runs on Linux.

Logs

Agentless ddtrace doesn't send logs itself; its OpenTelemetry log export does, also without an Agent:

  1. Add opentelemetry-sdk and opentelemetry-exporter-otlp-proto-http to the manifest.
  2. Set DD_LOGS_OTEL_ENABLED=true, OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/protobuf, OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://otlp.<DD_SITE>/v1/logs, and OTEL_EXPORTER_OTLP_LOGS_HEADERS=dd-api-key=$DD_API_KEY built at launch, never as a literal.
  3. Add import opentelemetry # noqa: F401 to the module the server loads (app.py, main.py, Django's wsgi.py/asgi.py), before other application imports but after its docstring and any from __future__ imports, which Python requires first. If the project uses import ddtrace.auto, put that just before it. ddtrace hooks the exporter on that import; without it no logs are sent.

This covers logging and libraries on it (structlog with the stdlib backend). print and loguru sinks aren't sent; offer moving them onto logging as a follow-up.

Launch command without deploy config

ddtrace doesn't read .env; don't add load_dotenv() above the tracer import: anything imported before it loads uninstrumented. The script below loads .env; if the key is in another env file, load that one. With no deploy config, commit an executable run.sh, adding the Git variables dd-git-tagging sets before exec:

#!/bin/sh
set -e
key=$DD_API_KEY; [ -f .env ] && { set -a; . ./.env; set +a; }; [ -n "$key" ] && export DD_API_KEY="$key"
export DD_SERVICE=<service> DD_ENV=<env> DD_SITE=<site>
export DD_AGENTLESS_ENABLED=true DD_DYNAMIC_INSTRUMENTATION_ENABLED=true DD_LOGS_OTEL_ENABLED=true
export OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/protobuf OTEL_EXPORTER_OTLP_LOGS_ENDPOINT="https://otlp.$DD_SITE/v1/logs"
export OTEL_EXPORTER_OTLP_LOGS_HEADERS="dd-api-key=$DD_API_KEY"
[ -f .venv/bin/activate ] && . .venv/bin/activate
exec ddtrace-run <launch command>

Activate the project's virtualenv before ddtrace-run, or python is the system interpreter and the tracer never loads. In a Dockerfile, use ENV for the non-secret settings and build the OTLP header in the entrypoint from the runtime DD_API_KEY.

Check

Without a key, agentless ddtrace refuses to start (DD_AGENTLESS_ENABLED is set but DD_API_KEY is not), and so does ddtrace-run --info; run it with the full environment and check service, env, version. With DD_TRACE_DEBUG=true, OpenTelemetry Logs exporter is not configured, proceeding with ddtrace setup confirms the log export is wired.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert4d3 checks · Risk SAFE
  • Gen Agent Trust Hub4d

    The skill instruments Python and Node.js applications with Datadog telemetry and Live Debugger. It follows security best practices for secret management and uses official, trusted libraries. A low-risk surface for indirect prompt injection exists because the skill processes local source code and external log data.

  • Socket4d

    No alerts

  • Snyk4d

    Risk: CRITICAL · 2 issues

Signed by skilld at 1a0cdd0. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 5 days ago
Other metadata
metadata
{
  "version": "0.5.0",
  "author": "datadog-labs",
  "repository": "https://github.com/datadog-labs/agent-skills",
  "tags": "datadog,shipdog,live-debugger,apm,logs,agentless,python,nodejs",
  "alwaysApply": "false"
}

README badge

README badge for datadog-labs/agent-skills/dd-instrument-shipdog