Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: timerange selected for traces to logs (#6634)

Vikrant Gupta8608f02263ce
diff --git a/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsx b/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsx
index d8eb1a6972..fadbf15f21 100644
--- a/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsx
+++ b/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsx
@@ -86,8 +86,10 @@ function SelectedSpanDetails(props: SelectedSpanDetailsProps): JSX.Element {
history.push(
`${ROUTES.LOGS_EXPLORER}?${createQueryParams({
[QueryParams.compositeQuery]: JSON.stringify(query),
- [QueryParams.startTime]: minTime,
- [QueryParams.endTime]: maxTime,
+ // 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,
})}`,
);
};