Commit Graph

528 Commits

Author SHA1 Message Date
Pratik Mankawde
8d2e2d15af docs(telemetry): correct stale code citations and the log-correlation claim
Every citation below was checked against the file it names:

- LedgerMaster.cpp:463 is fixIndex, not the ledger.store span; that guard is at
  :470 and the insert it wraps at :476
- LedgerMaster.cpp:987 is the tvc assignment, which sits BEFORE the tvc < minVal
  return at :988; the ledger.validate span opens at :1003
- ServerHandler.cpp:705 is inside makeJsonError; processRequest is at :718
- docker-compose.yml:71 and :75 are comments in the collector's volume block;
  the loki service is at :112 and its config command at :116

Two claims were also wrong rather than merely stale. Log-trace correlation is
gated in CI, because the workflow passes no --skip-loki, and the separate check
in integration-test.sh is run by no workflow at all. The Loki label note
described the Grafana Cloud collector config rather than the local one: only the
cloud variant sets job=xrpld, and the local config's own comment says to select
on service_name. The dashboards carry 35 Loki queries, not 38.
2026-09-09 13:14:21 +01:00
Pratik Mankawde
bae31955db merge: bring the CI fixes forward from phase8-log-correlation
One conflicted file, docs/telemetry-runbook.md, with three spots:

- Build section: both sides added different text at one point. Kept both,
  incoming sentence first, then this branch's "Run against a live network".
- Disabling section, first spot: this branch's wording names the config
  section and says no rebuild is needed, so it already covers the incoming
  sentence.
- Disabling section, second spot: kept this branch's paragraph and folded in
  the one point it lacked, that both flags have to be passed.
2026-09-08 17:22:04 +01:00
Pratik Mankawde
75f2d042f4 merge: bring the CI fixes forward from phase7-native-metrics 2026-09-08 17:19:40 +01:00
Pratik Mankawde
ff1a905ede merge: bring the CI fixes forward from phase6-statsd
Three conflicts, all resolved by keeping this branch's rewrite and
re-applying the incoming change onto it:

- 09-data-collection-reference.md: phase-7 rewrote both attribute tables,
  so the incoming table would have reverted them. Kept phase-7's and
  re-applied the two "XRPL epoch" spellings.
- integration-test.sh: phase-7 moved these checks from StatsD to OTel and
  no longer defines check_statsd_metric, so only this side compiles.
- TelemetryConfig.cpp: the incoming side carried networkTypeFromId(), which
  this branch already has. Kept one definition and took the incoming
  doc wording, which the auto-merged body below it already matches.
2026-09-08 17:17:50 +01:00
Pratik Mankawde
e612e5d9fa merge: bring the CI fixes forward from phase5-docs-deployment 2026-09-08 17:14:06 +01:00
Pratik Mankawde
6528b02469 merge: bring the CI fixes forward from phase4-consensus-tracing 2026-09-08 17:14:06 +01:00
Pratik Mankawde
2ec09abf12 merge: bring the CI fixes forward from phase3-tx-tracing 2026-09-08 17:13:51 +01:00
Pratik Mankawde
b0fd72619a merge: bring the CI fixes forward from phase2-rpc-tracing 2026-09-08 17:13:51 +01:00
Pratik Mankawde
55ae890efd merge: bring the CI fixes forward from phase1c-rpc-integration 2026-09-08 17:13:51 +01:00
Pratik Mankawde
cf719f224d merge: bring the CI fixes forward from phase1a-plan-docs 2026-09-08 17:13:41 +01:00
Pratik Mankawde
23c1a6f5dd fix(docs): spell it "XRPL epoch" in the data-collection reference
The rename script rewrites "Ripple epoch" to "XRPL epoch", so the old
spelling in a tracked .md makes the check-rename job fail on a dirty tree.

The attribute keys are left alone: the script's pattern needs a space, and
those keys are a cross-layer contract.
2026-09-08 17:12:55 +01:00
Pratik Mankawde
25362d3b6a fix(docs): spell it "XRPL epoch" in the close-time attribute notes
The rename script rewrites "Ripple epoch" to "XRPL epoch", so the old
spelling in a tracked .md makes the check-rename job fail on a dirty tree.

The attribute keys are left alone: the script's pattern needs a space, and
those keys are a cross-layer contract.
2026-09-08 17:12:53 +01:00
Pratik Mankawde
0ed0c01021 fix(docs): spell it "XRPL epoch" in the ledger attribute table
The rename script rewrites "Ripple epoch" to "XRPL epoch", so the old
spelling in a tracked .md makes the check-rename job fail on a dirty tree.

The attribute key close_time_ripple_epoch_s is left alone: the script's
pattern needs a space, and that key is a cross-layer contract.
2026-09-08 17:12:40 +01:00
Pratik Mankawde
5542170422 docs(telemetry): drop the stale consensus_trace_strategy validation gap
The parser now maps the value onto ConsensusTraceStrategy and rejects any
other spelling, so the runbook note and the Phase 4 task-list bullet both
claimed a gap that no longer exists.
2026-09-08 15:52:58 +01:00
Pratik Mankawde
2fdfbe1b91 merge: bring the review fixes forward from otel-phase8-log-correlation 2026-09-08 15:51:07 +01:00
Pratik Mankawde
547cc8bac5 merge: bring the review fixes forward from otel-phase7-native-metrics 2026-09-08 15:46:05 +01:00
Pratik Mankawde
7d679ce596 merge: bring the review fixes forward from otel-phase6-statsd 2026-09-08 15:45:22 +01:00
Pratik Mankawde
9977810c6d merge: bring the review fixes forward from phase5-docs-deployment
One conflict, in docs/telemetry-runbook.md: both sides had independently
corrected the same consensus_round_id example. This branch kept the pipe form,
which Tempo rejects as a parse error; upstream moved the predicate inside the
braces, which parses and returns data. Upstream's query is kept, with this
branch's note that the value is the previous ledger sequence plus one.
2026-09-08 15:33:02 +01:00
Pratik Mankawde
868edce7e5 merge: bring the review fixes forward from phase4-consensus-tracing
Two conflicts, both additive.

TelemetryConfig.cpp: this branch added requireHttpsEndpoint next to
requireReadableFile; upstream added readConsensusTraceStrategy at the same spot.
Both kept.

05-configuration-reference.md: this branch added the two client-certificate rows
while upstream corrected the consensus strategy value from attribute to random.
Both kept. Also drops the stale "not yet implemented" row for
consensus_trace_strategy, which the merged table now contradicts twice over: the
option is parsed, and its value is no longer spelled attribute.
2026-09-08 15:31:40 +01:00
Pratik Mankawde
0c1babf9fb merge: bring the review fixes forward from otel-phase3-tx-tracing 2026-09-08 15:28:59 +01:00
Pratik Mankawde
7b302f5e77 merge: bring the review fixes forward from otel-phase2-rpc-tracing 2026-09-08 15:28:59 +01:00
Pratik Mankawde
a6dc9edf08 merge: bring the review fixes forward from otel-phase1c-rpc-integration 2026-09-08 15:28:59 +01:00
Pratik Mankawde
566af67bb8 merge: bring the review fixes forward from otel-phase1a-plan-docs 2026-09-08 15:28:59 +01:00
Pratik Mankawde
2399f5763f docs(telemetry): name the consensus trace strategy value "random"
The plan doc offered `"attribute"` as the alternative to `"deterministic"`
for consensus_trace_strategy. The parser accepts `"random"`; "attribute"
described the correlation mechanism rather than the setting's value. Note
also that the alternative is experimental and not used.
2026-09-08 14:42:32 +01:00
Pratik Mankawde
8da882dccb docs(telemetry): state when retries_remaining is recorded
retries_remaining is stamped on the txq.accept_tx span before the
transaction is applied and before the retry counter is decremented, so a
span with txq_status="retried" always shows a non-zero count and exhaustion
shows up as txq_status="failed" with zero. The attribute comment said only
"retries left before discard", which reads as a post-decrement value and
led to a runbook query that could never match.

Also rename the drifted consensus_trace_strategy value in the plan docs
from "attribute" to "random", the spelling the parser accepts, and note that
it is experimental and not used.
2026-09-08 14:42:05 +01:00
Pratik Mankawde
fb827dc0f1 fix(telemetry): make the consensus trace strategy an enum
consensus_trace_strategy was read as a std::string and compared against the
literal "attribute" in startRoundTracing(), while the runbook documented
"deterministic" and "random". The documented value "random" therefore fell
through to the default and did nothing.

Parse the setting once into ConsensusTraceStrategy, so the consensus code
branches on a type. The accepted spellings are now "deterministic" and
"random"; anything else fails at startup instead of silently defaulting.
The behaviour behind the old "attribute" name is unchanged and is now
reached by "random".

Document consensus_trace_strategy in xrpld-example.cfg, stating that
"random" is experimental and not used: it gives each node its own trace id,
so one round arrives as one trace per node.

Also state on the tx.included event that it covers the agreed consensus set
before the ledger is built, so it is a superset of the accepted ledger.
2026-09-08 14:39:05 +01:00
Pratik Mankawde
efdd9758f2 merge: bring the review fixes forward from otel-phase8-log-correlation 2026-09-07 15:39:59 +01:00
Pratik Mankawde
efa6535427 merge: bring the review fixes forward from otel-phase7-native-metrics 2026-09-07 15:24:42 +01:00
Pratik Mankawde
4ad84cae14 merge: bring the review fixes forward from otel-phase6-statsd 2026-09-07 15:23:22 +01:00
Pratik Mankawde
de61119e5b merge: bring the review fixes forward from otel-phase5-docs-deployment 2026-09-07 15:15:05 +01:00
Pratik Mankawde
de895c6d1e merge: bring the review fixes forward from phase4-consensus-tracing
Two conflicts, both additive on each side.

TelemetryConfig.cpp: include blocks only. This branch added FileUtilities.h for
the certificate readability checks; upstream added <limits> and <optional> for
the bounds parser. Both kept.

The TelemetryConfig test: this branch's mutual-TLS cases and upstream's
batch-bounds cases were added at the same positions, so the file is rebuilt from
both stages and carries all 32 tests. Two shared cases were each edited by one
side only, so the edited side wins in each: upstream asserts the batch defaults
in parse_empty_section, and this branch's parse_full_section writes a real
certificate file, which is now required since the parser opens it.
2026-09-07 15:14:52 +01:00
Pratik Mankawde
3d9ea4b9da merge: bring the review fixes forward from phase3-tx-tracing
One conflict, in 06-implementation-phases.md: this branch had rewritten the
phase-4 task table with a Status column, a descoping note and a Spans Produced
section, while upstream corrected the class name in the old plain table. This
branch's section is kept and the name correction re-applied to its 4.1 row.
2026-09-07 15:04:39 +01:00
Pratik Mankawde
08df97f431 merge: bring the review fixes forward from phase2-rpc-tracing
One conflict, in SpanGuard.h: this branch added struct TraceBytes and upstream
added enum SpanRole at the same position after TraceCategory. Unrelated
declarations, so both are kept.
2026-09-07 15:03:44 +01:00
Pratik Mankawde
caa704de10 merge: bring the review fixes forward from phase1c-rpc-integration
Two conflicts, both resolved by composing the sides rather than taking one.

cfg/xrpld-example.cfg: this branch had moved the batch-processor keys under
their own heading while upstream edited them in place, so a merge-both would
have documented them twice. Upstream's range sentences are applied to the
relocated block and the head-sampling note keeps its position.

02-design-decisions.md: the summary table changed on both sides for different
reasons. Upstream renamed ledger_index to current_ledger_seq and ledger_seq;
this branch had corrected the PathFinding row to the keys it actually emits.
Both are kept.
2026-09-07 15:00:53 +01:00
Pratik Mankawde
83145db060 merge: bring the review fixes forward from phase1a-plan-docs 2026-09-07 14:55:11 +01:00
Pratik Mankawde
623e3d8ad3 feat(telemetry): add batch-size and discovered-path histograms
Review feedback asked for a Histogram rather than a span attribute at these two
places. Both, not either: the attribute answers how big one sampled request was,
which an aggregate cannot, and the histogram answers the distribution across all
requests, which an unsampled trace never reveals. Both attributes stay.

The metrics land here rather than with the attributes because neither
HistogramBuckets.h nor the metric macro exists on the branch that added them.

Both use kObjectCountBuckets. The argument is the floor, not the ceiling: the SDK
default edges start 0,5,10,25, so an ordinary batch of one to five falls in a
single bucket and every quantile becomes an interpolation on one edge. The object
ladder puts five edges over the mass of both distributions. Path count is bounded
at 352 by kMaxPaths times kMaxAutoSrcCur and cannot saturate. Batch size can, at
roughly 333k, but no measured traffic goes near it, so the ladder is not widened
for a range nothing occupies; the runbook records the overflow query and a test
asserts it stays readable.
2026-09-07 13:51:44 +01:00
Pratik Mankawde
b5415233cd fix(telemetry): stop reporting applied_direct for a failed direct apply
tryDirectApply returns an engaged optional whenever the fee bar was cleared,
including when xrpl::apply() failed, so testing the optional labelled failures as
applied. TxQ_test's fail-in-preclaim case hits exactly this: the fee clears the
bar and preclaim then rejects with terINSUF_FEE_B.

The stamp now branches on ApplyResult::applied. A failure reports failed rather
than falling through to the default rejected, because rejected means the
transaction got nowhere, while this one cleared the fee bar and ran through
apply(). ter_code is recorded either way, so the failure is diagnosable. Both
values already existed and are used the same way by the queued-apply path in this
file, so the vocabulary is unchanged.

The value set in the phase-3 task list is updated to match, including a ter_code
row for txq.accept_tx that was already emitted but undocumented.
2026-09-07 13:42:29 +01:00
Pratik Mankawde
9aebdc292c docs(telemetry): fix stale symbols, attribute keys and TraceQL in the plan docs
Review feedback on the plan documents. Four kinds of error:

- Symbols that do not exist: ConsensusProposal::prevLedger_ (it is
  previousLedger_), RCLConsensusAdaptor (it is RCLConsensus::Adaptor, and
  startRound() is on RCLConsensus itself), and RPCHandler::doCommand (a free
  function, xrpl::rpc::doCommand).
- Attribute keys: the tables used ledger_index, which no telemetry code emits.
  Same concept as ledger_seq but a different referent, so the code disambiguates
  by prefix: current_ledger_seq for the open ledger a transaction targeted,
  ledger_seq for a closed or validated one. A note now states which is which.
- TraceQL that does not parse: span-field predicates need braces, status.code
  is not an intrinsic (status = error), and avg(duration) does not take a by
  clause (avg_over_time does). All five re-tested against Tempo.
- The StatsD comparison omitted the Histogram instrument, which aggregates at
  the point of measure, and the when-to-use table had no row for a metric that
  spans cannot afford to carry.
2026-09-07 13:16:32 +01:00
Pratik Mankawde
2b61e763f7 merge: bring the close-time attr doc fixes forward from phase8-log-correlation
The runbook span table, the phase-4 task list and the data reference all
conflicted: this branch had already expanded them with the open-phase,
avalanche and proposal-prefix attributes. Keep this branch's tables and
apply the close-time rename to their rows.

The close_time entry in ledger_history_mismatch_total{reason} is a metric
label value, not the span attribute, and is deliberately unchanged.
2026-09-04 12:43:38 +01:00
Pratik Mankawde
1bee0b1c63 merge: bring the close-time attr doc fixes forward from phase7-native-metrics 2026-09-04 12:42:22 +01:00
Pratik Mankawde
87270ef642 merge: bring the close-time attr doc fixes forward from phase6-statsd
The consensus and ledger attribute tables conflicted: this branch had
already rewritten both, adding the open-phase and avalanche attributes and
correcting tx_count/tx_failed to sit on tx.apply alone. Keep this branch's
tables and apply the close-time rename to their rows, rather than taking
either side whole.
2026-09-04 12:42:08 +01:00
Pratik Mankawde
981323f071 merge: bring the close-time attr doc fixes forward from phase5-docs-deployment 2026-09-04 12:40:21 +01:00
Pratik Mankawde
652c03f5cd merge: bring the close-time attr doc fixes forward from phase4-consensus-tracing 2026-09-04 12:40:21 +01:00
Pratik Mankawde
68364f9b8a merge: bring the close-time attr doc fixes forward from phase1c-rpc-integration 2026-09-04 12:40:21 +01:00
Pratik Mankawde
f2ef748b6b merge: bring the close-time attr doc fixes forward from phase3-tx-tracing 2026-09-04 12:40:21 +01:00
Pratik Mankawde
f2b3e5c53c merge: bring the close-time attr doc fixes forward from phase2-rpc-tracing 2026-09-04 12:40:21 +01:00
Pratik Mankawde
ff3f41eeaf merge: bring the close-time attr doc fixes forward from phase1a-plan-docs 2026-09-04 12:40:20 +01:00
Pratik Mankawde
0ee97a7951 docs(telemetry): follow the close-time attr rename in the key lists
Update the consensus and ledger key inventories and the spanmetrics
dimension comment in both collector configs, so they name the emitted
keys. The comment's last_close_time reference is a server_info gauge, not
the span attribute, and is left as it is.
2026-09-04 12:39:05 +01:00
Pratik Mankawde
ca22f57919 docs(telemetry): follow the close-time attr rename in the data reference
The emitted keys carry the unit and epoch suffix. Update the consensus
and ledger attribute tables and the ledger.build span row to match.

The Close Time Drift panel row is left alone: phase-7 removes that whole
table, so editing it here would only conflict on the way forward.
2026-09-04 12:37:19 +01:00
Pratik Mankawde
372fba129f docs(telemetry): follow the close-time attr rename in the phase-4 docs
The emitted keys are close_time_ripple_epoch_s,
parent_close_time_ripple_epoch_s and close_time_self_ripple_epoch_s.
Update the consensus.accept.apply attribute tables and the close-time
attribute descriptions to match.
2026-09-04 12:35:25 +01:00