Skip to content

cardano-node: remove iohk-monitoring tracing backend#6580

Open
jutaro wants to merge 14 commits into
masterfrom
remove-iohk-monitoring
Open

cardano-node: remove iohk-monitoring tracing backend#6580
jutaro wants to merge 14 commits into
masterfrom
remove-iohk-monitoring

Conversation

@jutaro
Copy link
Copy Markdown
Contributor

@jutaro jutaro commented May 26, 2026

Summary

Removes the legacy iohk-monitoring-based tracing infrastructure from
cardano-node, leaving trace-dispatcher as the sole tracing backend.

trace-dispatcher has been the production default since node 8.x. The old
iohk-monitoring path was retained during a transition period but is no longer
used 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):

  • All of Cardano.Tracing.*Config, HasIssuer, Metrics, Render,
    Shutdown, Startup, Tracers, and all OrphanInstances.* modules
    (Byron, Common, Consensus, HardFork, Network, Shelley)
  • Cardano.Node.Configuration.Logging — the iohk-monitoring init layer
  • Cardano.Node.Tracing.Compat — compatibility shim

Modified:

  • Cardano.Node.Run — simplified to use only initTraceDispatcher; all
    legacy createLoggingLayer / setupTrace / Cardano.BM.* imports gone
  • Cardano.Node.TraceConstraints — removes HasIssuer, ToObject, and
    related iohk-monitoring constraints
  • cardano-node.cabal — drops iohk-monitoring, lobemo-backend-*,
    lobemo-scribe-systemd, ekg-wai, tracer-transformers, scientific
  • Nix service config — removes legacy logging-layer options
  • Benchmark profiles — "tracing_backend" updated to "trace-dispatcher"

Breaking change

Any node config still using "TracingBackend": "iohk-monitoring" or legacy
Logging config keys will need to be migrated to trace-dispatcher
configuration 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-monitoring tracing backend. All tracing is now handled exclusively by
trace-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:

Key Previous effect
TurnOnLogging Master on/off switch for the iohk-monitoring logging layer
TurnOnLogMetrics Enabled/disabled node metrics collection via iohk-monitoring
UseTraceDispatcher Chose between legacy (false) and trace-dispatcher (true) backend

Parsed by Cardano.Tracing.Config (module deleted)

Key Previous effect
TracingVerbosity Rendering verbosity: MinimalVerbosity / NormalVerbosity / MaximalVerbosity
TraceAcceptPolicy Per-tracer on/off toggle (bool)
TraceBackingStore "
TraceBlockFetchClient "
TraceBlockFetchDecisions "
TraceBlockFetchProtocol "
TraceBlockFetchProtocolSerialised "
TraceBlockFetchServer "
TraceBlockchainTime "
TraceChainDB / TraceChainDb "
TraceChainSyncClient "
TraceChainSyncBlockServer "
TraceChainSyncHeaderServer "
TraceChainSyncProtocol "
TraceChurnMode "
TraceConnectionManager "
TraceConnectionManagerCounters "
TraceConnectionManagerTransitions "
TraceCsj "
TraceDevotedBlockFetch "
TraceDiffusionInitialization "
TraceDNS / TraceDnsResolver / TraceDnsSubscription "
TraceErrorPolicy / TraceLocalErrorPolicy "
TraceForge / TraceForgeStateInfo "
TraceGDD "
TraceGsm "
TraceHandshake / TraceLocalHandshake "
TraceInboundGovernor "
TraceInboundGovernorCounters "
TraceInboundGovernorTransitions "
TraceIpSubscription "
TraceKeepAliveClient / TraceKeepAliveProtocol "
TraceKesAgent "
TraceLedgerPeers "
TraceLocalChainSyncProtocol "
TraceLocalConnectionManager "
TraceLocalMux / TraceLocalMuxBearer / TraceLocalMuxChannel "
TraceLocalRootPeers "
TraceLocalServer "
TraceLocalStateQueryProtocol "
TraceLocalTxMonitorProtocol "
TraceLocalTxSubmissionProtocol / TraceLocalTxSubmissionServer "
TraceMempool "
TraceMux / TraceMuxBearer / TraceMuxChannel "
TracePeerSelection / TracePeerSelectionActions / TracePeerSelectionCounters "
TracePeerSharingProtocol "
TracePublicRootPeers "
TraceSanityCheckIssue "
TraceServer "
TraceTxCounters "
TraceTxInbound / TraceTxOutbound "
TraceTxLogic "
TraceTxSubmissionProtocol / TraceTxSubmission2Protocol "

Read directly by the iohk-monitoring library

These keys were consumed by Cardano.BM.Configuration — the node never parsed
them itself. They are now entirely ignored:

Key Previous effect
minSeverity Global severity filter (Debug / Info / Notice / Warning / Error / Critical)
rotation Log file rotation (rpLogLimitBytes, rpKeepFilesNum, rpMaxAgeHours)
setupBackends Which backends to initialise (KatipBK, EKGViewBK, etc.)
defaultBackends Default backend routing for namespaces
setupScribes Log output targets (file, stdout, journald, trace-forwarder)
defaultScribes Default scribe routing
hasEKG Port for EKG web metrics interface
hasPrometheus Host/port for Prometheus metrics endpoint
options.mapBackends Per-namespace backend routing overrides
options.mapSubtrace Per-namespace subtrace behaviour overrides
options.mapSeverity Per-namespace severity filter overrides

Replacements in trace-dispatcher

The trace-dispatcher backend has its own equivalents for severity filtering
and output routing, configured under TraceOptions in the trace-dispatcher
config file. Refer to the trace-dispatcher documentation for the current config
format.

@jutaro
Copy link
Copy Markdown
Contributor Author

jutaro commented May 26, 2026

The change in [Byron.hs:122] is:

Before:
( "txid" .= txId tx )
which relied on instance ToJSON (TxId (GenTx ByronBlock)) from the now-deleted Cardano.Tracing.OrphanInstances.Byron, which was:

instance ToJSON (TxId (GenTx ByronBlock)) where
toJSON = String . Text.take 8 . renderTxId
After:

( "txid" .= (Text.take 8 . renderTxId $ txId tx) )
The output is identical — both produce an 8-character hex string. The change just inlines the behavior that used to live in the deleted orphan instance, because that instance no longer exists.

Comment thread cardano-node/src/Cardano/Node/Tracing/Documentation.hs
Comment thread cardano-node/src/Cardano/Node/Tracing/Documentation.hs
Comment thread cardano-node/src/Cardano/Node/Tracing/Tracers.hs
Comment thread cardano-node/src/Cardano/Node/Tracing/Tracers.hs
Comment thread cardano-node/src/Cardano/Node/Configuration/POM.hs Outdated
Comment thread cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs Outdated
Comment thread cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs Outdated
Comment thread cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs
Comment thread cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs Outdated
Comment thread cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs Outdated
jutaro and others added 2 commits May 27, 2026 13:41
Addresses all review comments from PR #6580 (mgmeier). The root cause of
most issues was that `Cardano.Tracing.HasIssuer` was incorrectly deleted
as part of the iohk-monitoring cleanup
Comment thread cardano-node/src/Cardano/Node/Tracing/StateRep.hs
Comment thread cardano-node/src/Cardano/Node/Configuration/TopologyP2P.hs
jutaro added 7 commits May 27, 2026 17:05
Testnet builds again
Replace locally-defined orphan `ToJSON`/`FromJSON` instances that
already exist in `Cardano.Network.OrphanInstances` (from the
`cardano-diffusion:orphan-instances` sublibrary) with imports of that
module:

- `TopologyP2P`: remove `FromJSON/ToJSON PeerTrustable`,
  `FromJSON/ToJSON (NetworkTopology UseBootstrapPeers PeerTrustable)`,
  and `FromJSON UseBootstrapPeers`; add `Cardano.Network.OrphanInstances ()`
  and `Ouroboros.Network.OrphanInstances ()` imports.

- `StateRep`: remove local `ToJSON/FromJSON NodeToNodeVersion`,
  `ToJSON/FromJSON NodeToClientVersion`, and `parseBoundedEnum`; add
  `Cardano.Network.OrphanInstances ()` import.

- `Tracers`: remove Show-based `ToJSON NodeToNodeVersionData` and
  `ToJSON NodeToClientVersionData` stubs; add
  `Cardano.Network.OrphanInstances ()` import.

Additionally fix two pre-existing issues in `Consensus.hs`:

- `deltaq`: use `toJSON gsv` (structured JSON via
  `Ouroboros.Network.OrphanInstances`) instead of `String . show`.

- `TraceDecisionEvent`: restore the `dtal >= DMaximum` conditional
  branch (replacing the reversed fold), using `forMachine DMaximum`
  for the verbose case.

In `Startup.hs`, fix `ConsensusNetworkVersionTuple` to emit proper
structured JSON for `nodeToClientVersion`/`nodeToNodeVersion` via
`ToJSON` from `Cardano.Network.OrphanInstances`, and fix the
`maxNodeToNode/ClientVersion` field to show only the version key
rather than the full `(key, value)` pair.
@jutaro jutaro marked this pull request as ready for review May 29, 2026 09:00
@jutaro jutaro requested review from a team as code owners May 29, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants