cardano-node: remove iohk-monitoring tracing backend#6580
Conversation
|
The change in [Byron.hs:122] is: Before: instance ToJSON (TxId (GenTx ByronBlock)) where ( "txid" .= (Text.take 8 . renderTxId $ txId tx) ) |
| configureTracers configReflection trConfig [shutdownTr] | ||
| shutdownTrDoc <- documentTracer (shutdownTr :: Logging.Trace IO ShutdownTrace) | ||
|
|
||
| chainDBTr <- mkCardanoTracer' |
| consensusStartupErrorTrDoc <- documentTracer (consensusStartupErrorTr :: | ||
| Logging.Trace IO ConsensusStartupException) | ||
|
|
||
| consensusGddTr <- mkCardanoTracer |
|
|
||
| instance ToJSON NodeToClientVersionData where | ||
| toJSON = String . Text.pack . show | ||
|
|
There was a problem hiding this comment.
Isn't there a ToJSON for both of the above in cardano-diffusion/orphan-instances/Cardano/Network/OrphanInstances.hs?
Using Show here seems to lose structure.
| ["Consensus", "Startup"] | ||
| configureTracers configReflection trConfig [consensusStartupErrorTr] | ||
|
|
||
| !consensusGddTr <- mkCardanoTracer |
There was a problem hiding this comment.
Every TraceGDDEvent is silently discarded. This makes Genesis Density Disconnection events completely invisible
| else return $ Last $ Just PartialTracingOff | ||
| _turnOnLogging :: Maybe Bool <- v .:? "TurnOnLogging" | ||
| _turnOnLogMetrics :: Maybe Bool <- v .:? "TurnOnLogMetrics" | ||
| _useTraceDispatcher :: Maybe Bool <- v .:? "UseTraceDispatcher" |
| , "decisions" .= if dtal >= DMaximum | ||
| then toJSON (Verbose <$> xs) | ||
| else toJSON xs | ||
| , "decisions" .= List.foldl' (\acc x -> forMachine DDetailed x : acc) [] xs |
There was a problem hiding this comment.
Are you sure this produces the same output?
There's already a mismatch in detail levels.
| (case pt of | ||
| GenesisPoint -> "Genesis" | ||
| BlockPoint _ h -> renderHeaderHash (Proxy @header) h) | ||
| BlockPoint slot _ -> "slot-" <> showT slot) |
There was a problem hiding this comment.
This is completely wrong.
The output must look like
...
"ns":"BlockFetch.Client.CompletedBlockFetch","data":{"block":"00c854f75889b72e14e59e7ed891a467f1b21e28378b092efc786c63b769f67f", ...}
| [ "kind" .= String "SendFetchRequest" | ||
| , "head" .= String (renderChainHash | ||
| (renderHeaderHash (Proxy @header)) | ||
| (AF.headHash af)) |
There was a problem hiding this comment.
The head key is missing after the change.
| , "length" .= toJSON (fragmentLength' af)] | ||
| ++ | ||
| [ "deltaq" .= toJSON gsv | dtal >= DDetailed ] | ||
| [ "deltaq" .= String (Text.pack $ show gsv) | dtal >= DDetailed ] |
There was a problem hiding this comment.
The field has a ToJSON in network, IIRC. It's an Object, not a String.
| mconcat | ||
| [ "kind" .= String "TraceMempoolManuallyRemovedTxs" | ||
| , "txsRemoved" .= txs0 | ||
| , "txsRemoved" .= map (String . Text.pack . show) (toList txs0) |
There was a problem hiding this comment.
This is suspicious. It might result in the same output, it may not.
This needs scrutiny.
Summary
Removes the legacy
iohk-monitoring-based tracing infrastructure fromcardano-node, leavingtrace-dispatcheras the sole tracing backend.trace-dispatcherhas been the production default since node 8.x. The oldiohk-monitoringpath was retained during a transition period but is no longerused or tested in production deployments. Removing it eliminates ~11 000 lines
of dead code and 9 transitive build dependencies.
What changed
Deleted (~8 100 lines, 15 modules):
Cardano.Tracing.*—Config,HasIssuer,Metrics,Render,Shutdown,Startup,Tracers, and allOrphanInstances.*modules(Byron, Common, Consensus, HardFork, Network, Shelley)
Cardano.Node.Configuration.Logging— the iohk-monitoring init layerCardano.Node.Tracing.Compat— compatibility shimModified:
Cardano.Node.Run— simplified to use onlyinitTraceDispatcher; alllegacy
createLoggingLayer/setupTrace/Cardano.BM.*imports goneCardano.Node.TraceConstraints— removesHasIssuer,ToObject, andrelated iohk-monitoring constraints
cardano-node.cabal— dropsiohk-monitoring,lobemo-backend-*,lobemo-scribe-systemd,ekg-wai,tracer-transformers,scientific"tracing_backend"updated to"trace-dispatcher"Breaking change
Any node config still using
"TracingBackend": "iohk-monitoring"or legacyLoggingconfig keys will need to be migrated totrace-dispatcherconfiguration before upgrading. Refer to the trace-dispatcher migration guide.
Config options removed with iohk-monitoring
The following node configuration keys have no effect after the removal of the
iohk-monitoringtracing backend. All tracing is now handled exclusively bytrace-dispatcher.Parsed by the node but silently ignored
These three keys are still accepted by the JSON parser to avoid hard failures
on existing configs, but have no effect:
TurnOnLoggingTurnOnLogMetricsUseTraceDispatcherfalse) and trace-dispatcher (true) backendParsed by
Cardano.Tracing.Config(module deleted)TracingVerbosityMinimalVerbosity/NormalVerbosity/MaximalVerbosityTraceAcceptPolicyTraceBackingStoreTraceBlockFetchClientTraceBlockFetchDecisionsTraceBlockFetchProtocolTraceBlockFetchProtocolSerialisedTraceBlockFetchServerTraceBlockchainTimeTraceChainDB/TraceChainDbTraceChainSyncClientTraceChainSyncBlockServerTraceChainSyncHeaderServerTraceChainSyncProtocolTraceChurnModeTraceConnectionManagerTraceConnectionManagerCountersTraceConnectionManagerTransitionsTraceCsjTraceDevotedBlockFetchTraceDiffusionInitializationTraceDNS/TraceDnsResolver/TraceDnsSubscriptionTraceErrorPolicy/TraceLocalErrorPolicyTraceForge/TraceForgeStateInfoTraceGDDTraceGsmTraceHandshake/TraceLocalHandshakeTraceInboundGovernorTraceInboundGovernorCountersTraceInboundGovernorTransitionsTraceIpSubscriptionTraceKeepAliveClient/TraceKeepAliveProtocolTraceKesAgentTraceLedgerPeersTraceLocalChainSyncProtocolTraceLocalConnectionManagerTraceLocalMux/TraceLocalMuxBearer/TraceLocalMuxChannelTraceLocalRootPeersTraceLocalServerTraceLocalStateQueryProtocolTraceLocalTxMonitorProtocolTraceLocalTxSubmissionProtocol/TraceLocalTxSubmissionServerTraceMempoolTraceMux/TraceMuxBearer/TraceMuxChannelTracePeerSelection/TracePeerSelectionActions/TracePeerSelectionCountersTracePeerSharingProtocolTracePublicRootPeersTraceSanityCheckIssueTraceServerTraceTxCountersTraceTxInbound/TraceTxOutboundTraceTxLogicTraceTxSubmissionProtocol/TraceTxSubmission2ProtocolRead directly by the
iohk-monitoringlibraryThese keys were consumed by
Cardano.BM.Configuration— the node never parsedthem itself. They are now entirely ignored:
minSeverityDebug/Info/Notice/Warning/Error/Critical)rotationrpLogLimitBytes,rpKeepFilesNum,rpMaxAgeHours)setupBackendsKatipBK,EKGViewBK, etc.)defaultBackendssetupScribesdefaultScribeshasEKGhasPrometheusoptions.mapBackendsoptions.mapSubtraceoptions.mapSeverityReplacements in trace-dispatcher
The
trace-dispatcherbackend has its own equivalents for severity filteringand output routing, configured under
TraceOptionsin the trace-dispatcherconfig file. Refer to the trace-dispatcher documentation for the current config
format.