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

Support for single tracing for batch producing #4

Open
Abdulsametileri opened this issue Oct 5, 2023 · 0 comments
Open

Support for single tracing for batch producing #4

Abdulsametileri opened this issue Oct 5, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Abdulsametileri
Copy link
Member

Abdulsametileri commented Oct 5, 2023

func (w *Writer) WriteMessage(ctx context.Context, msg kafka.Message) error {
	span := w.startSpan(ctx, &msg)
	err := w.W.WriteMessages(ctx, msg)
	if err != nil {
		span.RecordError(err)
		span.SetStatus(codes.Error, err.Error())
	}
	span.End()
	return err
}

func (w *Writer) WriteMessages(ctx context.Context, msgs []kafka.Message) error {
	return w.W.WriteMessages(ctx, msgs...)
}

We need to think about how to manage the span during batch producing. Maybe we can extract all related headers beforehand and publish them.

@Abdulsametileri Abdulsametileri added the enhancement New feature or request label Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant