Commit Graph

392 Commits

Author SHA1 Message Date
Pratik Mankawde
4e2b8ce536 merge: bring the plan-doc suppressed cleanup forward from phase-6
The attribute table conflicted because this branch had added the fee and
sequence rows and widened tx_type's set-on list. Kept those, and dropped the
suppressed row the incoming side removed.
2026-09-18 10:02:54 +01:00
Pratik Mankawde
6e4d566ba6 Merge branch 'pratik/otel-phase5-docs-deployment' into pratik/otel-phase6-statsd 2026-09-18 10:00:51 +01:00
Pratik Mankawde
84ff06ecec Merge branch 'pratik/otel-phase4-consensus-tracing' into pratik/otel-phase5-docs-deployment 2026-09-18 10:00:51 +01:00
Pratik Mankawde
b2b5879e8e Merge branch 'pratik/otel-phase3-tx-tracing' into pratik/otel-phase4-consensus-tracing 2026-09-18 10:00:51 +01:00
Pratik Mankawde
073ff1a93f docs(telemetry): drop the suppressed row from the attribute reference
tx.receive does not set it. The span starts after the duplicate check, so a
dropped copy produces no span for the attribute to sit on.
2026-09-18 09:55:45 +01:00
Pratik Mankawde
a0a23f0b61 docs(telemetry): match the task list to where the receive span now starts
The steps described setting a suppressed attribute on a dropped duplicate. The
span is now created after the duplicate check, so there is no span on that path.
2026-09-18 09:55:14 +01:00
Pratik Mankawde
bec9e1c8a9 fix(telemetry): resolve the node identity before the Application is built
resolveNodePublicKey() returned std::nullopt in three real cases: a first boot
with no wallet database, a standalone run (its wallet is a private temporary
database), and --newnodeid. Telemetry's resources are built during
ApplicationImp's member-init list and are immutable, so on those runs the node
reported an empty service.instance.id and no xrpl.node.id for the whole run,
while setup() minted a key moments later and patched only the tracer.

Replace it with resolveNodeIdentity(), which always returns a keypair: derived
from a configured seed, else read from an existing wallet database, else
minted. Main.cpp passes that pair to makeApplication(), ApplicationImp stores
it in nodeIdentity_ -- now declared before telemetry_ and no longer an optional,
because it is always set -- and builds the telemetry resource from it.

setup() calls getNodeIdentity(), which now persists rather than mints: it
stores the resolved pair when the wallet holds no identity, adopts the stored
one when it does, and clears first for --newnodeid. The write stays in setup()
because that is where the database exists; a standalone run has no persistent
wallet to write to, which is why the pair has to be decided before
construction rather than read back afterwards. Wallet gains storeNodeIdentity()
for that write, and getNodeIdentity(session) now uses it instead of repeating
the insert.

The three-argument makeApplication() mints a keypair, so jtx::Env and any other
test Application behave as a standalone run always did.

Also fold the three hand-rolled "meter from a NoopMeterProvider" copies into
telemetry::noopMeter(): the base-pointer call and the kMeterVersion argument are
both easy to get wrong alone, and the meter identity has to match the one the
histogram views select on.

The new gtest covers the wallet half: store-then-read, store not replacing an
existing identity, clear-then-store, and that the mint path persists. It adds
the tests.libxrpl > xrpl.rdb levelization edge, regenerated here.
2026-09-14 20:34:31 +01:00
Pratik Mankawde
366bcaa328 merge: bring the component renames forward from phase6-statsd
Four conflicts, all where this branch's replacement of the StatsD path with
native OTLP met the upstream spanmetrics -> span_metrics rename. This branch's
design wins in every case; the rename is carried into its text rather than
reverting it, so the connector, its pipeline references, the header comment,
the TESTING.md summary and the runbook all use span_metrics while keeping the
native-OTLP wording.

One addition beyond a straight take-a-side: publish the collector's health
check port. This branch restored the health_check extension and its own
TESTING.md polls http://localhost:13133/ to decide the collector is ready, but
the port was never published on this side of docker-compose.yml, so that check
could not pass from the host. Verified the merged config loads with no
deprecation warnings and that 13133 is published exactly once.

No metric name changed: traces_span_metrics_* already read that way before the
rename, which only ever touched component names and prose.
2026-09-09 19:19:22 +01:00
Pratik Mankawde
988015dc65 merge: bring the OTLP gRPC exporter rename forward from phase5-docs-deployment
Conflict in docker/telemetry/otel-collector-config.yaml, in the service
pipelines: this branch renamed the deprecated spanmetrics connector to
span_metrics and adds the statsd metrics pipeline, while upstream renamed the
deprecated otlp exporter to otlp_grpc. Both kept.

With both renames present the collector now starts with no deprecation
warnings at all, which was the point of the pair.
2026-09-09 19:17:07 +01:00
Pratik Mankawde
49a3302e29 Merge branch 'pratik/otel-phase4-consensus-tracing' into pratik/otel-phase5-docs-deployment 2026-09-09 19:16:08 +01:00
Pratik Mankawde
c0024c7c57 Merge branch 'pratik/otel-phase3-tx-tracing' into pratik/otel-phase4-consensus-tracing 2026-09-09 19:16:08 +01:00
Pratik Mankawde
b98a9d3d13 Merge branch 'pratik/otel-phase2-rpc-tracing' into pratik/otel-phase3-tx-tracing 2026-09-09 19:16:08 +01:00
Pratik Mankawde
4dc706c606 merge: bring the OTLP gRPC exporter rename forward from phase1c-rpc-integration
Conflict in docker/telemetry/otel-collector-config.yaml, in the traces
pipeline: this branch added the attributes/hash processor while upstream
renamed the deprecated otlp exporter to otlp_grpc. Both sides kept — the
processor list keeps attributes/hash and the exporter list takes the new name.
Checked that the exporter definition key was renamed to match the reference,
and that the collector still loads the merged config.
2026-09-09 19:15:52 +01:00
Pratik Mankawde
c622da5a76 refactor(telemetry): use the current name for the span metrics connector
The pinned collector warns on every start that "spanmetrics" is a deprecated
alias for "span_metrics". Rename the connector, its pipeline references and
the prose that names it.

The derived metric names are untouched. They come from the connector's
`namespace` setting rather than its component name, so occurrences inside a
metric name such as traces_spanmetrics_calls_total are deliberately left as
they are; renaming those would break every span panel. The rename is applied
only to the bare word, never where it is joined to a metric name by
underscores.

This branch introduces the connector, so the change belongs here.
2026-09-09 15:40:11 +01:00
Pratik Mankawde
87457446be refactor(telemetry): use the current name for the OTLP gRPC exporter
The pinned collector warns on every start that "otlp" is a deprecated alias
for "otlp_grpc". Rename the trace exporter to otlp_grpc/tempo.

Only the exporter is affected. The otlp RECEIVER keeps its name: it serves
both gRPC and HTTP under one component and is not deprecated, verified by
renaming the exporter alone and seeing the warning stop.

This belongs on this branch because it introduces the exporter, and it is the
last of four deprecated aliases in the collector config; the other three are
owned by later branches in the chain.
2026-09-09 15:40:09 +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
55ae890efd merge: bring the CI fixes forward from phase1c-rpc-integration 2026-09-08 17:13:51 +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
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
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
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
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
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