Skip to content

Commit

Permalink
Merge branch 'mdalmamun/Add-attributes-length-SpanLimit' of https://g…
Browse files Browse the repository at this point in the history
…ithub.com/mamunto/opentelemetry-swift into mdalmamun/Add-attributes-length-SpanLimit

# Conflicts:
#	Sources/OpenTelemetrySdk/Trace/SpanLimits.swift
  • Loading branch information
mamunto committed Nov 7, 2024
2 parents ad03f89 + ef0d208 commit aa7daf9
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions Sources/OpenTelemetrySdk/Trace/RecordEventsReadableSpan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,26 +195,28 @@ public class RecordEventsReadableSpan: ReadableSpan {
}

public func toSpanData() -> SpanData {
return SpanData(traceId: context.traceId,
spanId: context.spanId,
traceFlags: context.traceFlags,
traceState: context.traceState,
parentSpanId: parentContext?.spanId,
resource: resource,
instrumentationScope: instrumentationScopeInfo,
name: name,
kind: kind,
startTime: startTime,
attributes: attributes.attributes,
events: adaptEvents(),
links: adaptLinks(),
status: status,
endTime: endTime ?? clock.now,
hasRemoteParent: hasRemoteParent,
hasEnded: hasEnded,
totalRecordedEvents: getTotalRecordedEvents(),
totalRecordedLinks: totalRecordedLinks,
totalAttributeCount: totalAttributeCount)
attributesSyncLock.withLock {
return SpanData(traceId: context.traceId,
spanId: context.spanId,
traceFlags: context.traceFlags,
traceState: context.traceState,
parentSpanId: parentContext?.spanId,
resource: resource,
instrumentationScope: instrumentationScopeInfo,
name: name,
kind: kind,
startTime: startTime,
attributes: attributes.attributes,
events: adaptEvents(),
links: adaptLinks(),
status: status,
endTime: endTime ?? clock.now,
hasRemoteParent: hasRemoteParent,
hasEnded: hasEnded,
totalRecordedEvents: getTotalRecordedEvents(),
totalRecordedLinks: totalRecordedLinks,
totalAttributeCount: totalAttributeCount)
}
}

private func adaptEvents() -> [SpanData.Event] {
Expand Down

0 comments on commit aa7daf9

Please sign in to comment.