tracing-0.0.1.2: Distributed tracing

Safe HaskellNone
LanguageHaskell2010

Monitor.Tracing.Zipkin

Contents

Description

Zipkin trace publisher.

Synopsis

Set up the trace collector

data Zipkin Source #

A Zipkin trace publisher.

new :: MonadIO m => Settings -> m Zipkin Source #

Creates a Zipkin publisher for the input Settings.

data Settings Source #

Zipkin creating settings.

Constructors

Settings 

Fields

defaultSettings :: Settings Source #

Creates Settings pointing to a Zikpin server at host "localhost" and port 9411, without background flushing.

data Endpoint Source #

Information about a hosted service.

defaultEndpoint :: Endpoint Source #

An empty endpoint.

run :: Zipkin -> TraceT m a -> m a Source #

Runs a TraceT action, sampling spans appropriately. Note that this method does not publish spans on its own; to do so, either call publish manually or specify a positive settingsPublishPeriod to publish in the background.

publish :: MonadIO m => Zipkin -> m () Source #

Flushes all complete spans to the Zipkin server. This method is thread-safe.

with :: MonadUnliftIO m => Settings -> (Zipkin -> m a) -> m a Source #

Convenience method to start a Zipkin, run an action, and publish all spans before returning.

Record in-process spans

rootSpan :: MonadTrace m => Sampling -> Name -> m a -> m a Source #

Starts a new trace.

data Sampling Source #

The sampling applied to a trace.

Note that non-sampled traces still yield active spans. However these spans are not published to Zipkin.

Constructors

Accept

Sample it.

Debug

Sample it and mark it as debug.

Deny

Do not sample it.

localSpan :: MonadTrace m => Name -> m a -> m a Source #

Continues an existing trace if present, otherwise does nothing.

Record cross-process spans

data B3 Source #

Exportable trace information, used for cross-process traces.

Instances
Eq B3 Source # 
Instance details

Defined in Monitor.Tracing.Zipkin

Methods

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

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

Show B3 Source # 
Instance details

Defined in Monitor.Tracing.Zipkin

Methods

showsPrec :: Int -> B3 -> ShowS #

show :: B3 -> String #

showList :: [B3] -> ShowS #

ToJSON B3 Source # 
Instance details

Defined in Monitor.Tracing.Zipkin

FromJSON B3 Source # 
Instance details

Defined in Monitor.Tracing.Zipkin

clientSpan :: MonadTrace m => Maybe Endpoint -> Name -> (Maybe B3 -> m a) -> m a Source #

serverSpan :: MonadTrace m => Maybe Endpoint -> B3 -> m a -> m a Source #

producerSpan :: MonadTrace m => Maybe Endpoint -> Name -> (Maybe B3 -> m a) -> m a Source #

consumerSpan :: MonadTrace m => Maybe Endpoint -> B3 -> m a -> m a Source #

Add metadata

tag :: MonadTrace m => Text -> Text -> m () Source #

Adds a tag to the active span.

annotate :: MonadTrace m => Text -> m () Source #

Annotates the active span using the current time.

annotateAt :: MonadTrace m => POSIXTime -> Text -> m () Source #

Annotates the active span at the given time.