Skip to content

feat(llmobs): user processor can add metadata to span#15376

Closed
matthgt wants to merge 1 commit intoDataDog:mainfrom
matthgt:mr/llmobs-allow-user-set-metadata
Closed

feat(llmobs): user processor can add metadata to span#15376
matthgt wants to merge 1 commit intoDataDog:mainfrom
matthgt:mr/llmobs-allow-user-set-metadata

Conversation

@matthgt
Copy link

@matthgt matthgt commented Nov 21, 2025

Description

LLMObs allows users to register a processor for LLMObsSpan in order to redact sensitive information being sent to datadog. However, if you wish to store this sensitive information and allow it to be linked from datadog there is no readily available way to do that. URLs in the input/output get redacted by sensitive data scanner (as we want them to) and they probably don't belong there anyway.

This change allows the registered processor to optionally add metadata to the LLMObsSpan. When they do, it is merged into the span's metadata. This eventually is shown in the datadog UI for LLMObs:

Screenshot 2025-11-21 at 10 40 18 AM

Testing

I've added tests to test_llmobs.py and tested the changes locally with our codebase.

Risks

clashing metadata keys with existing/expected ddtrace metadata?

Additional Notes

None

@matthgt matthgt force-pushed the mr/llmobs-allow-user-set-metadata branch 2 times, most recently from 2d68aa9 to b863e9c Compare November 21, 2025 20:10
@matthgt matthgt marked this pull request as ready for review November 21, 2025 20:10
@matthgt matthgt requested review from a team as code owners November 21, 2025 20:10
@matthgt matthgt force-pushed the mr/llmobs-allow-user-set-metadata branch from b863e9c to 05b2ea8 Compare November 21, 2025 20:11
@Kyle-Verhoog
Copy link
Member

hey @matthgt! thank you for contributing this, I think the change is reasonable. I'll try to get you a review by EOW 😄

Copy link
Member

@Kyle-Verhoog Kyle-Verhoog left a comment

Choose a reason for hiding this comment

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

nice and simple! thanks for the patience 😄

---
features:
- |
LLMObs: This update introduces the ability for users to add custom metadata to LLMObs spans
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
LLMObs: This update introduces the ability for users to add custom metadata to LLMObs spans
LLMObs: This update introduces the ability for users to add or override custom metadata to LLMObs spans

@github-actions github-actions bot added the stale label Jan 18, 2026
@github-actions
Copy link
Contributor

This pull request has been automatically closed after a period of inactivity.
After this much time, it will likely be easier to open a new pull request with the
same changes than to update this one from the base branch. Please comment or reopen
if you think this pull request was closed in error.

@github-actions github-actions bot closed this Jan 20, 2026
@Kyle-Verhoog Kyle-Verhoog reopened this Jan 20, 2026
@github-actions github-actions bot removed the stale label Jan 21, 2026
Copy link
Member

@brettlangdon brettlangdon left a comment

Choose a reason for hiding this comment

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

unncessary change to Cargo.lock?

Copy link
Member

Choose a reason for hiding this comment

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

why are there changes to this file? I don't see any Cargo.toml updates, so this lock file should not have needed updating

@github-actions github-actions bot added the stale label Feb 21, 2026
@github-actions
Copy link
Contributor

This pull request has been automatically closed after a period of inactivity.
After this much time, it will likely be easier to open a new pull request with the
same changes than to update this one from the base branch. Please comment or reopen
if you think this pull request was closed in error.

@github-actions github-actions bot closed this Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants