Document LLMObs span metadata redaction - #38747
Conversation
|
Bits Code status: ✅ Done Comment @DataDog to request changes |
|
I can only run on private repositories. |
Preview links (active after the
|
evazorro
left a comment
There was a problem hiding this comment.
Thanks for contributing! The example looks good, I'd just like a bit more framing
|
|
||
| ### Example: redacting span metadata | ||
|
|
||
| The `metadata` field exposes the span's top-level metadata dictionary. You can mutate, add, or remove keys. |
There was a problem hiding this comment.
I think this description could be a little clearer. As a reader, I'm not totally sure what the example does. It made sense once I read your code PR description, but docs readers won't have that context. Could you add some details here that will help people know when to use this?
Lead the example with the use case instead of the field's shape, per review feedback that readers lacked context for what the example does. Restore the note that internal Datadog fields are not exposed to a processor.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 968fba40b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ## Span processing | ||
|
|
||
| To modify input and output data on spans, you can configure a processor function. The processor function has access to span tags to enable conditional input/output modification. Processor functions can either return the modified span to emit it, or return `None`/`null` to prevent the span from being emitted entirely. This is useful for filtering out spans that contain sensitive data or meet certain criteria. | ||
| To modify input and output data on spans, you can configure a processor function. The processor function has access to span tags to enable conditional input, output, and metadata modification. Processor functions can either return the modified span to emit it, or return `None`/`null` to prevent the span from being emitted entirely. This is useful for filtering out spans that contain sensitive data or meet certain criteria. |
There was a problem hiding this comment.
Scope metadata redaction to Python processors
This language-neutral span-processing intro also applies to the Node.js tab immediately below, but the current Node.js processor span still only exposes kind, input, output, and getTag (no metadata, see the dd-trace-js LLMObservabilitySpan interface). As written, Node users with sensitive metadata can be led to believe processors can redact it before export when that SDK cannot, so this should be scoped to Python or clearly marked as Python-only until Node exposes metadata.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I am working on porting this functionality over to the Node tracer (should be done soon), so I think we can leave the overall description as is - but open to changing this to a more generic line e.g. "data modification" instead, and then update it once the Node fix is released, if that would be preferable.
evazorro
left a comment
There was a problem hiding this comment.
The updated description is much clearer, thanks for making that change!
|
[Automated message] This PR has merge conflicts caused by the recent docs repo reorg (files moved from the repo root into Please follow the instructions in the PR description. This is an automated comment, but if you have a question, you can mention me in this PR (external contributors) or reach out in #docs-repo-reorg-support on Slack (internal contributors). |
What does this PR do? What is the motivation?
Documents Python LLM Observability span processor metadata support added in DataDog/dd-trace-py#18648.
Changes:
Testing
git diff --check -- content/en/llm_observability/instrumentation/sdk.md.vale content/en/llm_observability/instrumentation/sdk.md, but Vale is not installed in this environment.Merge readiness
For Datadog employees:
<name>/<description>convention and include the forward slash (/). If you've already created your PR with an incorrect branch name, please rename your branch and open a fresh PR./reviewto run an automated check that catches common issues before a Documentation team member reviews your PR.AI assistance
Used Bits Code to update the documentation.
Additional notes
PR by Bits - View session in Datadog
Comment @DataDog to request changes