Skip to content

improvement: accept rfc3339/humantime mix for start and end time - #1771

Open
nikhilsinhaparseable wants to merge 1 commit into
parseablehq:mainfrom
nikhilsinhaparseable:humantime-mix
Open

improvement: accept rfc3339/humantime mix for start and end time#1771
nikhilsinhaparseable wants to merge 1 commit into
parseablehq:mainfrom
nikhilsinhaparseable:humantime-mix

Conversation

@nikhilsinhaparseable

@nikhilsinhaparseable nikhilsinhaparseable commented Aug 26, 2026

Copy link
Copy Markdown
Member

mixed time support affects -
/api/v1/query
/api/v1/counts
/api/v1/query/context — explicit contextStartTime/contextEndTime
/api/prism/v1/services/traces/{list,detail}

Summary by CodeRabbit

  • New Features

    • Added support for relative time expressions such as now, now-1h, and now+30m in queries and log context time ranges.
    • Start times can also use bare duration shorthand.
    • Relative and absolute timestamps can be combined within the same time range.
  • Bug Fixes

    • Improved time validation and error reporting for invalid or out-of-range expressions.
    • Ensured calculated time ranges use consistent millisecond precision.

mixed time support affects -
/api/v1/query
/api/v1/counts
/api/v1/query/context — explicit contextStartTime/contextEndTime
/api/prism/v1/services/traces/{list,detail}
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c873cec5-17fd-462a-9e61-c0f68c1cc4b9

📥 Commits

Reviewing files that changed from the base of the PR and between e8916cc and 550fbfe.

📒 Files selected for processing (3)
  • src/handlers/http/query.rs
  • src/handlers/http/query_context.rs
  • src/utils/time.rs

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


Walkthrough

The PR adds shared parsing for RFC 3339, now, relative offsets, and start-only durations. HTTP query and explicit log-context bounds use the new parsers with shared reference times, range validation, field-specific errors, and tests.

Changes

Relative time support

Layer / File(s) Summary
Time expression parser and error model
src/utils/time.rs
Adds TimeExpressionError, start/end-specific TimeParseError variants, shared-reference parsing, checked offset arithmetic, and tests for valid, invalid, and overflowing expressions.
Explicit log-context bounds
src/handlers/http/query_context.rs
Parses relative start and end bounds before legacy timestamp fallback, validates their range, and tests mixed absolute and relative bounds.
Ingestor query end-time handling
src/handlers/http/query.rs
Uses parse_time_expression with the current UTC time to resolve transformed query end times.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 550fb

The change broadens accepted time formats for the listed query and trace APIs, and no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: parmesant

Poem

A rabbit checks the ticking time,
With offsets neat and errors fine.
Start bounds hop, end bounds align,
Shared clocks keep the tests in line.
Queries thump a happy chime.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description identifies the affected endpoints but omits the required description of the goal, solution and rationale, key changes, issue reference handling, and checklist status. Add the required Description section with the PR goal, chosen solution and rationale, and key implementation changes. Replace Fixes #XXXX with the correct issue reference or remove it if no issue applies. Complete the testing, comments, and…
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: support for mixing RFC3339 and human-readable time formats for start and end parameters.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Resolution

Add the required Description section with the PR goal, chosen solution and rationale, and key implementation changes. Replace Fixes #XXXX with the correct issue reference or remove it if no issue applies. Complete the testing, comments, and documentation checklist items, and include relevant details for each item.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant