Skip to content

Document LLMObs span metadata redaction - #38747

Closed
heyitsgrace996 wants to merge 3 commits into
masterfrom
dd/grace.williams/llmobs-span-metadata-processing
Closed

Document LLMObs span metadata redaction#38747
heyitsgrace996 wants to merge 3 commits into
masterfrom
dd/grace.williams/llmobs-span-metadata-processing

Conversation

@heyitsgrace996

Copy link
Copy Markdown
Contributor

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:

  • Updates the Span processing description to mention conditional metadata modification.
  • Adds a Python example showing how to remove a sensitive key from span metadata.

Testing

  • Reviewed the generated diff for content and placement.
  • Ran git diff --check -- content/en/llm_observability/instrumentation/sdk.md.
  • Attempted vale content/en/llm_observability/instrumentation/sdk.md, but Vale is not installed in this environment.

Merge readiness

  • Ready for merge

For Datadog employees:

  • ⚠️ Your branch name MUST follow the <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.
  • 🤖 New: Comment with /review to 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

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

View session in Datadog

Bits Code status: ✅ Done

Comment @DataDog to request changes

@heyitsgrace996
heyitsgrace996 requested a review from a team as a code owner August 4, 2026 15:55
@datadog-datadog-us1-prod

Copy link
Copy Markdown

I can only run on private repositories.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Preview links (active after the build_preview check completes)

Modified Files

@evazorro evazorro self-assigned this Aug 4, 2026

@evazorro evazorro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the feedback @evazorro! I've updated the description for the example to make it clearer when this would be used - let me know what you think

also cc'ing @ebrevan for feedback on the Docs Agent tool

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! Great job

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@heyitsgrace996 heyitsgrace996 Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@heyitsgrace996
heyitsgrace996 requested a review from evazorro August 5, 2026 09:44

@evazorro evazorro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated description is much clearer, thanks for making that change!

@jhgilbert

Copy link
Copy Markdown
Contributor

[Automated message] This PR has merge conflicts caused by the recent docs repo reorg (files moved from the repo root into hugo/). A new PR with your commits translated to the correct paths has been opened: #38864

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).

@jhgilbert jhgilbert closed this Aug 6, 2026
@jhgilbert jhgilbert added astro-reorg-autofixed Needs manual conflict resolution after replatforming reorg astro-reorg-processed Needs manual conflict resolution after replatforming reorg labels Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astro-reorg-autofixed Needs manual conflict resolution after replatforming reorg astro-reorg-processed Needs manual conflict resolution after replatforming reorg Bits AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants