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

Rmpmp-242: Updated error logs on DLT write to include dlt topic name #10

Merged
merged 2 commits into from
Sep 3, 2024
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
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

This project adheres to Semantic Versioning.

## 1.0.1 (Sep 3, 2024)

1. Added dlt topic name in error logs on dlt write failure

## 1.0.0 (July 2024)

Initial release to public github.com
Expand Down
4 changes: 2 additions & 2 deletions workoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (d dltOption) apply(w *Work) {
// establish a writer to the DLT early, so when the time comes the write is fast
writer, err := w.kafkaProvider.Writer(ctx, d.dltConfig)
if err != nil {
w.logger.Errorw(ctx, "Failed to get writer for dlt", "error", err, "offset", message.Offset, "partition", message.Partition, "topic", message.Topic)
w.logger.Errorw(ctx, "Failed to get writer for dlt", "error", err, "offset", message.Offset, "partition", message.Partition, "source_topic", message.Topic, "dlt_topic", d.dltConfig.Topic)
return
}

Expand All @@ -136,7 +136,7 @@ func (d dltOption) apply(w *Work) {
}

if _, err := writer.WriteRaw(ctx, &message.Key, message.value); err != nil {
w.logger.Errorw(ctx, "Failed to forward to DLT", "error", err, "offset", message.Offset, "partition", message.Partition, "topic", message.Topic)
w.logger.Errorw(ctx, "Failed to forward to DLT", "error", err, "offset", message.Offset, "partition", message.Partition, "source_topic", message.Topic, "dlt_topic", d.dltConfig.Topic)
}
}
w.onDones = append(w.onDones, f)
Expand Down