tracing-0.0.2.1: 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 :: TraceT m a -> Zipkin -> 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 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

b3FromHeaders :: Map Text Text -> Maybe B3 Source #

Deserializes the B3 from headers.

b3ToHeaders :: B3 -> Map Text Text Source #

Serializes the B3 to headers, suitable for HTTP requests.

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

Generates a child span with CLIENT kind. This function also provides the corresponding B3 so that it can be forwarded to the server.

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

Generates a child span with SERVER kind. The client's B3 should be provided as input.

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

Generates a child span with PRODUCER kind. This function also provides the corresponding B3 so that it can be forwarded to the consumer.

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

Generates a child span with CONSUMER kind. The producer's B3 should be provided as input.

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.