Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace-dispatcher: documentation #5635

Merged
merged 3 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,030 changes: 495 additions & 535 deletions trace-dispatcher/doc/trace-dispatcher.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion trace-dispatcher/src/Cardano/Logging/Configuration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ import Cardano.Logging.TraceDispatcherMessage
import Cardano.Logging.Types


-- | Call this function at initialisation, and later for reconfiguration
-- | Call this function at initialisation, and later for reconfiguration.
-- Config reflection is used to optimise the tracers and has to collect
-- information about the tracers. Although it is possible to give more then
-- one tracer of the same time, it is not a common case to do this.
configureTracers :: forall a m.
(MetaTrace a
, MonadIO m)
Expand Down
3 changes: 2 additions & 1 deletion trace-dispatcher/src/Cardano/Logging/Consistency.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ newtype NSLookup = NSLookup (Map.Map T.Text NSLookup)
-- Warns if namespaces in all namespaces are not unique,
-- Warns if namespaces in all namespaces are ending in the
-- middle of another namespace.
-- TODO TRACING: add more checks from documentation
-- The namespaces in allNamespaces are consistent with the namespaces for the
-- severityFor, privacyFor, detailsFor, documentFor and metricsDofFor functions.
checkTraceConfiguration ::
FilePath
-> TraceConfig
Expand Down
2 changes: 1 addition & 1 deletion trace-dispatcher/src/Cardano/Logging/Trace.hs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ contramapM' rFunc =
Trace $ T.Tracer $ T.emit rFunc

-- | Folds the monadic cata function with acc over a.
-- Uses an IORef to store the state
-- Uses an MVar to store the state
foldTraceM :: forall a acc m . (MonadUnliftIO m)
=> (acc -> LoggingContext -> a -> m acc)
-> acc
Expand Down
2 changes: 2 additions & 0 deletions trace-dispatcher/src/Cardano/Logging/Tracer/EKG.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import qualified System.Metrics.Label as Label
import System.Remote.Monitoring (Server, getCounter, getGauge, getLabel)


-- | It is mandatory to construct only one standard tracer in any application!
-- Throwing away a standard tracer and using a new one will result in an exception
ekgTracer :: MonadIO m => Either Metrics.Store Server-> m (Trace m FormattedMessage)
ekgTracer storeOrServer = liftIO $ do
rgsGauges <- newMVar Map.empty
Expand Down
2 changes: 2 additions & 0 deletions trace-dispatcher/src/Cardano/Logging/Tracer/Forward.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import Cardano.Logging.Types

---------------------------------------------------------------------------

-- | It is mandatory to construct only one forwardTracer tracer in any application!
-- Throwing away a forwardTracer tracer and using a new one will result in an exception
forwardTracer :: forall m. (MonadIO m)
=> ForwardSink TraceObject
-> Trace m FormattedMessage
Expand Down
4 changes: 2 additions & 2 deletions trace-dispatcher/src/Cardano/Logging/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,9 @@ data ConfigOption =
-- | Detail level (default is DNormal)
| ConfDetail {detail :: DetailLevel}
-- | To which backend to pass
-- Default is [EKGBackend, Forwarder, Stdout HumanFormatColoured]
-- Default is [EKGBackend, Forwarder, Stdout MachineFormat]
| ConfBackend {backends :: [BackendConfig]}
-- | Construct a limiter with name (Text) and limiting to the Double,
-- | Construct a limiter with limiting to the Double,
-- which represents frequency in number of messages per second
| ConfLimiter {maxFrequency :: Double}
deriving (Eq, Ord, Show, Generic)
Expand Down
Loading