发布

  • [NA] [BE] Improving CTE scope and performance for trace and spans (#4913)

    frostbyte_neo 发布于 2026-01-26 16:46:42 +00:00

    • [NA] [BE] Improving CTE scope and performance for trace and spans

    • Revision 2: Remove unused target_spans CTE from SpanDAO.SELECT_BY_PROJECT_ID

    • Revision 2: Fix feedback score filtering in SELECT_BY_IDS queries

    Remove project_id filter from feedback scores retrieval to allow fetching
    scores that were logged with different project_name than entity's project.

    Changes:

    • TraceDAO.SELECT_BY_IDS: Remove project_id filter from trace and span feedback scores
    • SpanDAO.SELECT_BY_IDS: Remove project_id filter from span feedback scores

    This matches main branch behavior where feedback scores are retrieved by
    entity_id regardless of project_id, supporting the project_name fallback
    logic in the SDK.

    Fixes test: test_log_feedback_scores__project_name_fallback_logic

    • Revision 3: Fix guardrails filtering in SELECT_BY_IDS query

    Remove project_id filter from guardrails retrieval to allow fetching
    guardrails that were logged with different project_name than trace's project.

    This is the same issue as feedback scores - guardrails can be logged with
    a different project_name, so we should not filter by target_projects.

    Fixes test: test_passing_guardrails__happyflow

    • Address PR reviews

    • Feedback part 2

    下载附件