Skip to content

Commit

Permalink
Merge pull request #24 from quintoandar/format-spans
Browse files Browse the repository at this point in the history
Format spans
  • Loading branch information
pginca authored Feb 10, 2023
2 parents 5dfc6cd + ac6e092 commit 72dfba5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ function formatParams(params, module, funcCallerParam) {
if (tracer && tracer.currentRootSpan && tracer.currentRootSpan.traceId) {
const allDescendants = tracer.currentRootSpan.allDescendants().map((span) => span.id)
metadata.traceId = tracer.currentRootSpan.traceId;
metadata.spanIds = [tracer.currentRootSpan.parentSpanId, tracer.currentRootSpan.id, allDescendants].flat()
metadata.spans = {
parentSpanId: tracer.currentRootSpan.parentSpanId ? tracer.currentRootSpan.parentSpanId : null,
spanId: tracer.currentRootSpan.id,
descendants: allDescendants,
}
}

if (typeof params[0] === 'string') {
Expand Down

0 comments on commit 72dfba5

Please sign in to comment.