Skip to content

Validate start_time_max after start_time_min#8309

Merged
yurishkuro merged 1 commit into
jaegertracing:mainfrom
utafrali:fix/issue-8289-bug-jaegermcp-search-traces-missing-vali
Apr 14, 2026
Merged

Validate start_time_max after start_time_min#8309
yurishkuro merged 1 commit into
jaegertracing:mainfrom
utafrali:fix/issue-8289-bug-jaegermcp-search-traces-missing-vali

Conversation

@utafrali
Copy link
Copy Markdown
Contributor

@utafrali utafrali commented Apr 7, 2026

Fixes #8289

Wasn't validating that start_time_max is after start_time_min. Added the check and a test.

@utafrali utafrali requested a review from a team as a code owner April 7, 2026 12:50
Copilot AI review requested due to automatic review settings April 7, 2026 12:50
@dosubot dosubot Bot added the bug label Apr 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issue #8289 by adding validation to ensure that start_time_max is after start_time_min in the Jaeger MCP server's search_traces tool. Previously, reversed time parameters would silently result in empty results. Now, the tool returns a clear error message when this validation fails.

Changes:

  • Added validation check in the buildQuery function to compare maxStartTime and minStartTime after both are parsed
  • Added comprehensive test case TestSearchTracesHandler_Handle_StartTimeMaxBeforeMin that verifies the validation works correctly with reversed time parameters
  • Error message is consistent with existing validation patterns in the codebase

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cmd/jaeger/internal/extension/jaegermcp/internal/handlers/search_traces.go Added validation logic to check that start_time_max is after start_time_min (lines 120-122)
cmd/jaeger/internal/extension/jaegermcp/internal/handlers/search_traces_test.go Added test case for the new validation (lines 419-432)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yurishkuro
Copy link
Copy Markdown
Member

commits must be signed

@github-actions github-actions Bot added the waiting-for-author PR is waiting for author to respond to maintainer's comments label Apr 7, 2026
@utafrali utafrali force-pushed the fix/issue-8289-bug-jaegermcp-search-traces-missing-vali branch from f4514f6 to 05a114e Compare April 9, 2026 20:28
@github-actions github-actions Bot removed the waiting-for-author PR is waiting for author to respond to maintainer's comments label Apr 9, 2026
@utafrali
Copy link
Copy Markdown
Contributor Author

utafrali commented Apr 9, 2026

on it, signing the commits now

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.64%. Comparing base (a1f5923) to head (05a114e).
⚠️ Report is 41 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8309      +/-   ##
==========================================
- Coverage   95.65%   95.64%   -0.02%     
==========================================
  Files         318      314       -4     
  Lines       16861    16507     -354     
==========================================
- Hits        16129    15788     -341     
+ Misses        578      567      -11     
+ Partials      154      152       -2     
Flag Coverage Δ
badger_direct 9.31% <ø> (+0.27%) ⬆️
badger_e2e 1.07% <ø> (+0.04%) ⬆️
cassandra-4.x-direct-manual 13.63% <ø> (+0.43%) ⬆️
cassandra-4.x-e2e-auto 1.06% <ø> (+0.04%) ⬆️
cassandra-4.x-e2e-manual 1.06% <ø> (+0.04%) ⬆️
cassandra-5.x-direct-manual 13.63% <ø> (+0.43%) ⬆️
cassandra-5.x-e2e-auto 1.06% <ø> (+0.04%) ⬆️
cassandra-5.x-e2e-manual 1.06% <ø> (+0.04%) ⬆️
clickhouse 1.20% <ø> (+0.04%) ⬆️
elasticsearch-6.x-direct 17.49% <ø> (+0.73%) ⬆️
elasticsearch-7.x-direct 17.53% <ø> (+0.73%) ⬆️
elasticsearch-8.x-direct 17.68% <ø> (+0.74%) ⬆️
elasticsearch-8.x-e2e 1.07% <ø> (+0.04%) ⬆️
elasticsearch-9.x-e2e 1.07% <ø> (+0.04%) ⬆️
grpc_direct 8.09% <ø> (+0.32%) ⬆️
grpc_e2e 1.07% <ø> (+0.04%) ⬆️
kafka-3.x-v2 1.07% <ø> (+0.04%) ⬆️
memory_v2 1.07% <ø> (+0.04%) ⬆️
opensearch-1.x-direct 17.57% <ø> (+0.73%) ⬆️
opensearch-2.x-direct 17.57% <ø> (+0.73%) ⬆️
opensearch-2.x-e2e 1.07% <ø> (+0.04%) ⬆️
opensearch-3.x-e2e 1.07% <ø> (+0.04%) ⬆️
query 1.07% <ø> (+0.04%) ⬆️
tailsampling-processor 0.54% <ø> (+0.02%) ⬆️
unittests 94.29% <100.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

CI Summary Report

Metrics Comparison

❌ 41 metric change(s) detected

View changed metrics

For label-level diff details, open the CI run and expand the "Compare metrics and generate summary" step logs.

metrics_snapshot_badger_e2e
1 added, 3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes
  • jaeger_storage_badger_write_pending_num_memtable

metrics_snapshot_cassandras_4.x_v004_e2e_auto
3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes

metrics_snapshot_cassandras_4.x_v004_e2e_manual
3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes

metrics_snapshot_cassandras_5.x_v004_e2e_auto
3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes

metrics_snapshot_cassandras_5.x_v004_e2e_manual
3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes

metrics_snapshot_clickhouse
3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes

metrics_snapshot_elasticsearch_8.x_e2e
3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes

metrics_snapshot_elasticsearch_9.x_e2e
3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes

metrics_snapshot_grpc_e2e
4 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes
  • rpc_client_call_duration_seconds

metrics_snapshot_kafka_v2
3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes

metrics_snapshot_memory
3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes

metrics_snapshot_opensearch_2.x
3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes

metrics_snapshot_opensearch_3.x
3 modified

  • http_server_request_body_size_bytes
  • http_server_request_duration_seconds
  • http_server_response_body_size_bytes

Code Coverage

❌ Coverage 96.8% (baseline 97%)

➡️ View CI run | View publish logs
2026-04-14 21:16:13 UTC

@yurishkuro yurishkuro merged commit 0322c8f into jaegertracing:main Apr 14, 2026
66 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: [jaegermcp] search_traces: missing validation when start_time_max is before start_time_min

3 participants