-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
chore(trace explorer): Use agentic search endpoint #105583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| if (resultStart && resultEnd) { | ||
| // Strip 'Z' suffix to treat UTC dates as local time | ||
| const startLocal = resultStart.endsWith('Z') | ||
| ? resultStart.slice(0, -1) | ||
| : resultStart; | ||
| const endLocal = resultEnd.endsWith('Z') ? resultEnd.slice(0, -1) : resultEnd; | ||
| start = new Date(startLocal).toISOString(); | ||
| end = new Date(endLocal).toISOString(); |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
nsdeschenes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small nit, and one thing that may be consolidated, rest is looking amazing!
🚀 🌔
| const startLocal = start.endsWith('Z') ? start.slice(0, -1) : start; | ||
| const endLocal = end.endsWith('Z') ? end.slice(0, -1) : end; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may be able to "translate" this to local using moment, as we use the moment-timezone package 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, realizing ill have to do a few follow ups here as I need to make the Seer endpoint timezone aware. Right not it just assumes everything is UTC which is why I stripped the Z but that was a bandaid solution. Will update to moment then do a follow up after
| function formatDateRangeForText(start: string, end: string): string { | ||
| // Treat UTC dates as local dates by removing the 'Z' suffix | ||
| const startLocal = start.endsWith('Z') ? start.slice(0, -1) : start; | ||
| const endLocal = end.endsWith('Z') ? end.slice(0, -1) : end; | ||
|
|
||
| const startDate = new Date(startLocal); | ||
| const endDate = new Date(endLocal); | ||
|
|
||
| // Check if times are at midnight (date-only range) | ||
| const startIsMidnight = | ||
| startDate.getHours() === 0 && | ||
| startDate.getMinutes() === 0 && | ||
| startDate.getSeconds() === 0; | ||
| const endIsMidnight = | ||
| endDate.getHours() === 0 && endDate.getMinutes() === 0 && endDate.getSeconds() === 0; | ||
| const endIsEndOfDay = | ||
| endDate.getHours() === 23 && | ||
| endDate.getMinutes() === 59 && | ||
| endDate.getSeconds() === 59; | ||
|
|
||
| const useDateOnly = startIsMidnight && (endIsMidnight || endIsEndOfDay); | ||
|
|
||
| const dateOptions: Intl.DateTimeFormatOptions = { | ||
| month: 'short', | ||
| day: 'numeric', | ||
| year: 'numeric', | ||
| }; | ||
|
|
||
| const dateTimeOptions: Intl.DateTimeFormatOptions = { | ||
| month: 'short', | ||
| day: 'numeric', | ||
| year: 'numeric', | ||
| hour: 'numeric', | ||
| minute: '2-digit', | ||
| }; | ||
|
|
||
| const formatOptions = useDateOnly ? dateOptions : dateTimeOptions; | ||
|
|
||
| const startFormatted = startDate.toLocaleString('en-US', formatOptions); | ||
| const endFormatted = endDate.toLocaleString('en-US', formatOptions); | ||
|
|
||
| return `${startFormatted} to ${endFormatted}`; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like the same function in askSeerCombobox/queryTokens.tsx, can they be consolidated into a single function here in utils, and imported into queryTokens?
- Use agentic search endpoint for translation for internal use instead of the one shot workflow - Update to support start/end - Don't show time if beginning to end of day <img width="2483" height="709" alt="Screenshot 2026-01-02 at 12 52 02 PM" src="https://github.com/user-attachments/assets/413c6e0f-9149-4f00-94eb-965cef38e554" /> <img width="1892" height="577" alt="Screenshot 2026-01-02 at 12 52 06 PM" src="https://github.com/user-attachments/assets/ec6408d2-68dc-45d0-b710-7b4b97071eb9" /> <img width="1848" height="531" alt="Screenshot 2026-01-02 at 12 52 13 PM" src="https://github.com/user-attachments/assets/6413fec0-8c3d-412d-b9ee-fbbe5471547f" /> <img width="1746" height="256" alt="Screenshot 2026-01-02 at 12 52 39 PM" src="https://github.com/user-attachments/assets/e4c6e080-52c0-4997-936f-49e2162d4adf" /> <img width="1251" height="547" alt="Screenshot 2026-01-02 at 12 52 45 PM" src="https://github.com/user-attachments/assets/d75c2945-48a2-477f-82ee-fc0040981890" />
Uh oh!
There was an error while loading. Please reload this page.