Skip to content

feat(evals): filter spans for eval processing#151

Draft
adityamehra wants to merge 4 commits intomainfrom
feature/filter-spans-for-eval-processing
Draft

feat(evals): filter spans for eval processing#151
adityamehra wants to merge 4 commits intomainfrom
feature/filter-spans-for-eval-processing

Conversation

@adityamehra
Copy link
Contributor

@adityamehra adityamehra commented Jan 26, 2026

PR aims to prevent LLM spans not part of the agentic AI applications from overwhelming the eval processor

@adityamehra adityamehra requested review from a team as code owners January 26, 2026 17:58

if isinstance(entity, LLMInvocation):
operation = getattr(entity, "operation", None)
# Only apply filter to chat operations (not embeddings, etc.)
Copy link
Contributor

Choose a reason for hiding this comment

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

embedding invocation is a different type, we do not need to check chat for llm invocation type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wrisa I can include the check in the same if statement here or remove it if this seems redundant

def _should_sample_for_evaluation(self, trace_id: Optional[int]) -> bool:
def _should_sample_for_evaluation(self, entity: GenAI) -> bool:
# Check if we require parent span for LLM invocations (filters out evaluation library internal calls)
if self._eval_require_parent_span:
Copy link
Contributor

Choose a reason for hiding this comment

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

workflow will also not have parent but IIRC at some point we discussed workflows to be evaluated as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wrisa This check will only happen for LLMInvocation and there's a check happening for it below

@adityamehra adityamehra marked this pull request as draft February 2, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments