Open
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=2cf45fc1ed4daced4544abd79a73e0978c561f46 |
f800a99 to
e65038b
Compare
neutralino1
reviewed
Mar 6, 2026
Comment on lines
+30
to
+31
| class _ClickHouseFeedbackStatsServer(Protocol): | ||
| def _query(self, sql: str, parameters: dict[str, Any]) -> Any: ... |
Collaborator
There was a problem hiding this comment.
Is this necessary? Why not use the real interface?
|
|
||
| pb = ParamBuilder() | ||
| query_result = build_feedback_stats_query(req, pb) | ||
| result = server._query(query_result.sql, query_result.parameters) |
Collaborator
There was a problem hiding this comment.
should this be calling a private method? Should the method be made public?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
This PR adds a feedback analytics API so clients can compute aggregate score data across very large sets of calls without reading individual feedback rows.
It introduces two new endpoints:
feedback_stats, which returns time-binned aggregates from thefeedbacktable plus full-window summary statsfeedback_payload_schema, which discovers aggregate-able payload paths and inferred value types from sampled feedback rowsThe new APIs support filtering by:
feedback_type, which effectively scopes results to a scorer/scorer typetrigger_ref, which is the ref for the monitor that triggered the scoreImplementation details:
This also keeps the
clickhouse_trace_server_batched.pydiff small by moving the feedback stats orchestration into a dedicated helper module while leaving the SQL generation in focused helper files.Testing
tests/trace_server/query_builder/test_feedback_stats.pywith strict assertions on the generated sql, see tests for a clear picture of the queries we run.