Skip to content

Commit b2945e0

Browse files
committed
new tracing: documentation, changelogs, linting, update test data
1 parent 91430e8 commit b2945e0

File tree

11 files changed

+52
-40
lines changed

11 files changed

+52
-40
lines changed

bench/tx-generator/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
# ChangeLog
22

3+
## 2.15 -- Mar 2025
4+
5+
* A new cabal flag `withplutuslib` is added, enabling import and re-compilation of Plutus scripts from `plutus-scripts-bench` - default: false; use for dev/test of new benchmarks only.
6+
* Port `ProtocolParameters` type and typeclass instances from `cardano-api` into new module `Cardano.Api.Internal`, removing dependency on the deprecated API type.
7+
* Bump for Node 10.3
8+
39
## 2.14.2 -- Oct 2024
410

511
* Bump for Node 10
612

713
## 2.14.1 -- June 2024
14+
815
* A new NixSvcOptions field is introduced: `_nix_keepalive`
916
and it's propagated down to the `kaClient` that does keepalives.
1017
This makes keepalive timeouts configurable.

bench/tx-generator/src/Cardano/Benchmarking/Tracer.hs

+2-6
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,8 @@ generatorTracer ::
6767
-> Maybe (Trace IO FormattedMessage)
6868
-> IO (Trace IO a)
6969
generatorTracer tracerName mbTrStdout mbTrForward = do
70-
forwardTrace <- case mbTrForward of
71-
Nothing -> mempty
72-
Just trForward -> forwardFormatter trForward
73-
stdoutTrace <- case mbTrStdout of
74-
Nothing -> mempty
75-
Just trForward -> machineFormatter trForward
70+
forwardTrace <- maybe mempty forwardFormatter mbTrForward
71+
stdoutTrace <- maybe mempty machineFormatter mbTrStdout
7672
let tr = forwardTrace <> stdoutTrace
7773
tr' <- withDetailsFromConfig tr
7874
pure $ withInnerNames $ appendPrefixName tracerName tr'

cardano-node/test/Test/Cardano/Tracing/NewTracing/data/badConfig.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ TraceOptions:
7272
TxSubmission.Remote:
7373
detail: DMinimal
7474

75-
# Options for the trace forwarder
76-
TraceOptionForwarder:
77-
address:
78-
filePath: /tmp/forwarder.sock
79-
mode: Initiator
80-
8175
TraceOptionPeerFrequency: 2000
8276

8377
TraceOptionResourceFrequency: 5000

cardano-node/test/Test/Cardano/Tracing/NewTracing/data/goodConfig.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ TraceOptions:
6969
TxSubmission.Remote:
7070
detail: DMinimal
7171

72-
# Options for the trace forwarder
73-
TraceOptionForwarder:
74-
address:
75-
filePath: /tmp/forwarder.sock
76-
mode: Initiator
77-
7872
TraceOptionPeerFrequency: 2000
7973

8074
TraceOptionResourceFrequency: 5000

cardano-tracer/CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# ChangeLog
22

3+
## 0.3.2 (March 2025)
4+
5+
* When requesting forwarded metrics, ask for delta to previous request only. New config option `ekgRequestFull` defaults to `false`; set to `true` to revert this behavior.
6+
* Add up-to-date symlink for each log rotation, pointing to the most recent file (`node.json` or `node.log`, depending on the log format).
7+
* Fix: CLI option `--min-log-severity` is now observed correctly.
8+
* Add `metricsNoSuffix` to configuration, which when set removes suffixes like `_int` from metrics names, making them more similar to those in the old system (optional boolean; default: `false`).
9+
* Remove `metricsComp` metric name remapping from configuration.
10+
* Updated to use `ekg-forward-0.9`.
11+
312
## 0.3.1 (January 22, 2025)
413

514
* Fix race condition when querying `NodeInfo` data point, occasionally resulting in fallback `NodeName`s instead of proper ones.

cardano-tracer/docs/cardano-tracer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ In this example, `subdirForNode0` is a subdirectory containing log files with it
296296

297297
The field `logMode` specifies logging mode. There are two possible modes: `FileMode` and `JournalMode`. `FileMode` is for storing logs to the files, `JournalMode` is for storing them in `systemd`'s journal. Please note that if you choose `JournalMode`, the field `logRoot` will be ignored.
298298

299-
The field `logFormat` specifies the format of logs. There are two possible modes: `ForMachine` and `ForHuman`. `ForMachine` is for JSON format, `ForHuman` is for human-friendly text format.
299+
The field `logFormat` specifies the format of logs. There are two possible modes: `ForMachine` and `ForHuman`. `ForMachine` is for JSON format, `ForHuman` is for human-friendly text format. The latter also implies the file endings change to `.log`, and the symbolic link is named `node.log`.
300300

301301
Please note that `logging` field accepts the list, so you can specify more than one logging section. For example, for both log formats:
302302

trace-dispatcher/CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Revision history for trace-dispatcher
22

3+
## 2.9 -- Mar 2025
4+
5+
* New `PrometheusSimple` backend which runs a simple TCP server for direct exposition of metrics, without forwarding.
6+
* New `maxReconnectDelay` config option in `TraceOptionForwarder`: Specifies maximum delay (seconds) between (re-)connection attempts of a forwarder (default: 60s).
7+
* Optimize data sharing in formatters.
8+
* Remove unused optional namespace prefix argument from formatters.
9+
* Updated to use `ekg-forward-0.9`.
10+
* Remove `ekg-wai` from dependencies.
11+
312
## 2.8.1 -- Feb 2025
413

514
* Updated to `ouroboros-network-framework-0.16`

trace-dispatcher/doc/config.nix

-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ To add in node-services.nix
1515
{ns = ""; backends = ["Stdout HumanFormatColoured"; "Forwarder"; "EKGBackend"];}
1616
{ns = "ChainDB"; backends = ["Forwarder"];}
1717
];
18-
TraceOptionForwarder = {filePath: "/tmp/forwarder.sock";};

trace-dispatcher/doc/config.yaml

-6
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ TraceOptions:
6161
BlockFetchClient.CompletedBlockFetch:
6262
maxFrequency: 2.0
6363

64-
# Options for the trace forwarder
65-
TraceOptionForwarder:
66-
address:
67-
filePath: /tmp/forwarder.sock
68-
mode: Initiator
69-
7064
TraceOptionPeerFrequency: 2000
7165

7266
TraceOptionResourceFrequency: 5000

trace-dispatcher/doc/trace-dispatcher.md

+20-14
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,19 @@ The configurability of dispatchers provided by this library relies on:
305305
The usual form to provide a configuration is via a configuration file, wich can be in JSON or YAML format. The options that
306306
can be given based on a namespace are: `severity`, `detail`, `backends` and `limiter`.
307307

308-
Backends can be a combination of `Forwarder`, `EKGBackend`, and
309-
one of `Stdout MachineFormat`, `tdout HumanFormatColoured` and `Stdout HumanFormatUncoloured`.
308+
Backends can be a combination of `Forwarder`, `EKGBackend`, `PrometheusSimple [suffix|nosuffix] [bindhost] <port>` and
309+
one of `Stdout MachineFormat`, `Stdout HumanFormatColoured` and `Stdout HumanFormatUncoloured`.
310+
311+
The connection for the `Forwarder` backend is provided on the application command line. It is a socket path over which applications like `cardano-node` connect with `cardano-tracer`. `--tracer-socket-path-connect /path/to/forward.sock` sets
312+
the backends's role to `Initiator`, whereas `--tracer-socket-path-accept /path/to/forward.sock` sets it to `Responder`. Except for debugging purposes, the former should be chosen: the application takes the `Initiator` role, and `cardano-tracer` is
313+
in the `Responder` role, which means setting its network `tag` to `AcceptAt` in its config (see there).
314+
315+
The `PrometheusSimple` backend provides Prometheus metrics _directly from the process_, without forwarding. It always applies to all tracers globally, and should only be configured once.
316+
Providing an available port number in the connection string is mandatory; this will bind to localhost only by default. By specifying a bind host, the metrics can be queried remotely, e.g. over IPv4 by
317+
binding to `0.0.0.0`, or IPv6 by binding to `::`. Metrics will be available under the URL `/metrics`.
318+
The `nosuffix` modifier removes suffixes like `_int` from metrics names, making them more similar to those in the old system; `suffix` is the implicit default and can be omitted.
319+
320+
*CAUTION*: Generally allowing remote queries of Prometheus metrics is risky and should only be done in an environment you control.
310321

311322
```yaml
312323
# Use new tracing
@@ -320,6 +331,7 @@ TraceOptions:
320331
- Stdout MachineFormat
321332
- EKGBackend
322333
- Forwarder
334+
- 'PrometheusSimple :: 1234' # Prometheus metrics available over IPv6 (and localhost) on port 1234
323335

324336
ChainDB: # Show as well messages with severity Info for all ChainDB traces.
325337
severity: Info
@@ -329,16 +341,13 @@ TraceOptions:
329341
maxFrequency: 2.0
330342

331343
TraceOptionForwarder: # Configure the forwarder
332-
address:
333-
filePath: /tmp/forwarder.sock
334-
mode: Initiator
335344
maxReconnectDelay: 20
336345

337346
# Frequency of Peer messages set to two seconds
338347
TraceOptionPeerFrequency: 2000
339348

340349
# Any metrics emittted will get this prefix
341-
TraceOptionMetricsPrefix: "cardano.node"
350+
TraceOptionMetricsPrefix: "cardano.node.metrics."
342351
```
343352

344353
The same in JSON looks like this:
@@ -353,7 +362,8 @@ The same in JSON looks like this:
353362
"backends": [
354363
"Stdout MachineFormat",
355364
"EKGBackend",
356-
"Forwarder"
365+
"Forwarder",
366+
"PrometheusSimple :: 1234"
357367
]
358368
},
359369
"ChainDB": {
@@ -365,14 +375,10 @@ The same in JSON looks like this:
365375
}
366376
},
367377
"TraceOptionForwarder": {
368-
"address": {
369-
"filePath": "/tmp/forwarder.sock"
370-
},
371-
"mode": "Initiator",
372-
"maxReconnectDelay": 30
378+
"maxReconnectDelay": 20
373379
},
374380
"TraceOptionPeerFrequency": 2000,
375-
"TraceOptionMetricsPrefix": "cardano.node"
381+
"TraceOptionMetricsPrefix": "cardano.node.metrics."
376382
}
377383
```
378384

@@ -708,7 +714,7 @@ As mentioned earlier, trace backends serve as the final destinations for all tra
708714

709715
```haskell
710716
ekgTracer :: MonadIO m
711-
=> Either Metrics.Store Server
717+
=> Metrics.Store
712718
-> m (Trace m FormattedMessage)
713719
```
714720

trace-forward/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# ChangeLog
22

3+
## 2.2.11 - Mar 2025
4+
5+
* Updated to `ouroboros-network-framework-0.17`
6+
37
## 2.2.10 - Feb 2025
48

59
* Updated to `ouroboros-network-framework-0.16`

0 commit comments

Comments
 (0)