mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-09 00:00:20 +00:00
fix(telemetry): resolve clang-tidy include and modernize-use-auto CI errors
- Replace unused observer_result.h with nostd/shared_ptr.h and nostd/unique_ptr.h in MetricsRegistry.h (misc-include-cleaner) - Use auto for cast initializations in MetricsRegistry.cpp and ValidationTracker test (modernize-use-auto) - Run rename scripts: rippled -> xrpld in comments and docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -465,7 +465,7 @@ These metrics serve multiple external consumer categories identified during rese
|
||||
|
||||
### Purpose
|
||||
|
||||
Phase 9 exports ~68 internal rippled metrics and ships Grafana dashboards for
|
||||
Phase 9 exports ~68 internal xrpld metrics and ships Grafana dashboards for
|
||||
them. This adds the missing operator-facing piece: **provisioned Grafana alert
|
||||
rules** that fire on the health-critical metrics phase 9 introduces. The
|
||||
phase-9 task list (line 311) and Jira story RIPD-5187 both already list
|
||||
|
||||
@@ -888,7 +888,7 @@ Requires `trace_peer=1` in the `[telemetry]` config section.
|
||||
|
||||
## Alerting
|
||||
|
||||
rippled provisions six Grafana alert rules on the health-critical metrics, so a
|
||||
xrpld provisions six Grafana alert rules on the health-critical metrics, so a
|
||||
stock stack alerts out of the box with no UI setup. Rules are provisioned from
|
||||
`docker/telemetry/grafana/provisioning/alerting/` and load automatically when
|
||||
the Grafana container starts. They appear under **Alerting → Alert rules**,
|
||||
|
||||
@@ -178,7 +178,7 @@ TEST_F(ValidationTrackerTest, MaxPendingEventsTrimming)
|
||||
for (std::size_t i = 0; i < kCount; ++i)
|
||||
{
|
||||
auto const hash = makeHash(i + 1);
|
||||
LedgerIndex const seq = static_cast<LedgerIndex>(i + 1);
|
||||
auto const seq = static_cast<LedgerIndex>(i + 1);
|
||||
tracker_.recordOurValidation(hash, seq);
|
||||
tracker_.recordNetworkValidation(hash, seq);
|
||||
}
|
||||
|
||||
@@ -1032,11 +1032,11 @@ MetricsRegistry::registerPeerQualityGauge()
|
||||
int divergedCount = 0;
|
||||
|
||||
// Encode a version string into BuildInfo's comparable numeric
|
||||
// form. Peers report the full "rippled-3.3.0-b0" string while
|
||||
// form. Peers report the full "xrpld-3.3.0-b0" string while
|
||||
// our baseline is the bare "3.3.0-b0", and SemanticVersion
|
||||
// requires a leading digit, so strip any non-digit prefix
|
||||
// first. Numeric encoding avoids the lexicographic bug where
|
||||
// "2.3.0" > "2.10.0" and "rippled-..." > "3...".
|
||||
// "2.3.0" > "2.10.0" and "xrpld-..." > "3...".
|
||||
auto const encodeVersion = [](std::string_view v) -> std::uint64_t {
|
||||
auto const firstDigit = v.find_first_of("0123456789");
|
||||
if (firstDigit == std::string_view::npos)
|
||||
@@ -1242,7 +1242,7 @@ MetricsRegistry::registerStateTrackingGauge()
|
||||
|
||||
// State value: 0-4 from OperatingMode, 5=validating, 6=proposing.
|
||||
auto const mode = app.getOPs().getOperatingMode();
|
||||
double stateValue = static_cast<double>(mode);
|
||||
auto stateValue = static_cast<double>(mode);
|
||||
|
||||
// If FULL, refine using consensus info for validating/proposing.
|
||||
if (mode == OperatingMode::FULL)
|
||||
|
||||
@@ -142,7 +142,8 @@
|
||||
#ifdef XRPL_ENABLE_TELEMETRY
|
||||
#include <opentelemetry/metrics/meter.h>
|
||||
#include <opentelemetry/metrics/meter_provider.h>
|
||||
#include <opentelemetry/metrics/observer_result.h>
|
||||
#include <opentelemetry/nostd/shared_ptr.h>
|
||||
#include <opentelemetry/nostd/unique_ptr.h>
|
||||
#include <opentelemetry/sdk/metrics/meter_provider.h>
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user