Skip to content

Commit 0de686a

Browse files
committed
cardano-tracer: Fix typos, better commens
1 parent 03bf692 commit 0de686a

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

Diff for: cardano-tracer/src/Cardano/Tracer/Configuration.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ data TracerConfig = TracerConfig
9393
, logging :: !(NonEmpty LoggingParams) -- ^ Logging parameters.
9494
, rotation :: !(Maybe RotationParams) -- ^ Rotation parameters.
9595
, verbosity :: !(Maybe Verbosity) -- ^ Verbosity of the tracer itself.
96-
, metricsComp :: !(Maybe (Map Text Text)) -- ^ Metrics compability map from metrics name to metrics name
96+
, metricsComp :: !(Maybe (Map Text Text)) -- ^ Metrics compatibility map from metrics name to metrics name
9797
} deriving (Eq, Generic, FromJSON, ToJSON, Show)
9898

9999
-- | Read the tracer's configuration file.

Diff for: cardano-tracer/src/Cardano/Tracer/Handlers/Metrics/Prometheus.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ getMetricsFromNode tracerEnv nodeId acceptedMetrics =
126126
where
127127
getListOfMetrics :: Sample -> MetricsList
128128
getListOfMetrics =
129-
metricsCompability
129+
metricsCompatibility
130130
. filter (not . T.null . fst)
131131
. map metricsWeNeed
132132
. HM.toList
@@ -149,8 +149,8 @@ getMetricsFromNode tracerEnv nodeId acceptedMetrics =
149149
. T.replace "-" "_"
150150
. T.replace "." "_"
151151

152-
metricsCompability :: MetricsList -> MetricsList
153-
metricsCompability metricsList =
152+
metricsCompatibility :: MetricsList -> MetricsList
153+
metricsCompatibility metricsList =
154154
case metricsComp (teConfig tracerEnv) of
155155
Nothing -> metricsList
156156
Just mmap -> foldl (\ accu p'@(mn,mv) -> case M.lookup mn mmap of

Diff for: nix/nixos/cardano-tracer-service.nix

+8-5
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ let serviceConfigToJSON =
4141
epHost = "127.0.0.1";
4242
epPort = 3200; ## supervisord.portShiftPrometheus
4343
} // (cfg.prometheus or {});
44-
## TODO YUP: replace with real mappings
45-
metricsComp = {
46-
"Mempool.TxsInMempool" = "Mempool.TxsInMempool.Mapped";
47-
"ChainDB.SlotNum" = "ChainDB.SlotNum.Mapped";
48-
};
44+
# Just an example for metrics compatibility mapping.
45+
# An entry means the first entry has the second entry as alias.
46+
# The Metrics is then avalable, both with the original and the mapped name.
47+
# Only one mapping per message is supported.
48+
# metricsComp = {
49+
# "Mempool.TxsInMempool" = "Mempool.TxsInMempool.Mapped";
50+
# "ChainDB.SlotNum" = "ChainDB.SlotNum.Mapped";
51+
# };
4952
};
5053
in pkgs.commonLib.defServiceModule
5154
(lib: with lib;

0 commit comments

Comments
 (0)