Commit Graph

16912 Commits

Author SHA1 Message Date
Pratik Mankawde
4615d88296 Merge branch 'pratik/otel-phase9-metric-gap-fill' into pratik/otel-phase10-workload-validation 2026-09-03 18:46:11 +01:00
Pratik Mankawde
39ef1806ba fix(telemetry): satisfy the optional-access and include checks in the range tests
clang-tidy reported six bugprone-unchecked-optional-access errors: the dataflow
analysis does not treat ASSERT_TRUE(x.has_value()) as establishing the
precondition, because the assertion's early return is hidden inside a macro. Three
sites now guard with a plain if + FAIL(), the form already used elsewhere in this
file and one the analysis does model.

The fourth site compares the whole optional instead. That covers both "was it
parsed" and "are the bounds right" in one exact assertion, and because it is
EXPECT rather than ASSERT every row of the table is now checked -- previously one
bad row returned from the test and hid the other five.

parseLedgerRange uses std::errc, which comes from <system_error>; the header
included only <charconv>, which misc-include-cleaner flagged.
2026-09-03 18:44:08 +01:00
Pratik Mankawde
f5fff9b5f9 fix(telemetry): wire the metric export cadence constants to the reader
kMetricExportInterval and kMetricExportTimeout were declared but the reader
options set the same values as literals, so both constants were unused. constexpr
at namespace scope has internal linkage, so clang reports them under
-Wunused-const-variable, which -Dwerr=ON makes fatal: it failed the compile on
ubuntu-clang-release-amd64 and macos-arm64-release, and clang-tidy as well.

Using them removes two magic numbers and keeps the comment that explains why the
interval is 1 s.
2026-09-03 18:44:04 +01:00
Pratik Mankawde
79d2be2352 merge: bring develop forward from phase9-metric-gap-fill 2026-09-03 17:40:07 +01:00
Pratik Mankawde
54d6e80e2e merge: bring develop forward from phase8-log-correlation
Two conflicts, both additions at the same spot:
NetworkOPs.cpp include block kept develop's rpc/detail/SyntheticFields.h
alongside this branch's telemetry/MetricsRegistry.h; .cspell.config.yaml
kept both new words.
2026-09-03 17:39:21 +01:00
Pratik Mankawde
b977850c8a merge: bring develop forward from phase7-native-metrics 2026-09-03 17:38:11 +01:00
Pratik Mankawde
5e33ee9b58 merge: bring develop forward from phase6-statsd 2026-09-03 17:34:06 +01:00
Pratik Mankawde
61fc616bf8 merge: bring develop forward from phase5-docs-deployment 2026-09-03 17:33:52 +01:00
Pratik Mankawde
ff402aa3c2 merge: bring develop forward from phase4-consensus-tracing 2026-09-03 17:33:47 +01:00
Pratik Mankawde
ec2fcdf4f2 merge: bring develop forward from phase3-tx-tracing 2026-09-03 17:33:37 +01:00
Pratik Mankawde
406f9f486c merge: bring develop forward from phase2-rpc-tracing
NetworkOPs.cpp include block: develop replaced DeliveredAmount.h,
MPTokenIssuanceID.h and NFTSyntheticSerializer.h with the single
rpc/detail/SyntheticFields.h. Kept that and this branch's two telemetry
includes.
2026-09-03 17:33:20 +01:00
Pratik Mankawde
d26e096a80 merge: bring develop forward from phase1c-rpc-integration 2026-09-03 17:32:17 +01:00
Pratik Mankawde
5eb8fa9f96 merge: bring develop forward from phase1b-telemetry-infra 2026-09-03 17:31:23 +01:00
Pratik Mankawde
46d13d928b Merge branch 'pratik/otel-phase1a-plan-docs' into pratik/otel-phase1b-telemetry-infra 2026-09-03 17:24:07 +01:00
Pratik Mankawde
6d1fe0254e Merge branch 'develop' into pratik/otel-phase1a-plan-docs 2026-09-03 17:23:56 +01:00
Pratik Mankawde
038d144b6e merge: bring the span-attribute fixes forward from phase9-metric-gap-fill 2026-09-03 16:55:25 +01:00
Pratik Mankawde
35da638278 merge: bring the span-attribute fixes forward from phase8-log-correlation 2026-09-03 16:55:25 +01:00
Pratik Mankawde
3ac8f3fe03 merge: bring the span-attribute fixes forward from phase7-native-metrics 2026-09-03 16:55:16 +01:00
Pratik Mankawde
e2d884d964 merge: bring the span-attribute fixes forward from phase6-statsd 2026-09-03 16:55:16 +01:00
Pratik Mankawde
9fd2a4cf2a merge: bring the span-attribute fixes forward from phase5-docs-deployment 2026-09-03 16:55:16 +01:00
Pratik Mankawde
0089fff56f merge: bring the span-attribute fixes forward from phase4-consensus-tracing 2026-09-03 16:55:15 +01:00
Pratik Mankawde
3877c4fab1 fix(telemetry): rename the receive-path validation status attribute
Two different facts were sharing one attribute key. The sync-diagnostics
branch already emits validation_status on consensus.validation.accept,
carrying what the validation store did (ValStatus: current, stale,
bad_seq, multiple, conflicting, unknown) with a mapping function and
tests behind it. This branch then added validation_status on
consensus.validation.receive for which exit the receive path took
(queued, dropped_diverged, dropped_load).

One key with two value domains means any aggregation that does not also
filter on span name mixes them. Merging the two branches also produced a
duplicate constexpr declaration in one header, which is how the compiler
surfaced it.

The established accept-path key keeps its name; this one becomes
validation_receive_status, qualified by the span phase it describes. The
values are unchanged.
2026-09-03 16:55:03 +01:00
Pratik Mankawde
4c8904c2c9 fix(telemetry): follow the close-time attr rename in the ledger spans
phase-4 renamed the shared close_time attribute to
close_time_ripple_epoch_s, naming its unit and epoch. Two consumers here
still referenced the old spelling and broke the build once the rename
merged forward: the re-export in LedgerSpanNames.h and the setAttribute
call in BuildLedger.cpp.

Both are phase-6 content, so they are fixed here rather than upstream.
2026-09-03 16:54:48 +01:00
Pratik Mankawde
06c5d36f03 Merge branch 'pratik/otel-phase1a-plan-docs' into pratik/otel-phase1b-telemetry-infra 2026-09-03 16:50:41 +01:00
Pratik Mankawde
ef2b627f8e merged develop
Signed-off-by: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com>
2026-09-03 16:50:06 +01:00
Pratik Mankawde
f52e654c53 merge: bring the metrics_endpoint key forward from phase-9 2026-09-03 16:47:45 +01:00
Pratik Mankawde
5ba1edf648 fix(telemetry): use metrics_endpoint verbatim in initMetrics
initMetrics() held its own copy of the suffix-swap: take tracesEndpoint,
replace a trailing /v1/traces with /v1/metrics. Any other URL shape sent
metrics to the traces path. metrics_endpoint is now a config key of its
own, so use it as given.

Application::startTelemetry() still reads the key itself for
MetricsRegistry, which builds its own exporter. Telemetry exposes no
accessor for the Setup it parsed, and re-parsing would re-run the mTLS
validation and cert-file checks at a later point in startup, so the
second read stays. The comment above it no longer claims the URL is
derived from the traces one.

Also corrects 05-configuration-reference.md: the sample configs carry
metrics_endpoint where exporter used to sit, not a comment.
2026-09-03 16:47:25 +01:00
Pratik Mankawde
a5d5d0911f merge: bring the metrics_endpoint key forward from phase-8
Telemetry.cpp conflicted. Phase-9 rewrote the metrics pipeline into
makeTracerResource()/makeMetricsResource()/initMetrics() further down the
class, so its side of the region is empty and phase-8's private helper
block does not apply. Resolved to phase-9's structure; phase-8's own
hunks outside the region (the deleted kTracesPath/kMetricsPath, the
verbatim traces URL, the two-endpoint startup log) merged in.

Phase-9's initMetrics() still derives the metrics URL by suffix-swap.
That is fixed in the next commit, not here.
2026-09-03 16:45:09 +01:00
Pratik Mankawde
4587986a93 merge: bring the metrics_endpoint key forward from phase-7 2026-09-03 16:40:59 +01:00
Pratik Mankawde
7b845392d4 feat(telemetry): give metrics its own endpoint key
One [telemetry] key served both OTLP signals, and the metrics URL was
derived from it by suffix-swap: strip a trailing slash, strip a known
signal path if present, append the wanted one. Anything not ending
/v1/traces therefore posted metrics to the traces path, and the OTLP
version was pinned in code where an operator could not reach it.

Adds metrics_endpoint alongside traces_endpoint. Both are full URLs used
verbatim, so traces and metrics can go to different collectors, or to one
whose OTLP paths are not the defaults. signalEndpoint(), kTracesPath and
kMetricsPath are gone; nothing derives an endpoint from another.

The startup log names both URLs, since with two independent endpoints
there was otherwise no way to see where metrics were going.

Also drops exporter=otlp_http from the shipped config and the test
fixture. No branch in the chain reads an `exporter` key: it was a real
Setup member in the first phase-1b implementation, removed when only
OTLP/HTTP was wired up, and already deleted from TESTING.md once on the
same grounds.
2026-09-03 16:39:04 +01:00
Pratik Mankawde
3e930d9d37 merge: bring the traces_endpoint rename forward from phase-9 2026-09-03 16:07:14 +01:00
Pratik Mankawde
3aff6d4d64 merge: bring the traces_endpoint rename forward from phase-8
Eighteen conflict regions across nine files. Resolved by asking, per
region, which side is the better final state rather than by taking a
branch wholesale.

Telemetry.cpp keeps phase-9's two resource builders. phase-8 offered a
single makeResource() with no node identity; phase-9 splits it into
makeTracerResource() and makeMetricsResource() because the metrics
provider is built in the constructor, before setNodeId() runs, so
xrpl.node.id can only be stamped unconditionally on the tracer side.
Collapsing them would have dropped that attribute, which is what keeps
per-node traces from folding into one identity.

Telemetry.h and the config test compose both sides: phase-9's nodeId
member and its assertion, plus the renamed endpoint.

xrpld-telemetry.cfg keeps phase-9's devnet identity and its
metrics_endpoint, renames the traces key, and drops exporter=otlp_http.
Nothing reads an `exporter` key on any branch in the chain: it was a real
Setup member in the first phase-1b implementation, removed when only
OTLP/HTTP was wired up, and already deleted from TESTING.md once on the
same grounds. The cfg line was the last carrier.

The docs keep phase-9's versions, which are both fuller and more
accurate: the incoming runbook listed the consensus strategy values as
"random" where the code compares against "attribute".

OTelCollector.cpp had five comment-only regions in a file phase-7 owns,
so those take the upstream side.

MetricsRegistry.h's usage example named a member that no longer exists
and the wrong arity; it now matches the real three-argument call and says
where the endpoint comes from.
2026-09-03 16:06:38 +01:00
Bart
2ddf6ee148 ci: Update pre-commit SHA (#8169)
Co-authored-by: Bart <11445373+bthomee@users.noreply.github.com>
2026-09-03 14:52:42 +00:00
Pratik Mankawde
8ce4f71427 docs: Use consistent heading levels in PR template (#8155) 2026-09-03 14:48:32 +00:00
Pratik Mankawde
9fd5414fe6 merge: bring the traces_endpoint rename forward from phase-7
Ten conflict regions in four files, none of them caused by the rename.
phase-8's own commit had rewritten comments in files phase-7 owns
(Unit.h, HistogramBuckets.h, OTelCollector.cpp) and in Telemetry.cpp,
while the same sweep ran independently on phase-7.

Resolved every region to phase-7's side on ownership grounds: those files
belong to phase-7 or earlier, so a downstream branch should not carry
divergent copies. phase-8 changed comments only in all four, verified
against the merge base, so no code was dropped.

The one structural region: phase-7 had refactored addUnitView from an
inline lambda into a member function, and phase-8 still held the lambda.
Keeping phase-8's would have shadowed the member.

Wording phase-8 had that is worth restoring on phase-7 -- the "legacy"
qualifier on the prefix parameter, and the rejected-alternative note on
the bucket ladders -- is recorded outside the tree for a follow-up.
2026-09-03 15:43:24 +01:00
Pratik Mankawde
8d1eacc5fc merge: bring the traces_endpoint rename forward from phase-6
Three conflicts, all composed rather than resolved by taking a side:

- TelemetryConfig.cpp: phase-6 kept networkTypeFromId file-local with
  [[nodiscard]]; phase-7 had relocated it to public scope for
  Application.cpp. Kept phase-7's relocation, so one definition remains.
  The [[nodiscard]] survives on the declaration in Telemetry.h.
- Telemetry.cpp x2: phase-7 added getMeter overrides, phase-6 added
  [[nodiscard]] to the startSpan below them. Kept both, and put
  [[nodiscard]] on getMeter too.
- TESTING.md: phase-7 had the right metric name (span_calls_total, which
  the spanmetrics namespace produces) but the wrong label. Its
  xrpl.rpc.command appears nowhere else in the branch; the attribute is
  bare `command`, which is what the dashboards query. Took phase-7's
  metric with the correct label.

Both signalEndpoint call sites follow the renamed member. signalEndpoint
itself is left in place: removing it and adding metrics_endpoint is a
design change, not part of propagating a rename.
2026-09-03 15:38:47 +01:00
Pratik Mankawde
8c695b69a5 fix(telemetry): follow the traces_endpoint rename in the node configs
The rename arrived from phase-1b by merge. Four files still wrote the old
key, which the parser no longer reads, so each would have silently
fallen back to the default collector URL.

integration-test.sh is the load-bearing one: it generates the node config
the test harness starts, so the stale key would have pointed the node at
localhost regardless of the compose network. xrpld-telemetry.cfg is the
standalone node config; the other two document the key.

Note this cfg has a second, divergent variant on the devnet branches that
needs the same fix there.
2026-09-03 15:21:01 +01:00
Pratik Mankawde
91c7137373 merge: bring the traces_endpoint rename forward from phase-5 2026-09-03 15:20:30 +01:00
Pratik Mankawde
7b6be0ba39 merge: bring the traces_endpoint rename forward from phase-4
Conflict in OpenTelemetryPlan/05-configuration-reference.md: phase-5 had
corrected the enabled and use_tls types to 0 or 1 and added the
tls_client_cert and tls_client_key rows, while the incoming side renamed
the endpoint option.

Composed both — phase-5's type corrections and its two mTLS rows are
kept, with the endpoint row renamed to traces_endpoint.
2026-09-03 15:20:15 +01:00
Pratik Mankawde
f80ea03c82 merge: bring the traces_endpoint rename forward from phase3-tx-tracing 2026-09-03 15:19:42 +01:00
Pratik Mankawde
1330319564 merge: bring the traces_endpoint doc rename forward from phase-2
Conflict in OpenTelemetryPlan/05-configuration-reference.md: phase-3 had
widened the options table and added the tx_trace_strategy and
consensus_trace_strategy rows, while the incoming side renamed the
endpoint option.

Composed both — phase-3's wider layout and its two extra rows are kept,
with the endpoint row renamed to traces_endpoint.
2026-09-03 15:19:25 +01:00
Pratik Mankawde
4d8aa31f69 merge: bring the traces_endpoint doc rename forward from phase1c-rpc-integration 2026-09-03 15:18:36 +01:00
Pratik Mankawde
9d48c84466 merge: bring the traces_endpoint doc rename forward from phase1b-telemetry-infra 2026-09-03 15:18:36 +01:00
Pratik Mankawde
2bfae3c805 merge: bring the traces_endpoint doc rename forward from phase1a-plan-docs 2026-09-03 15:18:36 +01:00
Pratik Mankawde
40877ab6fb docs(telemetry): rename the endpoint option to traces_endpoint
The [telemetry] option table documents the config key operators copy.
The key is now traces_endpoint, named for the one OTLP signal it
carries, so the old row pointed at a key the parser no longer reads.

Two prose mentions of "endpoint" further down describe the concept
rather than naming the key, and are left alone.
2026-09-03 15:18:17 +01:00
Pratik Mankawde
f87dff3eb6 docs(telemetry): follow the traces_endpoint rename in the runbook
The rename arrived from phase-1b by merge; the runbook still told
operators to set `endpoint`, which the parser no longer reads. Updates
the Quick Start ini block and the Configuration Reference row.

No metrics_endpoint row is added: this branch exports no metrics, so
documenting the key here would describe something the code ignores.
2026-09-03 15:16:39 +01:00
Pratik Mankawde
5f76f1bdbc merge: bring the traces_endpoint rename forward from phase-4 2026-09-03 15:15:43 +01:00
Pratik Mankawde
e57d3c2f4b merge: bring the traces_endpoint rename forward from phase3-tx-tracing 2026-09-03 15:15:33 +01:00
Pratik Mankawde
65a679b7cd merge: bring the traces_endpoint rename forward from phase2-rpc-tracing 2026-09-03 15:15:33 +01:00
Pratik Mankawde
d00a550895 test(telemetry): follow the traces_endpoint rename in the config test
The rename arrived from phase-1b by merge, which left this test naming a
member that no longer exists. Updates both assertions to tracesEndpoint
and the section key to traces_endpoint.

The key matters as much as the member: had only the member been renamed,
the parse would have fallen back to the default and the test would have
compared the collector URL against localhost.
2026-09-03 15:15:09 +01:00