Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions test/e2e/benchmark/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ type traceResult struct {
// resource attributes extracted from trace spans (OTEL_RESOURCE_ATTRIBUTES).
evNodeAttrs *resourceAttrs
evRethAttrs *resourceAttrs

// tracesURL is a link to the trace UI for the ev-node service.
tracesURL string
}

// displayFlowcharts renders ASCII flowcharts from rich spans. Falls back to
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/benchmark/run_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type runResult struct {
Metrics runMetrics `json:"metrics"`
BlockRange runBlockRange `json:"block_range"`
Spamoor *runSpamoorStats `json:"spamoor,omitempty"`
TracesURL string `json:"traces_url,omitempty"`
FieldDescriptions map[string]string `json:"field_descriptions"`
}

Expand Down Expand Up @@ -195,6 +196,7 @@ func buildRunResult(cfg benchConfig, br *benchmarkResult, wallClock time.Duratio
NonEmpty: br.bm.BlockCount,
},
Spamoor: spamoor,
TracesURL: br.traces.tracesURL,
FieldDescriptions: fieldDescriptions(),
}
}
Expand Down Expand Up @@ -306,5 +308,7 @@ func fieldDescriptions() map[string]string {

"spamoor.sent": "total txs successfully sent by spamoor",
"spamoor.failed": "total txs that failed",

"traces_url": "VMUI link to view ev-node traces for this benchmark run",
}
}
3 changes: 2 additions & 1 deletion test/e2e/benchmark/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ func (s *SpamoorSuite) collectTraces(e *env) *traceResult {
evReth: e.traces.tryCollectSpans(ctx, e.evRethServiceName),
}

if link := e.traces.uiURL(e.evNodeServiceName); link != "" {
if link := e.traces.uiURL(e.evNodeServiceName, time.Now()); link != "" {
t.Logf("traces UI: %s", link)
tr.tracesURL = link
}

if rc, ok := e.traces.(richSpanCollector); ok {
Expand Down
12 changes: 7 additions & 5 deletions test/e2e/benchmark/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type traceProvider interface {
collectSpans(ctx context.Context, serviceName string) ([]e2e.TraceSpan, error)
tryCollectSpans(ctx context.Context, serviceName string) []e2e.TraceSpan
// uiURL returns a link to view traces for the given service, or empty string if not available.
uiURL(serviceName string) string
uiURL(serviceName string, end time.Time) string
// resetStartTime sets the trace collection window start to now.
resetStartTime()
}
Expand Down Expand Up @@ -64,13 +64,15 @@ func (v *victoriaTraceProvider) resetStartTime() {
v.startTime = time.Now()
}

func (v *victoriaTraceProvider) uiURL(serviceName string) string {
func (v *victoriaTraceProvider) uiURL(serviceName string, end time.Time) string {
query := fmt.Sprintf(`_stream:{resource_attr:service.name="%s"}`, serviceName)
return fmt.Sprintf("%s/select/vmui/#/query?query=%s&start=%s&end=%s",
rangeInput := end.Sub(v.startTime).Round(time.Second).String()
endInput := end.UTC().Format("2006-01-02T15:04:05")
return fmt.Sprintf("%s/select/vmui/?#/?g0.expr=%s&g0.range_input=%s&g0.end_input=%s",
strings.TrimRight(v.queryURL, "/"),
neturl.QueryEscape(query),
v.startTime.Format(time.RFC3339),
time.Now().Format(time.RFC3339))
rangeInput,
endInput)
}

func (v *victoriaTraceProvider) collectSpans(ctx context.Context, serviceName string) ([]e2e.TraceSpan, error) {
Expand Down
Loading