Skip to content

Commit dfa664a

Browse files
committed
new tracing: package bumps, changelogs, docs
1 parent 9485a53 commit dfa664a

File tree

10 files changed

+59
-19
lines changed

10 files changed

+59
-19
lines changed

cardano-node/cardano-node.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ library
211211
, sop-extras
212212
, text >= 2.0
213213
, time
214-
, trace-dispatcher ^>= 2.10.0
215-
, trace-forward ^>= 2.3.0
214+
, trace-dispatcher ^>= 2.11.0
215+
, trace-forward ^>= 2.4.0
216216
, trace-resources ^>= 0.2.4
217217
, tracer-transformers
218218
, transformers

cardano-tracer/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# ChangeLog
22

3+
## 0.3.6 (November 2025)
4+
* Implement Prometheus HTTP service discovery (SD) under the URL `/targets`
5+
* Add optional config field `"prometheusLabels": { "<labelname>": "<labelvalue>", ... }` for custom labels to be attached with Prometheus SD
6+
* Use `TracerTrace.forMachine` directly instead of going via derived `TracerTrace.toJSON`; remove unused `TracerTrace` JSON instances
7+
* Use proper 'camelCase' for machine-readable `TracerTrace`
8+
* Proper tracing (vs. dumping to stdout) for `showProblemIfAny` and for forwarding connection interruptions
9+
* Remove redundant `runInLoop` in favour of `trace-dispatcher`'s implementation
10+
* Split up journal handler implementation into internal modules `Systemd` and `NoSystemd` (maintenance)
11+
312
## 0.3.5 (October, 2025)
413
* Updated to `ekg-forward-1.0`, `ouroboros-network-0.22.3`, `ouroboros-network-api-0.16` and `ouroboros-network-0.22.3`.
514
* Updated metric names

cardano-tracer/cardano-tracer.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.0
22

33
name: cardano-tracer
4-
version: 0.3.5
4+
version: 0.3.6
55
synopsis: A service for logging and monitoring over Cardano nodes
66
description: A service for logging and monitoring over Cardano nodes.
77
category: Cardano,
@@ -200,8 +200,8 @@ library
200200
, string-qq
201201
, text
202202
, time
203-
, trace-dispatcher ^>= 2.10.0
204-
, trace-forward ^>= 2.3.0
203+
, trace-dispatcher ^>= 2.11.0
204+
, trace-forward ^>= 2.4.0
205205
, trace-resources ^>= 0.2.4
206206
, wai ^>= 3.2
207207
, warp ^>= 3.4

cardano-tracer/configuration/metrics_help.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"forgedSlotLast": "Slot number of the last forged block",
3636
"forging_enabled": "A node without forger credentials or started as non-producing has forging disabled.",
3737
"forks": "counter for forks",
38+
"GSM.state": "The state of the Genesis State Machine. 0 = PreSyncing, 1 = Syncing, 2 = CaughtUp.",
3839
"haskell_compiler_major": "Cardano compiler version information",
3940
"haskell_compiler_minor": "Cardano compiler version information",
4041
"haskell_compiler_patch": "Cardano compiler version information",

cardano-tracer/docs/cardano-tracer.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [Logging](#logging)
2020
- [Logs Rotation](#logs-rotation)
2121
- [Prometheus](#prometheus)
22+
- [Prometheus HTTP service discovery](#prometheus-http-sd)
2223
- [EKG Monitoring](#ekg-monitoring)
2324
- [Verbosity](#verbosity)
2425
- [RTView](#rtview)
@@ -462,7 +463,28 @@ or
462463
}
463464
```
464465
466+
### Prometheus HTTP service discovery
465467
468+
The `/targets` path can be used for Prometheus HTTP service discovery. This lets
469+
Prometheus dynamically discover all connected nodes, and scrape their metrics.
470+
Below is a minimal example of a corresponding job definition that goes into the
471+
`prometheus.yml` configuration:
472+
473+
```yaml
474+
- job_name: "cardano-tracer"
475+
http_sd_configs:
476+
- url: 'http://127.0.0.1:3200/targets' # <-- Your cardano-tracer's real hostname:prometheus port
477+
```
478+
479+
Each target will have a label `node_name` which corresponds to the `TraceOptionNodeName` setting in the respective node config.
480+
481+
In `cardano-tracer`'s config, you can optionally provide additional labels to be attached to *all* targets
482+
(default is no additional labels):
483+
```json
484+
"prometheusLabels": {
485+
"<labelname>": "<labelvalue>", ...
486+
}
487+
```
466488

467489
## EKG Monitoring
468490

trace-dispatcher/CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Revision history for trace-dispatcher
22

3-
## NEXT -- Nov 2025
4-
5-
* Replaced both `tofDisconnQueueSize` and `tofConnQueueSize` with `tofQueueSize` (See #6361 for details).
3+
## 2.11.0 -- Nov 2025
4+
5+
* `class LogFormatting`: remove redundant `forHumanFromMachine` and `forHumanOrMachine` (the system already does that inherently)
6+
* Introduce type `Cardano.Logging.Types.TraceMessage.TraceMessage` with explicit codecs for JSON and CBOR
7+
* Rework `PreFormatted` type and formatters to use `TraceMessage`; slightly optimize `humanFormatter'`
8+
* Add CBOR formatting via `FormattedMessage.FormattedCBOR` constructor and a `cborFormatter'` function
9+
* Replaced both `disconnectedQueueSize` and `connectedQueueSize` with `queueSize` in `TraceOptionForwarder` while keeping config parsing backwards compatible
10+
* Add retry delay reset in `runInLoop` when the action runs sufficiently long
11+
* Safely stop `standardTracer`'s stdout thread when there are no more producers
612

713
## 2.10.0 -- July, 2025
814
* Forwarding protocol supports connections over TCP socket, in addition to Unix domain sockets.

trace-dispatcher/doc/trace-dispatcher.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ For the effective integration of trace messages into the tracing system, two ess
186186

187187
The `LogFormatting` typeclass governs the presentation of trace messages, encompassing the mapping of traces to metrics and messages. It includes the following methods:
188188

189-
- The `forMachine` method caters to a machine-readable representation, adaptable based on the detail level. Implementation is mandatory for the trace author.
189+
- The `forMachine` method caters to a machine-readable representation, adaptable based on the detail level. Implementation is mandatory for the trace author. The system will render this,
190+
along with trace metadata, as JSON of type `Cardano.Logging.Types.TraceMessage.TraceMessage`.
190191

191192
- The `forHuman` method renders the message in a human-readable form. Its default implementation is an
192-
empty text, which will be replaced by forMachine in the rendering, if forHuman is empty. The forMachine
193-
will by default rendered with a DNormal detsil level, if no other information is provided.
193+
empty text. Whenever the system encounters the empty text, it will replace it with the machine-readable JSON, rendering it as a value in `{"data": <value>}`, preventing potential loss of log information
194194

195195
- The `asMetrics` method portrays the message as 0 to n metrics. The default implementation assumes no metrics. Each metric can optionally specify a hierarchical identifier as a `[Text]`.
196196

@@ -700,30 +700,30 @@ logs and forwarded tracing output.
700700

701701
As mentioned earlier, trace backends serve as the final destinations for all traces once they have undergone trace interpretation, resulting in metrics and messages. The system defines three trace backends:
702702

703-
1. __Standard Tracer:__ This is the fundamental standard output tracer. Notably, it can accept both regular and confidential traces. It's important to construct only one standard tracer in any application, as attempting to create a new one will result in an exception.
703+
1. __Standard Tracer:__ This is the fundamental standard output tracer. Notably, it can accept both regular and confidential traces.
704704

705705
```haskell
706706
standardTracer :: forall m. (MonadIO m)
707707
=> m (Trace m FormattedMessage)
708708
```
709709

710-
2. __Trace-Forward Tracer:__ This is a network-only sink dedicated to forwarding messages using typed protocols over TCP or local sockets. It exclusively handles public traces and should be instantiated only once per application.
710+
2. __Trace-Forward Tracer:__ This is a network-only sink dedicated to forwarding messages using typed protocols over TCP or local sockets. It exclusively handles public traces.
711711

712712
```haskell
713713
forwardTracer :: forall m. (MonadIO m)
714714
=> ForwardSink TraceObject
715715
-> Trace m FormattedMessage
716716
```
717717

718-
3. __EKG Tracer:__ This tracer submits metrics to a local EKG store, which then further forwards the messages.
718+
3. __EKG Tracer:__ This tracer submits metrics to a local EKG store (which then can be exposed directly via the `PrometheusSimple` backend and/or forwarded).
719719

720720
```haskell
721721
ekgTracer :: MonadIO m
722722
=> Metrics.Store
723723
-> m (Trace m FormattedMessage)
724724
```
725725

726-
It's imperative to note that constructing more than one instance of each tracer in an application may lead to exceptions and should be avoided.
726+
It's imperative to note that constructing more than one instance of each tracer in an application should absolutely be avoided, as it may result in unexpected behaviour.
727727

728728
## Data Points Overview and Deprecation Notice
729729

trace-dispatcher/trace-dispatcher.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.0
22

33
name: trace-dispatcher
4-
version: 2.10.0
4+
version: 2.11.0
55
synopsis: Tracers for Cardano
66
description: Package for development of simple and efficient tracers
77
based on the arrow based contra-tracer package

trace-forward/CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# ChangeLog
22

3-
## NEXT - Nov 2025
3+
## 2.4.0 - Nov 2025
44

5-
* Replaced both `disconnectedQueueSize` and `connectedQueueSize` with `queueSize` (See #6361 for details).
5+
* Refactor `writeToSink` and `readFromSink` to simplify STM usage
6+
* Drop incongruous logic of switching queue capacity from `ForwardSink`, along with related fields and code
7+
* Provide `InitForwardingConfig` config record type for `initForwarding` and `initForwardingDelayed`
68

79
## 2.3.1 - Oct 2025
810

trace-forward/trace-forward.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.0
22

33
name: trace-forward
4-
version: 2.3.1
4+
version: 2.4.0
55
synopsis: The forwarding protocols library for cardano node.
66
description: The library providing typed protocols for forwarding different
77
information from the cardano node to an external application.

0 commit comments

Comments
 (0)