-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(llmobs): decorators can infer span links #12043
base: main
Are you sure you want to change the base?
Conversation
) | ||
|
||
def _tag_span_links(self, span, span_links): | ||
span_links = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Datadog ReportBranch report: ✅ 0 Failed, 130 Passed, 1468 Skipped, 5m 8.1s Total duration (35m 45.03s time saved) |
@@ -231,6 +237,10 @@ def wrapper(*args, **kwargs): | |||
_, span_name = _get_llmobs_span_options(name, None, func) | |||
traced_operation = getattr(LLMObs, operation_kind, LLMObs.workflow) | |||
with traced_operation(name=span_name, session_id=session_id, ml_app=ml_app) as span: | |||
for arg in args: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should guard these so we don't run this for users not opted into the feature
Decorators set span links by tracking common objects passed as inputs & outputs of functions.
We maintain a dictionary in the LLMObs service that remembers which objects are used as the input/output for a spans generated by LLM Obs decorators. This is how we record the from direction of span links.
When objects are encountered again as the input/output for another span, we now know to set the to direction for a span link.
In my opinion, this does not need to be gated behind a feature flag since it's a read-only on app data. A follow up PR will mutate data actually used in the user app for enhanced span link inferencing, and the features introduced then should be gated by a flag.
Implementation notes:
Limitations:
Checklist
Reviewer Checklist