Component: Opik Server
Opik version: 2.2.13 (self-hosted, docker-compose deployment); also verified present at current HEAD (2.2.14-6215, commit d6c2776)
Describe the problem
Feedback scores written by online scoring (automation rule LLM-as-judge evaluators) never appear in workspace-level feedback-score metrics — summary and daily time-series both return empty, so score trends cannot be charted at workspace scope, even though the scores exist and are visible per-trace/per-span.
Root cause (from source at tag 2.2.13):
- The score write path is author-aware:
FeedbackScoreDAOImpl.BULK_INSERT_FEEDBACK_SCORE (apps/opik-backend/.../FeedbackScoreDAO.java:81-120) renders INSERT INTO <if(author)>authored_feedback_scores<else>feedback_scores<endif>(...). The online-scoring consumer always sets an author (OnlineScoringBaseScorer.java:121-130), so all online-scoring rows land in authored_feedback_scores.
- Project-level metrics correctly
UNION ALL both tables (ProjectMetricsDAO.java:164-206, SpanMetricsQueries.java:20-149) — these return the data fine.
- Workspace-level metrics read only the legacy table:
WorkspaceMetricsDAOImpl.GET_FEEDBACK_SCORES_SUMMARY (WorkspaceMetricsDAO.java:78-98) and GET_FEEDBACK_SCORES_DAILY / GET_FEEDBACK_SCORES_DAILY_BY_PROJECT (WorkspaceMetricsDAO.java:115-185) use FROM feedback_scores fs final with no authored_feedback_scores branch.
- No materialized view or migration folds
authored_feedback_scores → feedback_scores (checked the analytics Liquibase changelogs through 000090), so on a deployment where all scores are online-scoring-authored, feedback_scores has 0 rows and workspace score metrics are permanently empty.
Diffing FeedbackScoreDAO.java, WorkspaceMetricsDAO.java, and ProjectMetricsDAO.java between 2.2.13 and current HEAD shows no change — the gap is still present upstream.
Reproduction steps
- Self-host Opik 2.2.13. Create an automation rule (LLM-as-judge, span scope) on a project; let it score some spans (
source = online_scoring rows appear in ClickHouse opik.authored_feedback_scores; opik.feedback_scores stays at 0 rows).
POST /v1/private/projects/{projectId}/metrics with {"metric_type":"SPAN_FEEDBACK_SCORES","interval":"DAILY",...} → returns data (unioned read).
- Call the workspace feedback-score summary/daily endpoints (
WorkspacesResource) for the same window → empty for every score name.
Expected: workspace-level feedback-score metrics include authored (online-scoring) scores, consistent with the project-level queries.
Suggested fix: mirror the UNION ALL feedback_scores / authored_feedback_scores + dedup pattern already used in ProjectMetricsDAO/SpanMetricsQueries in the three WorkspaceMetricsDAO queries.
Error logs or stack trace
None — no errors anywhere; the queries simply read a table the write path no longer populates.
Component: Opik Server
Opik version: 2.2.13 (self-hosted, docker-compose deployment); also verified present at current HEAD (
2.2.14-6215, commitd6c2776)Describe the problem
Feedback scores written by online scoring (automation rule LLM-as-judge evaluators) never appear in workspace-level feedback-score metrics — summary and daily time-series both return empty, so score trends cannot be charted at workspace scope, even though the scores exist and are visible per-trace/per-span.
Root cause (from source at tag 2.2.13):
FeedbackScoreDAOImpl.BULK_INSERT_FEEDBACK_SCORE(apps/opik-backend/.../FeedbackScoreDAO.java:81-120) rendersINSERT INTO <if(author)>authored_feedback_scores<else>feedback_scores<endif>(...). The online-scoring consumer always sets an author (OnlineScoringBaseScorer.java:121-130), so all online-scoring rows land inauthored_feedback_scores.UNION ALLboth tables (ProjectMetricsDAO.java:164-206,SpanMetricsQueries.java:20-149) — these return the data fine.WorkspaceMetricsDAOImpl.GET_FEEDBACK_SCORES_SUMMARY(WorkspaceMetricsDAO.java:78-98) andGET_FEEDBACK_SCORES_DAILY/GET_FEEDBACK_SCORES_DAILY_BY_PROJECT(WorkspaceMetricsDAO.java:115-185) useFROM feedback_scores fs finalwith noauthored_feedback_scoresbranch.authored_feedback_scores→feedback_scores(checked the analytics Liquibase changelogs through000090), so on a deployment where all scores are online-scoring-authored,feedback_scoreshas 0 rows and workspace score metrics are permanently empty.Diffing
FeedbackScoreDAO.java,WorkspaceMetricsDAO.java, andProjectMetricsDAO.javabetween 2.2.13 and current HEAD shows no change — the gap is still present upstream.Reproduction steps
source = online_scoringrows appear in ClickHouseopik.authored_feedback_scores;opik.feedback_scoresstays at 0 rows).POST /v1/private/projects/{projectId}/metricswith{"metric_type":"SPAN_FEEDBACK_SCORES","interval":"DAILY",...}→ returns data (unioned read).WorkspacesResource) for the same window → empty for every score name.Expected: workspace-level feedback-score metrics include authored (online-scoring) scores, consistent with the project-level queries.
Suggested fix: mirror the
UNION ALL feedback_scores / authored_feedback_scores+ dedup pattern already used inProjectMetricsDAO/SpanMetricsQueriesin the threeWorkspaceMetricsDAOqueries.Error logs or stack trace
None — no errors anywhere; the queries simply read a table the write path no longer populates.