servant-tracing 0.1.0.0 → 0.1.0.1
raw patch · 4 files changed
+16/−10 lines, 4 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Tracing.Core: Tag :: Text -> a -> Tag
+ Tracing.Core: data Tag
Files
- README.md +6/−1
- servant-tracing.cabal +5/−5
- src/Tracing/Core.hs +3/−2
- src/Tracing/Zipkin.hs +2/−2
README.md view
@@ -22,10 +22,15 @@ The code above logs a new span to the `spanBuffer`, where it will sit until published. If it turns out that `foo` is called from an active span, then it will be recorded as a child of said higher span. +### Testing Locally with the Demo App +You can start up a compatible server for (Zipkin)[] or (Jaeger)[] via a standalone docker container. From there its a matter of seting the following environment variables:+- *TRACING_ENDPOINT*: a `String` with the fully url to a running tracing server+- *TRACING_SERVICE*: a `String` name for your service++ #### Pending Features - Concurrent tracing support.-- Context - Thrift support - Additional clients - Pluggable samplers
servant-tracing.cabal view
@@ -1,8 +1,8 @@ name: servant-tracing-version: 0.1.0.0-description: Please see the README on Github at <https://github.com/ChrisCoffey/servant-tracing#readme>-homepage: https://github.com/ChrisCoffey/servant-tracing#readme-bug-reports: https://github.com/ChrisCoffey/servant-tracing/issues+version: 0.1.0.1+description: Please see the README on Github at <https://github.com/ChrisCoffey/haskell-opentracing-light#readme>+homepage: https://github.com/ChrisCoffey/haskell-opentracing-light#readme+bug-reports: https://github.com/ChrisCoffey/haskell-opentracing-light/issues author: Chris Coffey maintainer: chris@foldl.io copyright: 2018 Chris Coffey@@ -17,7 +17,7 @@ source-repository head type: git- location: https://github.com/ChrisCoffey/servant-tracing+ location: https://github.com/ChrisCoffey/haskell-opentracing-light library default-extensions: DataKinds FlexibleContexts ScopedTypeVariables OverloadedStrings ViewPatterns NamedFieldPuns
src/Tracing/Core.hs view
@@ -13,6 +13,7 @@ TracingInstructions(..), MonadTracer(..), ToSpanTag(..),+ Tag(..), recordSpan, debugPrintSpan@@ -132,12 +133,12 @@ parentSpanId :: !SpanId, debug :: !Bool, sample :: !Bool- } deriving (Eq, Show)+ } deriving (Eq, Show) newtype ActiveSpan = ActiveSpan {finishSpan :: UTCTime -> Span} --- | Global context required for tracing. The 'spanBuffer' should be manually drained by library users.+-- | Global context required for tracing. The `spanBuffer` should be manually drained by library users. data Tracer = Tracer { spanBuffer :: IORef [Span],
src/Tracing/Zipkin.hs view
@@ -23,10 +23,10 @@ import Network.HTTP.Client --- | Publish 'Span' in the Zipkin format (TODO add link to zipkin spec here). No call is made+-- | Publish 'Span' in the <https://zipkin.io/pages/data_model.html Zipkin format> . No call is made -- on an empty publishZipkin :: MonadIO m =>- String -- The address of the backend server+ String -- ^ The address of the backend server -> Manager -> [Span] -- ^ The traced spans to send to a Zipkin backend -> m (Maybe (Response T.Text))