-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce SpanContext for distributed tracing (#74)
* Introduce SpanContext for distributed tracing * Send SpanContext to the Sender along with the spans * Remove Logger messages that would commonly appear in testing * Don't wait for as long for absence of traces * Send a Trace to the Sender instead of a list of Spans and a SpanContext
- Loading branch information
1 parent
89f852b
commit 42dd125
Showing
11 changed files
with
154 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
defmodule Spandex.SpanContext do | ||
@moduledoc """ | ||
From the [OpenTracing specification]: | ||
> Each SpanContext encapsulates the following state: | ||
> * Any OpenTracing-implementation-dependent state (for example, trace and span ids) needed to refer to a distinct Span across a process boundary | ||
> * Baggage Items, which are just key:value pairs that cross process boundaries | ||
[OpenTracing specification]: https://github.com/opentracing/specification/blob/master/specification.md | ||
""" | ||
|
||
@typedoc @moduledoc | ||
@type t :: %__MODULE__{ | ||
trace_id: Spandex.id(), | ||
parent_id: Spandex.id(), | ||
priority: integer(), | ||
baggage: Keyword.t() | ||
} | ||
|
||
defstruct trace_id: nil, | ||
parent_id: nil, | ||
priority: 1, | ||
baggage: [] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.