@@ -35,7 +35,7 @@ type traceProvider interface {
3535 collectSpans (ctx context.Context , serviceName string ) ([]e2e.TraceSpan , error )
3636 tryCollectSpans (ctx context.Context , serviceName string ) []e2e.TraceSpan
3737 // uiURL returns a link to view traces for the given service, or empty string if not available.
38- uiURL (serviceName string ) string
38+ uiURL (serviceName string , end time. Time ) string
3939 // resetStartTime sets the trace collection window start to now.
4040 resetStartTime ()
4141}
@@ -64,13 +64,15 @@ func (v *victoriaTraceProvider) resetStartTime() {
6464 v .startTime = time .Now ()
6565}
6666
67- func (v * victoriaTraceProvider ) uiURL (serviceName string ) string {
67+ func (v * victoriaTraceProvider ) uiURL (serviceName string , end time. Time ) string {
6868 query := fmt .Sprintf (`_stream:{resource_attr:service.name="%s"}` , serviceName )
69- return fmt .Sprintf ("%s/select/vmui/#/query?query=%s&start=%s&end=%s" ,
69+ rangeInput := end .Sub (v .startTime ).Round (time .Second ).String ()
70+ endInput := end .UTC ().Format ("2006-01-02T15:04:05" )
71+ return fmt .Sprintf ("%s/select/vmui/?#/?g0.expr=%s&g0.range_input=%s&g0.end_input=%s" ,
7072 strings .TrimRight (v .queryURL , "/" ),
7173 neturl .QueryEscape (query ),
72- v . startTime . Format ( time . RFC3339 ) ,
73- time . Now (). Format ( time . RFC3339 ) )
74+ rangeInput ,
75+ endInput )
7476}
7577
7678func (v * victoriaTraceProvider ) collectSpans (ctx context.Context , serviceName string ) ([]e2e.TraceSpan , error ) {
0 commit comments