Support max trace size issue in the query service#8098
Conversation
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
2. remove same code at aggregator.go 3. remove skipCurrentTrace and do an early exit from mergeTraces if the current count is already at max 4. remove redundant checks at aggregator.go Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
2. use range with .All() in copySpansUpToLimit 3. argument order to (dest, src, ...) Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
…f copySpansUpToLimit, fix early return Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com> Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
Signed-off-by: Parship Chowdhury <parshipchowdhury@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR implements a configurable limit on the number of spans per trace to prevent memory issues when retrieving large traces. When a trace exceeds the configured max_trace_size, it is truncated to the specified limit and a warning is added to indicate the truncation.
Changes:
- Added
max_trace_sizeconfiguration parameter with default value of 0 (unlimited) - Implemented span limiting logic in trace aggregation that truncates traces exceeding the limit
- Added warning messages to truncated traces indicating the limit was reached
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| jaeger-ui | Updated subproject commit reference |
| internal/jptrace/aggregator.go | Implemented core span limiting logic with AggregateTracesWithLimit, mergeTracesWithLimit, copySpansUpToLimit, and markTraceTruncated functions |
| internal/jptrace/aggregator_test.go | Added comprehensive tests for span limiting functionality |
| cmd/jaeger/internal/extension/jaegerquery/server.go | Passed MaxTraceSize configuration to query service options |
| cmd/jaeger/internal/extension/jaegerquery/querysvc/service.go | Updated service to use AggregateTracesWithLimit with configured max size |
| cmd/jaeger/internal/extension/jaegerquery/querysvc/service_test.go | Added integration tests for max trace size scenarios |
| cmd/jaeger/internal/extension/jaegerquery/internal/flags.go | Added MaxTraceSize configuration field |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8098 +/- ##
=======================================
Coverage 95.66% 95.67%
=======================================
Files 317 317
Lines 16668 16732 +64
=======================================
+ Hits 15946 16008 +62
- Misses 570 571 +1
- Partials 152 153 +1
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
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Which problem is this PR solving?
Description of the changes
max_trace_sizeconfiguration parameter to limit spans per traceHow was this change tested?
AI Usage in this PR (choose one)
See AI Usage Policy.