-
Notifications
You must be signed in to change notification settings - Fork 721
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
CAD-391 eliding messages #445
Changes from all commits
cd10846
878726e
0e3b3b2
3a8126b
54c8875
cdfe112
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# global filter; messages must have at least this severity to pass: | ||
minSeverity: Notice | ||
minSeverity: Debug | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just the |
||
|
||
# global file rotation settings: | ||
rotation: | ||
|
@@ -68,6 +68,8 @@ options: | |
# Change the `subtrace` value to `Neutral` in order to log | ||
# `UTxO`-related messages during epoch validation. | ||
subtrace: NoTrace | ||
'cardano.#messagecounters': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we even need this, since input-output-hk/iohk-monitoring-framework#496 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. once that PR is merged, then no more. |
||
subtrace: NoTrace | ||
'#messagecounters.aggregation': | ||
subtrace: NoTrace | ||
'#messagecounters.monitoring': | ||
|
@@ -84,17 +86,15 @@ options: | |
cardano.epoch-validation.benchmark: | ||
- AggregationBK | ||
'cardano.node.peers.BlockFetchDecision': | ||
- EKGViewBK | ||
- kind: UserDefinedBK | ||
name: LiveViewBackend | ||
'cardano.node.ChainDB': | ||
- KatipBK | ||
- kind: UserDefinedBK | ||
name: LiveViewBackend | ||
'cardano.node.metrics.ChainDB': | ||
- EKGViewBK | ||
- kind: UserDefinedBK | ||
name: LiveViewBackend | ||
cardano.node.metrics: | ||
- EKGViewBK | ||
- kind: UserDefinedBK | ||
name: LiveViewBackend | ||
########################################################## | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,10 @@ set -euo pipefail | |
|
||
cd ${TARGETDIR} | ||
|
||
cabal v2-run exe:cardano-byron-proxy -- \ | ||
RUNNER="cabal v2-run exe:cardano-byron-proxy --" | ||
RUNNER="stack --nix exec cardano-byron-proxy --" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It probably needs an if as well. |
||
|
||
${RUNNER} \ | ||
+RTS -T -RTS \ | ||
--database-path state-proxy-mainnet/db \ | ||
--index-path state-proxy-mainnet/index \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ import Cardano.BM.Data.Aggregated (Measurable (..)) | |
import Cardano.BM.Data.LogItem (LOContent (..), LogObject (..), | ||
PrivacyAnnotation (Confidential), | ||
mkLOMeta) | ||
import Cardano.BM.ElidingTracer | ||
import Cardano.BM.Tracing | ||
import Cardano.BM.Trace (traceNamedObject) | ||
import Cardano.BM.Data.Tracer (WithSeverity (..), addName, | ||
|
@@ -118,6 +119,26 @@ nullTracers = Tracers { | |
muxTracer = nullTracer | ||
} | ||
|
||
|
||
instance ElidingTracer | ||
(WithSeverity (WithTip blk (ChainDB.TraceEvent blk))) where | ||
-- equivalent by type and severity | ||
isEquivalent (WithSeverity s1 (WithTip _tip1 (ChainDB.TraceLedgerReplayEvent _ev1))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If they are both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. equivalence just by comparing severity and the type; could be made more complicated.. |
||
(WithSeverity s2 (WithTip _tip2 (ChainDB.TraceLedgerReplayEvent _ev2))) = s1 == s2 | ||
isEquivalent (WithSeverity s1 (WithTip _tip1 (ChainDB.TraceGCEvent _ev1))) | ||
(WithSeverity s2 (WithTip _tip2 (ChainDB.TraceGCEvent _ev2))) = s1 == s2 | ||
isEquivalent _ _ = False | ||
-- the types to be elided | ||
doelide (WithSeverity _ (WithTip _ (ChainDB.TraceLedgerReplayEvent _))) = True | ||
doelide (WithSeverity _ (WithTip _ (ChainDB.TraceGCEvent _))) = True | ||
doelide _ = False | ||
conteliding _tform _tverb _tr _ (Nothing, _count) = return (Nothing, 0) | ||
conteliding _tform _tverb tr ev (_old, count) = do | ||
when (count > 0 && count `mod` 100 == 0) $ do -- report every 100th elided message | ||
meta <- mkLOMeta (defineSeverity ev) (definePrivacyAnnotation ev) | ||
traceNamedObject tr (meta, LogValue "messages elided so far" (PureI $ toInteger count)) | ||
return (Just ev, count + 1) | ||
|
||
-- | Smart constructor of 'NodeTraces'. | ||
-- | ||
mkTracers :: forall peer blk. | ||
|
@@ -145,11 +166,13 @@ mkTracers traceOptions tracer = do | |
-- a block. | ||
-- txsOutcomeExtractor <- mkOutcomeExtractor | ||
|
||
elided <- newstate -- for eliding messages in ChainDB tracer | ||
|
||
pure Tracers | ||
{ chainDBTracer | ||
= tracerOnOff (traceChainDB traceOptions) | ||
$ annotateSeverity | ||
$ teeTraceChainTip StructuredLogging tracingVerbosity | ||
$ teeTraceChainTip StructuredLogging tracingVerbosity elided | ||
$ addName "ChainDB" tracer | ||
, consensusTracers | ||
= mkConsensusTracers forgeTracers traceOptions | ||
|
@@ -191,11 +214,19 @@ mkTracers traceOptions tracer = do | |
|
||
teeTraceChainTip :: TracingFormatting | ||
-> TracingVerbosity | ||
-> MVar (Maybe (WithSeverity (WithTip blk (ChainDB.TraceEvent blk))), Int) | ||
-> Tracer IO (LogObject Text) | ||
-> Tracer IO (WithSeverity (WithTip blk (ChainDB.TraceEvent blk))) | ||
teeTraceChainTip tform tverb tr = Tracer $ \ev -> do | ||
teeTraceChainTip tform tverb elided tr = Tracer $ \ev -> do | ||
traceWith (teeTraceChainTip' tr) ev | ||
traceWith (toLogObject' tform tverb tr) ev | ||
traceWith (teeTraceChainTipElide tform tverb elided tr) ev | ||
teeTraceChainTipElide :: TracingFormatting | ||
-> TracingVerbosity | ||
-> MVar (Maybe (WithSeverity (WithTip blk (ChainDB.TraceEvent blk))), Int) | ||
-> Tracer IO (LogObject Text) | ||
-> Tracer IO (WithSeverity (WithTip blk (ChainDB.TraceEvent blk))) | ||
teeTraceChainTipElide = elideToLogObject | ||
|
||
teeTraceChainTip' :: Tracer IO (LogObject Text) | ||
-> Tracer IO (WithSeverity (WithTip blk (ChainDB.TraceEvent blk))) | ||
teeTraceChainTip' tr = | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably needs an
if
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, switched to 'stack'. Changing the order of the definitions will use stack/cabal.