Skip to content

Commit

Permalink
Only Add OTel Security Events when span is recording
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik committed Mar 20, 2024
1 parent cf0c0ce commit 70b5979
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void accept(String key, Object value) {

private static void addEvent(String eventName, Attributes attributes) {
Span span = Arc.container().select(Span.class).get();
if (span.getSpanContext().isValid()) {
if (span.getSpanContext().isValid() && span.isRecording()) {
span.addEvent(eventName, attributes, Instant.now());
}
}
Expand Down

0 comments on commit 70b5979

Please sign in to comment.