fix: adjust the buffer time for start and end time in trace to logs (#6953)

This commit is contained in:
Shaheer Kochai 2025-01-28 11:02:28 +04:30 committed by GitHub
parent 35c61045c4
commit 8cb8beb63f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,8 @@ import Events from './Events';
import { CardContainer, CustomSubText, styles } from './styles';
import Tags from './Tags';
const FIVE_MINUTES_IN_MS = 5 * 60 * 1000;
function SelectedSpanDetails(props: SelectedSpanDetailsProps): JSX.Element {
const { maxTime, minTime } = useSelector<AppState, GlobalReducer>(
(state) => state.globalTime,
@ -86,10 +88,10 @@ function SelectedSpanDetails(props: SelectedSpanDetailsProps): JSX.Element {
history.push(
`${ROUTES.LOGS_EXPLORER}?${createQueryParams({
[QueryParams.compositeQuery]: JSON.stringify(query),
// we subtract 1000 milliseconds from the start time to handle the cases when the trace duration is in nanoseconds
[QueryParams.startTime]: traceStartTime - 1000,
// we add 1000 milliseconds to the end time for nano second duration traces
[QueryParams.endTime]: traceEndTime + 1000,
// we subtract 5 minutes from the start time to handle the cases when the trace duration is in nanoseconds
[QueryParams.startTime]: traceStartTime - FIVE_MINUTES_IN_MS,
// we add 5 minutes to the end time for nano second duration traces
[QueryParams.endTime]: traceEndTime + FIVE_MINUTES_IN_MS,
})}`,
);
};