Skip to content

Commit

Permalink
Merge pull request #1001 from AM-i-B-V/xray-parent-id-fix
Browse files Browse the repository at this point in the history
Add parent_id to JsonObject in XRaySpan
  • Loading branch information
mpilquist authored Apr 29, 2024
2 parents be8822d + bc4ce91 commit a5ff500
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/xray/src/main/scala/natchez/xray/XRaySpan.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ private[xray] final case class XRaySpan[F[_]: Concurrent: Clock: Random](
"trace_id" -> xrayTraceId.asJson,
"subsegments" -> cs.reverse.map(Json.fromJsonObject).asJson,
"annotations" -> allAnnotations.asJson,
"parent_id" -> parent
.map(p => p.fold(_.asJson, p => p.segmentId.asJson))
.getOrElse(Json.fromJsonObject(JsonObject.empty)),
"metadata" -> JsonObject(
"links" -> options.links.asJson,
"span.kind" -> options.spanKind.asJson
Expand Down

0 comments on commit a5ff500

Please sign in to comment.