feat(llm-obs): add annotation queue label schema and annotation commands - #728
Conversation
Wire up four LLM Observability annotation endpoints that exist in the pinned datadog-api-client-rust SDK but were never exposed by pup. Queue label schemas could previously only be set at queue-creation time via `annotation-queues create --file`, with no way to read one back or edit it; annotations on queue interactions had no CLI surface at all. - Add `llm-obs annotation-queues schema get|update` (src/commands/llm_obs.rs) - Add `llm-obs annotation-queues annotations upsert|delete` (src/commands/llm_obs.rs) - Register the four operations in UNSTABLE_OPS (src/client.rs:323) - Document the annotation-queues subtree, previously absent (docs/COMMANDS.md:69) Both annotation endpoints are queue-scoped (they take a queue_id), so they are nested under `annotation-queues` rather than a top-level group. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Integration-tested against the real API — three bugs found and fixedThe original commit was only verified against mockito. Because Retested against a live org. The generated client declares
FixAll four now go through VerificationNow confirmed against the real API, not just mocks:
Test scaffolding was a throwaway queue created and then deleted; deletion verified by a 404. Tests are now 13 (up from 9), including regression tests that pin the null-response shapes, captured from real responses rather than hand-written. Separately: a pre-existing bug this surfaced
Not fixed here to keep this PR scoped — worth its own issue. |
Summary
Wires up four LLM Observability annotation endpoints that already exist in the pinned
datadog-api-client-rustSDK but were never exposed by pup. Queue label schemas could previously only be set at creation time viaannotation-queues create --file, with no way to read one back or edit it; annotations on queue interactions had no CLI surface at all.Changes
llm-obs annotation-queues schema get|update(src/commands/llm_obs.rs)llm-obs annotation-queues annotations upsert|delete(src/commands/llm_obs.rs)UNSTABLE_OPS(src/client.rs:323) — without this the SDK rejects them withUnstableOperationDisabledErrorUNSTABLE_OPSsection comment (21→25) and length assertion (186→190) (src/client.rs)annotation-queuessubtree, which was absent from the llm-obs row entirely (docs/COMMANDS.md:69)New commands:
Both annotation endpoints are queue-scoped (they take a
queue_id), so they are nested underannotation-queuesrather than a top-levelllm-obs annotationsgroup.Testing
9 new tests in
src/commands/llm_obs.rs, positive and negative per endpoint:schema get, 400 onannotations upsertdatamemberVerified:
cargo fmt --checkclean,cargo clippy --all-targets -- -D warningsclean,cargo test1725 passed.CLI-level smoke test confirms routing reaches the handlers and
read_onlyclassification is correct (schema getread-only; the three writes not).Note on the suite: four tests in
dbm,monitors,security, andtracesfail under parallel execution onmainas well — verified by stashing this work and re-running on a clean tree (1716 passed, same 4 failed). They pass individually, so they are pre-existing env-var races unrelated to this change.Not included
Monitor annotations (exposed by the data-observability MCP server) are not in the pinned SDK for either
datadogV1ordatadogV2, so adding them would require hand-rolled HTTP against non-public endpoints. Left out deliberately.🤖 Generated with Claude Code