Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,26 @@ public SentryProducerInterceptor(final @NotNull IScopes scopes) {
return record;
}

final @NotNull SpanOptions spanOptions = new SpanOptions();
spanOptions.setOrigin(TRACE_ORIGIN);
final @NotNull ISpan span = activeSpan.startChild("queue.publish", record.topic(), spanOptions);
if (span.isNoOp()) {
return record;
}
try {
final @NotNull SpanOptions spanOptions = new SpanOptions();
spanOptions.setOrigin(TRACE_ORIGIN);
final @NotNull ISpan span =
activeSpan.startChild("queue.publish", record.topic(), spanOptions);
if (span.isNoOp()) {
return record;
}

span.setData(SpanDataConvention.MESSAGING_SYSTEM, "kafka");
span.setData(SpanDataConvention.MESSAGING_DESTINATION_NAME, record.topic());
span.setData(SpanDataConvention.MESSAGING_SYSTEM, "kafka");
span.setData(SpanDataConvention.MESSAGING_DESTINATION_NAME, record.topic());

try {
injectHeaders(record.headers(), span);

span.setStatus(SpanStatus.OK);
span.finish();
} catch (Throwable ignored) {
Comment thread
adinauer marked this conversation as resolved.
// Header injection must not break the send
// Instrumentation must never break the customer's Kafka send
Comment thread
adinauer marked this conversation as resolved.
}

span.setStatus(SpanStatus.OK);
span.finish();

Comment thread
adinauer marked this conversation as resolved.
return record;
}

Expand Down
Loading