| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Monitor.Tracing.Zipkin
Description
Zipkin trace publisher.
Synopsis
- data Zipkin
- new :: MonadIO m => Settings -> m Zipkin
- data Settings = Settings {}
- defaultSettings :: Settings
- data Endpoint = Endpoint {
- endpointService :: !(Maybe Text)
- endpointPort :: !(Maybe Int)
- endpointIPv4 :: !(Maybe IPv4)
- endpointIPv6 :: !(Maybe IPv6)
- defaultEndpoint :: Endpoint
- run :: TraceT m a -> Zipkin -> m a
- publish :: MonadIO m => Zipkin -> m ()
- with :: MonadUnliftIO m => Settings -> (Zipkin -> m a) -> m a
- data B3
- b3FromHeaders :: Map Text Text -> Maybe B3
- b3ToHeaders :: B3 -> Map Text Text
- clientSpan :: MonadTrace m => Maybe Endpoint -> Name -> (Maybe B3 -> m a) -> m a
- serverSpan :: MonadTrace m => Maybe Endpoint -> B3 -> m a -> m a
- producerSpan :: MonadTrace m => Maybe Endpoint -> Name -> (Maybe B3 -> m a) -> m a
- consumerSpan :: MonadTrace m => Maybe Endpoint -> B3 -> m a -> m a
- tag :: MonadTrace m => Text -> Text -> m ()
- annotate :: MonadTrace m => Text -> m ()
- annotateAt :: MonadTrace m => POSIXTime -> Text -> m ()
Set up the trace collector
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.
Information about a hosted service.
Constructors
| Endpoint | |
Fields
| |
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
Exportable trace information, used for cross-process traces.
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
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.