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

Fault in SdkSpan.events #6244

Merged
merged 4 commits into from
Feb 24, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ final class SdkSpan implements ReadWriteSpan, ExtendedSpan {

// List of recorded events.
@GuardedBy("lock")
private final List<EventData> events;
@Nullable
private List<EventData> events; // faulted in
jkwatson marked this conversation as resolved.
Show resolved Hide resolved

// Number of events recorded.
@GuardedBy("lock")
Expand Down Expand Up @@ -126,7 +127,6 @@ private SdkSpan(
this.clock = clock;
this.startEpochNanos = startEpochNanos;
this.attributes = attributes;
this.events = new ArrayList<>();
this.spanLimits = spanLimits;
}

Expand Down Expand Up @@ -378,6 +378,9 @@ private void addTimedEvent(EventData timedEvent) {
logger.log(Level.FINE, "Calling addEvent() on an ended Span.");
return;
}
if (events == null) {
events = new ArrayList<>();
}
if (events.size() < spanLimits.getMaxNumberOfEvents()) {
events.add(timedEvent);
}
Expand Down Expand Up @@ -518,7 +521,7 @@ long getStartEpochNanos() {

@GuardedBy("lock")
private List<EventData> getImmutableTimedEvents() {
if (events.isEmpty()) {
if (events == null) {
return Collections.emptyList();
}

Expand Down