refactor: reduce memory usage with otel and clickhouse#4755
Conversation
Signed-off-by: Roman Dmytrenko <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v2 #4755 +/- ##
==========================================
- Coverage 62.67% 62.64% -0.03%
==========================================
Files 132 132
Lines 15595 15531 -64
==========================================
- Hits 9774 9730 -44
+ Misses 5139 5115 -24
- Partials 682 686 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors evaluation telemetry to reduce memory usage by replacing legacy analytics event marshaling with OpenTelemetry attributes and events. The changes streamline span event creation and make tracing configuration more explicit through the evaluation server.
- Removes JSON marshaling of analytics events in middleware in favor of structured OpenTelemetry events
- Introduces explicit tracing configuration through functional options in the evaluation server
- Consolidates tracing logic within evaluation handlers with conditional execution based on configuration
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/server/tracing/attributes.go | Adds new OpenTelemetry event constants and flag type attributes |
| internal/server/middleware/grpc/middleware.go | Removes analytics parameter and legacy JSON marshaling logic |
| internal/server/middleware/grpc/middleware_test.go | Updates test calls to match simplified middleware signature |
| internal/server/evaluation/server.go | Adds tracing configuration option and constructor changes |
| internal/server/evaluation/evaluation.go | Adds conditional tracing logic to evaluation handlers |
| internal/server/evaluation/ofrep_bridge.go | Adds conditional tracing logic to OFREP bridge handlers |
| internal/server/analytics/sink.go | Replaces JSON unmarshaling with structured attribute parsing |
| internal/server/analytics/sink_test.go | Updates test to use new structured event format |
| internal/cmd/grpc.go | Updates server construction with tracing configuration |
| go.mod | Moves k8s.io/utils from indirect to direct dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Related Documentation Checked 3 published document(s). No updates required. You have 3 draft document(s). Publish docs to keep them always up-to-date |
|
Documentation Updates Checked 3 published document(s). No updates required. You have 3 draft document(s). Publish docs to keep them always up-to-date |
Signed-off-by: tejasvini1 <[email protected]>
This pull request refactors how evaluation telemetry is handled, simplifying the tracing and analytics integration throughout the evaluation server and middleware. The main changes are the removal of legacy analytics event marshaling, the introduction of use of OpenTelemetry attributes and events for evaluation responses. This streamlines span event creation and makes tracing configuration more explicit and flexible.