Skip to content

Commit

Permalink
crosscluster/producer: tag job id/ dest node/ dest proc in event stream
Browse files Browse the repository at this point in the history
Epic: none

Release note: none
  • Loading branch information
msbutler committed Sep 21, 2024
1 parent cbc4418 commit f8b5c8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/ccl/crosscluster/producer/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ go_library(
"//pkg/util/tracing",
"//pkg/util/uuid",
"@com_github_cockroachdb_errors//:errors",
"@com_github_cockroachdb_logtags//:logtags",
"@com_github_golang_snappy//:snappy",
],
)
Expand Down
4 changes: 4 additions & 0 deletions pkg/ccl/crosscluster/producer/event_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/util/syncutil"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
"github.com/cockroachdb/errors"
"github.com/cockroachdb/logtags"
"github.com/golang/snappy"
)

Expand Down Expand Up @@ -105,6 +106,9 @@ func (s *eventStream) Start(ctx context.Context, txn *kv.Txn) (retErr error) {
// false. However, this generator never terminates without an error,
// so this method should be called once. Be defensive and return an error
// if this method is called again.
ctx = logtags.AddTag(ctx, "id", s.streamID)
ctx = logtags.AddTag(ctx, "dst-node", s.spec.ConsumerNode)
ctx = logtags.AddTag(ctx, "dst-proc", s.spec.ConsumerProc)
if s.errCh != nil {
return errors.AssertionFailedf("expected to be started once")
}
Expand Down

0 comments on commit f8b5c8c

Please sign in to comment.