Skip to content

Commit

Permalink
Merge 25c003a
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel-Darbord committed Jul 14, 2024
2 parents 94263a5 + 25c003a commit e00439c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/OpenTelemetry-Instrumentation/OTSpan.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,35 @@ OTSpan class >> current [
^ Current
]

{ #category : 'recording' }
OTSpan class >> fromSton: stonReader [
"enumeration"

| span representation |
span := self new.
representation := stonReader parseMapOrListRepresentation.
span instVarNamed: #spanId put: (representation at: #spanId).
span instVarNamed: #traceId put: (representation at: #traceId).
span name: (representation at: #name).
span context: (representation at: #context).
span kind: (representation at: #kind).
span startTime: (representation at: #startTime).
span endTime: (representation at: #endTime).
span status: (representation at: #status).
span instrumentationName: (representation at: #instrumentationName).
representation
at: #parentId
ifPresent: [ :parentId | "self allInstances detect: [ :s | s spanId = parentId ]"
].
representation
at: #attributes
ifPresent: [ :attributes | span attributes: attributes ].
representation
at: #events
ifPresent: [ :events | span events: events ].
^ span
]

{ #category : 'enumeration' }
OTSpan class >> internal [
"Default value. Indicates that the span is used internally."
Expand Down

0 comments on commit e00439c

Please sign in to comment.