opentracing-0.3.0: OpenTracing for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

OpenTracing.Span

Description

Data types and functions for manipulating spans

Synopsis

Documentation

data SpanContext Source #

A SpanContext is the data that uniquely identifies a span and the context in which it occurs. Spans occur in traces, which form complete pictures of a computation, potentially across multiple machines.

Since: 0.1.0.0

Constructors

SpanContext 

Fields

data Span Source #

Span is a span that has been started (but not finished). See the OpenTracing spec for more info

Since: 0.1.0.0

newSpan :: (MonadIO m, Foldable t) => SpanContext -> Text -> SpanRefs -> t Tag -> m Span Source #

Create a new Span with the provided info. The created Span will have a start time equal to the system time when newSpan is called.

Since: 0.1.0.0

data ActiveSpan Source #

A mutable Span that is currently being recorded.

Since: 0.1.0.0

mkActive :: MonadIO m => Span -> m ActiveSpan Source #

Since: 0.1.0.0

modifyActiveSpan :: MonadIO m => ActiveSpan -> (Span -> Span) -> m () Source #

Since: 0.1.0.0

readActiveSpan :: MonadIO m => ActiveSpan -> m Span Source #

Since: 0.1.0.0

addTag :: MonadIO m => ActiveSpan -> Tag -> m () Source #

addLogRecord :: MonadIO m => ActiveSpan -> LogField -> m () Source #

Log structured data to an ActiveSpan. More info in the OpenTracing spec

Since: 0.1.0.0

spanFinish :: MonadIO m => Span -> m FinishedSpan Source #

Convert an unfinished Span into a FinishedSpan

Since: 0.1.0.0

spanRefs :: HasRefs s a => Lens' s a Source #

data SpanOpts Source #

SpanOpts is the metadata information about a span needed in order to start measuring a span. This is the information that application code will provide in order to indicate what a span is doing and how it related to other spans. More info in the OpenTracing spec

Since: 0.1.0.0

spanOpts :: Text -> SpanRefs -> SpanOpts Source #

Create a new SpanOpts with the minimal amount of required information.

Since: 0.1.0.0

data Reference Source #

A reference from one span to another. Spans can be related in two ways:

  • ChildOf indicates that the parent span is dependent on the child span in order to produce its own result.
  • FollowsFrom indicates that there is no dependence relation, perhaps the parent span spawned an asynchronous task.

More info in the OpenTracing spec

Since: 0.1.0.0

Constructors

ChildOf 

Fields

FollowsFrom 

Fields

data SpanRefs Source #

The different references that a span can hold to other spans.

Since: 0.1.0.0

Instances

Instances details
Monoid SpanRefs Source # 
Instance details

Defined in OpenTracing.Span

Semigroup SpanRefs Source # 
Instance details

Defined in OpenTracing.Span

childOf :: ActiveSpan -> SpanRefs Source #

Create a SpanRefs containing the single refrence to a parent span.

Since: 0.1.0.0

followsFrom :: FinishedSpan -> SpanRefs Source #

Create a SpanRefs containing the single refrence to a predecessor span.

Since: 0.1.0.0

freezeRefs :: SpanRefs -> IO [Reference] Source #

Convert SpanRefs (which may include the mutable ActiveSpans) into an immutable list of References

Since: 0.1.0.0

data Sampled Source #

A datatype indicating whether a recorded span was sampled, i.e. whether or not it will be reported. Traces are often sampled in high volume environments to keep the amount of data generated manageable.

Since: 0.1.0.0

Constructors

NotSampled 
Sampled 

Instances

Instances details
ToJSON Sampled Source # 
Instance details

Defined in OpenTracing.Span

Bounded Sampled Source # 
Instance details

Defined in OpenTracing.Span

Enum Sampled Source # 
Instance details

Defined in OpenTracing.Span

Read Sampled Source # 
Instance details

Defined in OpenTracing.Span

Show Sampled Source # 
Instance details

Defined in OpenTracing.Span

Eq Sampled Source # 
Instance details

Defined in OpenTracing.Span

Methods

(==) :: Sampled -> Sampled -> Bool #

(/=) :: Sampled -> Sampled -> Bool #

sampled :: HasSampled a => Lens' a Sampled Source #

data Traced a Source #

A wrapper for a value that was produced by a traced computation.

Since: 0.1.0.0

Constructors

Traced 

Fields