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

[exporter][batcher] MergedContext implemented with SpanLink #12318

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
10 changes: 6 additions & 4 deletions exporter/exporterhelper/internal/queue_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ func NewQueueSender(
}

q, err := newObsQueue(qSet, qf(context.Background(), qSet, qCfg, func(ctx context.Context, req request.Request, done exporterqueue.Done) {
// TODO: move start of span to enqueue instead to dequeue.
// Figure out how to preserve span context across persistent storage.
ctx, _ = metadata.Tracer(qSet.ExporterSettings.TelemetrySettings).Start(ctx, "exporter/enqueue")
done.OnDone(exportFunc(ctx, req))
trace.SpanFromContext(ctx).End()
}))
if err != nil {
return nil, err
Expand All @@ -129,7 +125,13 @@ func NewQueueSender(
// Have to read the number of items before sending the request since the request can
// be modified by the downstream components like the batcher.
itemsCount := req.ItemsCount()

// TODO: move start of span to enqueue instead to dequeue.
// Figure out how to preserve span context across persistent storage.
ctx, _ = metadata.Tracer(qSet.ExporterSettings.TelemetrySettings).Start(ctx, "exporter/enqueue")
err := next.Send(ctx, req)
trace.SpanFromContext(ctx).End()

if err != nil {
qSet.ExporterSettings.Logger.Error("Exporting failed. Dropping data."+exportFailureMessage,
zap.Error(err), zap.Int("dropped_items", itemsCount))
Expand Down
Loading