Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cdc: use int64 for emitted bytes telemetry #98575

Merged
merged 1 commit into from
Mar 14, 2023
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
8 changes: 4 additions & 4 deletions pkg/ccl/changefeedccl/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ func (ptl *periodicTelemetryLogger) recordEmittedBytes(numBytes int) {
ptl.sinkTelemetryData.emittedBytes.Add(int64(numBytes))
}

func (ptl *periodicTelemetryLogger) resetEmittedBytes() int {
return int(ptl.sinkTelemetryData.emittedBytes.Swap(0))
func (ptl *periodicTelemetryLogger) resetEmittedBytes() int64 {
return ptl.sinkTelemetryData.emittedBytes.Swap(0)
}

// recordEmittedBytes implements the telemetryLogger interface.
Expand All @@ -96,7 +96,7 @@ func (ptl *periodicTelemetryLogger) maybeFlushLogs() {
continuousTelemetryEvent := &eventpb.ChangefeedEmittedBytes{
CommonChangefeedEventDetails: ptl.changefeedDetails,
JobId: int64(ptl.job.ID()),
EmittedBytes: int32(ptl.resetEmittedBytes()),
EmittedBytes: ptl.resetEmittedBytes(),
LoggingInterval: loggingInterval,
}
log.StructuredEvent(ptl.ctx, continuousTelemetryEvent)
Expand All @@ -111,7 +111,7 @@ func (ptl *periodicTelemetryLogger) close() {
continuousTelemetryEvent := &eventpb.ChangefeedEmittedBytes{
CommonChangefeedEventDetails: ptl.changefeedDetails,
JobId: int64(ptl.job.ID()),
EmittedBytes: int32(ptl.resetEmittedBytes()),
EmittedBytes: ptl.resetEmittedBytes(),
LoggingInterval: loggingInterval,
Closing: true,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/log/eventpb/telemetry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ message ChangefeedEmittedBytes {
int64 job_id = 2 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "redact:\"nonsensitive\""];

// The number of bytes emitted.
int32 emitted_bytes = 3 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "redact:\"nonsensitive\""];
int64 emitted_bytes = 3 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "redact:\"nonsensitive\""];

// The time period in nanoseconds between emitting telemetry events of this type (per-aggregator).
int64 logging_interval = 4 [(gogoproto.jsontag) = ",omitempty", (gogoproto.moretags) = "redact:\"nonsensitive\""];
Expand Down