Skip to content

Commit

Permalink
Define how trace/span ids are retrieved (#836)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Aug 24, 2020
1 parent cbcf409 commit 10420d5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions specification/trace/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Table of Contents
* [Tracer](#tracer)
* [Tracer operations](#tracer-operations)
* [SpanContext](#spancontext)
* [Retrieving the TraceId and SpanId](#retrieving-the-traceid-and-spanid)
* [IsValid](#isvalid)
* [IsRemote](#isremote)
* [Span](#span)
Expand Down Expand Up @@ -181,6 +182,18 @@ systems to participate in the same trace. Please review the [W3C
specification](https://www.w3.org/TR/trace-context/#tracestate-header) for
details on this field.

### Retrieving the TraceId and SpanId

The API must allow retrieving the `TraceId` and `SpanId` in the following forms:

* Hex - returns the lowercase [hex encoded](https://tools.ietf.org/html/rfc4648#section-8)
`TraceId` (result MUST be a 32-hex-character lowercase string) or `SpanId`
(result MUST be a 16-hex-character lowercase string).
* Binary - returns the binary representation of the `TraceId` (result MUST be a
16-byte array) `SpanId` (result MUST be a 8-byte array).

The API should not expose details about how they are internally stored.

### IsValid

An API that returns a boolean value, which is `true` if the SpanContext has a
Expand Down

0 comments on commit 10420d5

Please sign in to comment.