Skip to content

Commit

Permalink
roachtest: mixedversion test steps are annotated in grafana
Browse files Browse the repository at this point in the history
Now that we have the ability to create grafana annotations
in roachtests, we can annotate each mixed version step
in grafana.
  • Loading branch information
DarrylWong committed Mar 6, 2024
1 parent c0887b4 commit a3c8642
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/cmd/roachtest/roachtestutil/mixedversion/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ go_library(
importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil/mixedversion",
visibility = ["//visibility:public"],
deps = [
"//pkg/cmd/roachprod/grafana",
"//pkg/cmd/roachtest/cluster",
"//pkg/cmd/roachtest/option",
"//pkg/cmd/roachtest/roachtestutil",
Expand Down
8 changes: 8 additions & 0 deletions pkg/cmd/roachtest/roachtestutil/mixedversion/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"text/tabwriter"
"time"

"github.com/cockroachdb/cockroach/pkg/cmd/roachprod/grafana"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/cluster"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/option"
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/roachtestutil/clusterupgrade"
Expand Down Expand Up @@ -242,6 +243,13 @@ func (tr *testRunner) runSingleStep(ctx context.Context, ss *singleStep, l *logg
defer func() {
prefix := fmt.Sprintf("FINISHED [%s]", timeutil.Since(start))
tr.logStep(prefix, ss, l)
annotation := fmt.Sprintf("(%d): %s", ss.ID, ss.impl.Description())
_, err := tr.cluster.AddGrafanaAnnotation(tr.ctx, tr.logger, false /*internal*/, grafana.AddAnnotationRequest{
Text: annotation, StartTime: start.UnixMilli(), EndTime: timeutil.Now().UnixMilli(),
})
if err != nil {
l.Printf("Adding Grafana annotation failed: %s", err)
}
}()

if err := panicAsError(l, func() error {
Expand Down

0 comments on commit a3c8642

Please sign in to comment.