Skip to content

Commit

Permalink
Merge pull request #39589 from michalvavrik/feature/otel-security-eve…
Browse files Browse the repository at this point in the history
…nts-span-must-be-recording

Only Add OTel Security Events when span is recording
  • Loading branch information
geoand authored Mar 21, 2024
2 parents 3650cb4 + 70b5979 commit a949acb
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 a949acb

Please sign in to comment.