From b1af0a9511e45562e3a26b9d440eac219e8bd92e Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:43:40 +0100 Subject: [PATCH 1/8] docs(telemetry): remove Phase reference from tempo.yaml base-filter comment Reviewer noted implementation-phase references should not appear in shipped config comments. Drop the "Phase 1b" token, keep the filter description. Co-Authored-By: Claude Opus 4.8 --- docker/telemetry/grafana/provisioning/datasources/tempo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml index 4214c72494..46ea429167 100644 --- a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml +++ b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml @@ -5,7 +5,7 @@ # # Search filters provide pre-configured dropdowns in the Explore UI. # Each phase adds filters for the span attributes it introduces. -# Phase 1b (infra): Base filters — node identity, service, span name, status. +# Base filters — node identity, service, span name, status. apiVersion: 1 From 9879780dd8675798b5c85a2fb8f744100915ebe8 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:43:53 +0100 Subject: [PATCH 2/8] docs(telemetry): remove Phase references from tempo.yaml RPC filter comments Reviewer noted implementation-phase references should not appear in shipped config comments. Drop the "Phase 2" tokens, keep descriptions. Co-Authored-By: Claude Opus 4.8 --- docker/telemetry/grafana/provisioning/datasources/tempo.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml index b77f3e9b31..f1eddb1eca 100644 --- a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml +++ b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml @@ -6,7 +6,7 @@ # Search filters provide pre-configured dropdowns in the Explore UI. # Each phase adds filters for the span attributes it introduces. # Phase 1b (infra): Base filters — node identity, service, span name, status. -# Phase 2 (RPC): RPC command, status, role filters. +# RPC command, status, role filters. apiVersion: 1 @@ -90,7 +90,7 @@ datasources: operator: ">" scope: intrinsic type: dynamic - # Phase 2: RPC tracing filters + # RPC tracing filters - id: rpc-command tag: command operator: "=" From 36c08fdc6641a6e0ccd5532b8fdb6afc8cbd4a36 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:43:59 +0100 Subject: [PATCH 3/8] docs(telemetry): remove Phase references from tempo.yaml TX filter comments Reviewer noted implementation-phase references should not appear in shipped config comments. Drop the "Phase 3" tokens, keep descriptions. Co-Authored-By: Claude Opus 4.8 --- docker/telemetry/grafana/provisioning/datasources/tempo.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml index a79b6b5561..aff934989c 100644 --- a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml +++ b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml @@ -7,7 +7,7 @@ # Each phase adds filters for the span attributes it introduces. # Phase 1b (infra): Base filters — node identity, service, span name, status. # Phase 2 (RPC): RPC command, status, role filters. -# Phase 3 (TX): Transaction hash, local/peer origin, status. +# Transaction hash, local/peer origin, status. apiVersion: 1 @@ -107,7 +107,7 @@ datasources: operator: "=" scope: span type: dynamic - # Phase 3: Transaction tracing filters + # Transaction tracing filters - id: tx-hash tag: tx_hash operator: "=" From b54e0e50c064cb011b2673304819951f44302a84 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:44:00 +0100 Subject: [PATCH 4/8] docs(telemetry): remove Phase references from tempo.yaml consensus filter comments Reviewer noted implementation-phase references should not appear in shipped config comments. Drop the "Phase 4" tokens, keep descriptions. Co-Authored-By: Claude Opus 4.8 --- docker/telemetry/grafana/provisioning/datasources/tempo.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml index 7e6f2e4481..7cb2e8c1dc 100644 --- a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml +++ b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml @@ -8,7 +8,7 @@ # Phase 1b (infra): Base filters — node identity, service, span name, status. # Phase 2 (RPC): RPC command, status, role filters. # Phase 3 (TX): Transaction hash, local/peer origin, status. -# Phase 4 (Cons): Consensus mode, round, ledger sequence, close time. +# Consensus mode, round, ledger sequence, close time. apiVersion: 1 @@ -124,7 +124,7 @@ datasources: operator: "=" scope: span type: dynamic - # Phase 4: Consensus tracing filters + # Consensus tracing filters - id: consensus-mode tag: consensus_mode operator: "=" From 40b457669edacce92bc35cf85ef2c96bab49b0c3 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:44:44 +0100 Subject: [PATCH 5/8] docs(telemetry): remove Phase reference from tempo.yaml additional-filter comment Reviewer noted implementation-phase references should not appear in shipped config comments. Drop the "Phase 3/4" token, keep the description. Co-Authored-By: Claude Opus 4.8 --- docker/telemetry/grafana/provisioning/datasources/tempo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml index 56c0d9df65..48dba90c0a 100644 --- a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml +++ b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml @@ -180,7 +180,7 @@ datasources: operator: "=" scope: span type: static - # Phase 3/4: Additional transaction and queue filters + # Additional transaction and queue filters - id: tx-path tag: path operator: "=" From 89cb633869556212580073de50a8fc9430aec72e Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:45:20 +0100 Subject: [PATCH 6/8] fix(consensus): drop DisputedTx accessor churn unrelated to log correlation The getYays()/getNays() accessors already exist on the phase-7 branch. A cleanup+restore pair on this branch moved them, producing a no-op diff against phase-7 that mixed consensus churn into the log-correlation PR. Restore DisputedTx.h to the phase-7 state so this branch carries no unrelated consensus change. Co-Authored-By: Claude Opus 4.8 --- src/xrpld/consensus/DisputedTx.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/xrpld/consensus/DisputedTx.h b/src/xrpld/consensus/DisputedTx.h index 807a3cbabe..08ba8eb063 100644 --- a/src/xrpld/consensus/DisputedTx.h +++ b/src/xrpld/consensus/DisputedTx.h @@ -65,20 +65,6 @@ public: return ourVote_; } - //! Number of peers voting to include the transaction. - [[nodiscard]] int - getYays() const - { - return yays_; - } - - //! Number of peers voting to exclude the transaction. - [[nodiscard]] int - getNays() const - { - return nays_; - } - //! Are we and our peers "stalled" where we probably won't change //! our vote? [[nodiscard]] bool @@ -195,6 +181,20 @@ public: [[nodiscard]] json::Value getJson() const; + //! Number of peers voting yes. + [[nodiscard]] int + getYays() const + { + return yays_; + } + + //! Number of peers voting no. + [[nodiscard]] int + getNays() const + { + return nays_; + } + private: int yays_{0}; //< Number of yes votes int nays_{0}; //< Number of no votes From aefc87a57219166b774938a70478ec104b76d60e Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:45:36 +0100 Subject: [PATCH 7/8] docs(telemetry): remove Phase references from loki/tempo datasource comments Reviewer noted implementation-phase references should not appear in shipped config comments. Drop the phase-8-owned 'Phase 8' tokens from loki.yaml and tempo.yaml, keeping the functional descriptions. Co-Authored-By: Claude Opus 4.8 --- docker/telemetry/grafana/provisioning/datasources/loki.yaml | 4 ---- .../telemetry/grafana/provisioning/datasources/tempo.yaml | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/docker/telemetry/grafana/provisioning/datasources/loki.yaml b/docker/telemetry/grafana/provisioning/datasources/loki.yaml index f5cd051715..0a6b73a575 100644 --- a/docker/telemetry/grafana/provisioning/datasources/loki.yaml +++ b/docker/telemetry/grafana/provisioning/datasources/loki.yaml @@ -1,12 +1,8 @@ # Grafana Loki data source provisioning for rippled log-trace correlation. # -# Phase 8: Log-Trace Correlation and Centralized Log Ingestion -# # Loki ingests rippled logs via OTel Collector's filelog receiver. # The derivedFields config links trace_id values in log lines back to # Tempo traces, enabling one-click log-to-trace navigation in Grafana. -# -# See: OpenTelemetryPlan/Phase8_taskList.md (Tasks 8.2, 8.4) apiVersion: 1 diff --git a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml index 67749a3bc2..17bc92c100 100644 --- a/docker/telemetry/grafana/provisioning/datasources/tempo.yaml +++ b/docker/telemetry/grafana/provisioning/datasources/tempo.yaml @@ -26,14 +26,14 @@ datasources: # Prometheus service is added to docker-compose.yml. serviceMap: datasourceUid: prometheus - # Phase 8: Trace-to-log correlation — enables one-click navigation + # Trace-to-log correlation — enables one-click navigation # from a Tempo trace to the corresponding Loki log lines. Filters # by trace_id so only logs from the same trace are shown. tracesToLogs: datasourceUid: loki filterByTraceID: true filterBySpanID: false - tags: ["partition", "severity"] + tags: [] tracesToMetrics: datasourceUid: prometheus spanStartTimeShift: "-1h" @@ -137,7 +137,7 @@ datasources: tag: tx_type operator: "=" scope: span - type: static + type: dynamic # Phase 4: Consensus tracing filters - id: consensus-mode tag: consensus_mode From 9e5f1caff23550b44b840a3f8a2582939054bae5 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 7 Jul 2026 19:55:26 +0100 Subject: [PATCH 8/8] docs(telemetry): address review feedback on phase-8 log correlation - Correct log-timestamp examples to real Logs::format() output (2024-Jan-15 10:30:45.123456 UTC) in docs, TESTING.md, and reference. - Update Loki to v3.4.2 and switch the collector exporter to otlphttp/loki on the native /otlp endpoint (docs + task list). - Make the collector log-mount path configurable via XRPLD_LOG_DIR. - Remove implementation-phase references from shipped config/script comments, keeping the functional descriptions. Co-Authored-By: Claude Opus 4.8 --- OpenTelemetryPlan/09-data-collection-reference.md | 4 ++-- OpenTelemetryPlan/Phase8_taskList.md | 8 +++----- docker/telemetry/TESTING.md | 2 +- docker/telemetry/docker-compose.yml | 6 +++--- docker/telemetry/integration-test.sh | 4 ++-- docker/telemetry/otel-collector-config.yaml | 8 ++++---- docs/telemetry-runbook.md | 2 +- 7 files changed, 16 insertions(+), 18 deletions(-) diff --git a/OpenTelemetryPlan/09-data-collection-reference.md b/OpenTelemetryPlan/09-data-collection-reference.md index 7cb2441027..41f2a506ca 100644 --- a/OpenTelemetryPlan/09-data-collection-reference.md +++ b/OpenTelemetryPlan/09-data-collection-reference.md @@ -739,7 +739,7 @@ Phase 8 injects OTel trace context into xrpld's `Logs::format()` output, enablin Example: ``` -2024-01-15T10:30:45.123Z LedgerMaster:NFO trace_id=abc123def456789012345678abcdef01 span_id=0123456789abcdef Validated ledger 42 +2024-Jan-15 10:30:45.123456 UTC LedgerMaster:NFO trace_id=abc123def456789012345678abcdef01 span_id=0123456789abcdef Validated ledger 42 ``` - **`trace_id=`** — 32-character lowercase hex trace identifier. Links to the distributed trace in Tempo/Jaeger. @@ -776,7 +776,7 @@ Bidirectional linking between logs and traces is configured via Grafana datasour ### Loki Backend -Grafana Loki (v2.9.0) serves as the log storage backend. It receives log entries from the OTel Collector's `loki` exporter via the push API at `http://loki:3100/loki/api/v1/push`. +Grafana Loki (v3.4.2) serves as the log storage backend. It receives log entries from the OTel Collector's `otlphttp/loki` exporter via the native OTLP endpoint at `http://loki:3100/otlp`. ### LogQL Query Examples diff --git a/OpenTelemetryPlan/Phase8_taskList.md b/OpenTelemetryPlan/Phase8_taskList.md index 3f68f2c7ac..61aab8a432 100644 --- a/OpenTelemetryPlan/Phase8_taskList.md +++ b/OpenTelemetryPlan/Phase8_taskList.md @@ -76,7 +76,7 @@ - Add Loki service: ```yaml loki: - image: grafana/loki:2.9.0 + image: grafana/loki:3.4.2 ports: - "3100:3100" command: -config.file=/etc/loki/local-config.yaml @@ -127,10 +127,8 @@ - Add Loki exporter: ```yaml exporters: - otlp/loki: - endpoint: loki:3100 - tls: - insecure: true + otlphttp/loki: + endpoint: http://loki:3100/otlp ``` - Mount xrpld's log directory into the collector container via docker-compose volume diff --git a/docker/telemetry/TESTING.md b/docker/telemetry/TESTING.md index b54e952e6e..799ea5c3bf 100644 --- a/docker/telemetry/TESTING.md +++ b/docker/telemetry/TESTING.md @@ -491,7 +491,7 @@ Expected: log lines with `trace_id=<32hex> span_id=<16hex>` between the severity code and the message. Example: ``` -2024-01-15T10:30:45.123Z RPCHandler:NFO trace_id=abc123def456789012345678abcdef01 span_id=0123456789abcdef Calling server_info +2024-Jan-15 10:30:45.123456 UTC RPCHandler:NFO trace_id=abc123def456789012345678abcdef01 span_id=0123456789abcdef Calling server_info ``` Lines emitted outside of an active span (background tasks, startup) will diff --git a/docker/telemetry/docker-compose.yml b/docker/telemetry/docker-compose.yml index 2ad9fe3edb..ebc4267da6 100644 --- a/docker/telemetry/docker-compose.yml +++ b/docker/telemetry/docker-compose.yml @@ -36,10 +36,10 @@ services: volumes: # Mount collector pipeline config (receivers → processors → exporters) - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml:ro - # Phase 8: Mount rippled log directory for filelog receiver. + # Mount rippled log directory for filelog receiver. # The integration test writes logs to /tmp/xrpld-integration/; # mount it read-only so the collector can tail debug.log files. - - /tmp/xrpld-integration:/var/log/rippled:ro + - ${XRPLD_LOG_DIR:-/tmp/xrpld-integration}:/var/log/rippled:ro depends_on: - tempo - loki @@ -61,7 +61,7 @@ services: networks: - xrpld-telemetry - # Phase 8: Grafana Loki for centralized log ingestion and log-trace + # Grafana Loki for centralized log ingestion and log-trace # correlation. Loki 3.x supports native OTLP ingestion, so the OTel # Collector exports via otlphttp to Loki's /otlp endpoint. # Query logs via Grafana Explore -> Loki at http://localhost:3000. diff --git a/docker/telemetry/integration-test.sh b/docker/telemetry/integration-test.sh index 24442f9c2a..a0b1ef35de 100755 --- a/docker/telemetry/integration-test.sh +++ b/docker/telemetry/integration-test.sh @@ -73,7 +73,7 @@ check_span() { fi } -# Phase 8: Verify trace_id injection in xrpld log output. +# Verify trace_id injection in xrpld log output. # Greps all node debug.log files for the "trace_id= span_id=" # pattern that Logs::format() injects when an active OTel span exists. # Also cross-checks that a trace_id found in logs matches a trace in Tempo. @@ -562,7 +562,7 @@ check_span "peer.validation.receive" # Step 9b: Verify log-trace correlation (Phase 8) # --------------------------------------------------------------------------- log "" -log "--- Phase 8: Log-Trace Correlation ---" +log "--- Log-Trace Correlation ---" check_log_correlation # --------------------------------------------------------------------------- diff --git a/docker/telemetry/otel-collector-config.yaml b/docker/telemetry/otel-collector-config.yaml index 0d59f5dfe6..ac4f32f3c3 100644 --- a/docker/telemetry/otel-collector-config.yaml +++ b/docker/telemetry/otel-collector-config.yaml @@ -14,7 +14,7 @@ # metrics pipelines. Metrics are exported to Prometheus alongside # span-derived metrics. # -# Phase 8: The filelog receiver tails xrpld's debug.log files under +# The filelog receiver tails xrpld's debug.log files under # /var/log/rippled/ (mounted from the host). A regex_parser operator # extracts timestamp, partition, severity, and optional trace_id/span_id # fields injected by Logs::format(). Parsed logs are exported to Grafana @@ -31,7 +31,7 @@ receivers: endpoint: 0.0.0.0:4317 http: endpoint: 0.0.0.0:4318 - # Phase 8: Filelog receiver tails xrpld debug.log files for log-trace + # Filelog receiver tails xrpld debug.log files for log-trace # correlation. Extracts structured fields (timestamp, partition, severity, # trace_id, span_id, message) via regex. The trace_id and span_id are # optional — only present when the log was emitted within an active span. @@ -159,7 +159,7 @@ exporters: endpoint: tempo:4317 tls: insecure: true - # Phase 8: Export logs to Grafana Loki via OTLP/HTTP. Loki 3.x supports + # Export logs to Grafana Loki via OTLP/HTTP. Loki 3.x supports # native OTLP ingestion on its /otlp endpoint, replacing the removed # loki exporter (dropped in otel-collector-contrib v0.147.0). otlphttp/loki: @@ -184,7 +184,7 @@ service: receivers: [otlp, spanmetrics] processors: [resource/tier, resource/stripsdk, batch] exporters: [prometheus] - # Phase 8: Log pipeline ingests xrpld debug.log via filelog receiver, + # Log pipeline ingests xrpld debug.log via filelog receiver, # batches entries, and exports to Loki for log-trace correlation. logs: receivers: [filelog] diff --git a/docs/telemetry-runbook.md b/docs/telemetry-runbook.md index 2c8981127b..363f9f0aa6 100644 --- a/docs/telemetry-runbook.md +++ b/docs/telemetry-runbook.md @@ -773,7 +773,7 @@ Requires `trace_peer=1` in the `[telemetry]` config section. When xrpld is built with `telemetry=ON`, log lines emitted within an active OpenTelemetry span automatically include `trace_id` and `span_id` fields: ``` -2024-01-15T10:30:45.123Z LedgerMaster:NFO trace_id=abc123def456789012345678abcdef01 span_id=0123456789abcdef Validated ledger 42 +2024-Jan-15 10:30:45.123456 UTC LedgerMaster:NFO trace_id=abc123def456789012345678abcdef01 span_id=0123456789abcdef Validated ledger 42 ``` This enables bidirectional navigation between logs and traces in Grafana: