Skip to content

Feat: configurable max queryable traces by vtselect#114

Open
emamihe wants to merge 1 commit into
VictoriaMetrics:masterfrom
emamihe:feature/configurable-max-traces
Open

Feat: configurable max queryable traces by vtselect#114
emamihe wants to merge 1 commit into
VictoriaMetrics:masterfrom
emamihe:feature/configurable-max-traces

Conversation

@emamihe
Copy link
Copy Markdown
Contributor

@emamihe emamihe commented Mar 4, 2026

Describe Your Changes

This PR makes the maximum number of traces returned by the Jaeger /api/traces search API configurable via a new command-line flag instead of a hardcoded constant.

Changes:

  • New flag: -search.maxTraces (default: 1000) — maximum number of traces that can be returned in a single search request
  • Code: Replaced the maxLimit constant in app/vtselect/traces/jaeger/jaeger.go with *tracecommon.TraceMaxTraces
  • Config: Added TraceMaxTraces in app/vtselect/traces/tracecommon/tracecommon.go alongside other trace search limits (TraceMaxServiceNameList, TraceMaxSpanNameList)
  • Docs: Documented the new flag in docs/victoriatraces/README.md

Impact: Operators can now tune the trace search limit (e.g. -search.maxTraces=2000) without code changes, improving flexibility for different workloads and environments.

Checklist

The following checks are mandatory:


Summary by cubic

Adds a configurable max number of traces for Jaeger's /api/traces via -search.maxTraces and enforces it even when the client omits limit. Lets operators tune result size per environment.

  • New Features
    • New flag: -search.maxTraces (default 1000) caps results; rejects negative limits and caps the default when limit is omitted.
    • Replaces the hardcoded limit with tracecommon.TraceMaxTraces; docs updated.

Written for commit 6e2e6ef. Summary will update on new commits.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/vtselect/traces/jaeger/jaeger.go">

<violation number="1" location="app/vtselect/traces/jaeger/jaeger.go:333">
P2: `-search.maxTraces` is not enforced when `limit` is omitted, so default limit 20 can exceed configured maximum.</violation>
</file>

<file name="app/vtselect/traces/tracecommon/tracecommon.go">

<violation number="1" location="app/vtselect/traces/tracecommon/tracecommon.go:29">
P2: `search.maxTraces` is a signed flag with no lower-bound validation, allowing negative values to propagate into query limit logic.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread app/vtselect/traces/jaeger/jaeger.go Outdated
Comment thread app/vtselect/traces/tracecommon/tracecommon.go Outdated
@emamihe emamihe changed the title Feature/configurable max traces Feat: configurable max traces Mar 4, 2026
@emamihe emamihe changed the title Feat: configurable max traces Feat: configurable max queryable traces by vtselect Mar 4, 2026
@emamihe emamihe force-pushed the feature/configurable-max-traces branch from db82af0 to 6e2e6ef Compare March 4, 2026 14:20
@emamihe
Copy link
Copy Markdown
Contributor Author

emamihe commented Mar 6, 2026

@jiekun I think this feature will also help us. because we are now heavily using victoria traces in our company. and one of the feedbacks I got from our dev team was that the official Jeager service was letting us to query max recent 1500 traces while the Jaeger-UI backed with Victoria Traces allow us to query up to recent 1000 traces.
and That was why I sent this PR

@jiekun
Copy link
Copy Markdown
Member

jiekun commented Mar 6, 2026

Hi, thanks for the proposal. I think it's a valuable change and should be included in the next release. I'll take a look at it soon.

@jiekun jiekun self-requested a review March 6, 2026 17:26
@jiekun jiekun self-assigned this Mar 6, 2026
@makasim makasim added vtselect enhancement New feature or request labels May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request vtselect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants