Merge branch 'pratik/otel-phase8-log-correlation' into pratik/otel-phase9-metric-gap-fill

This commit is contained in:
Pratik Mankawde
2026-07-08 17:49:51 +01:00
4 changed files with 12 additions and 16 deletions

View File

@@ -822,21 +822,17 @@ OTelCollectorImp::otelMeter() const
std::string
OTelCollectorImp::formatName(std::string const& name) const
{
// StatsD uses "prefix.group.name" format. The OTel StatsD receiver
// converts dots to underscores for Prometheus. We replicate this
// to preserve metric name compatibility.
//
// Example: prefix="xrpld", name="LedgerMaster.Validated_Ledger_Age"
// -> "xrpld_LedgerMaster_Validated_Ledger_Age"
// Produce a clean, lowercase, Prometheus-compatible metric name.
// No prefix — the OTel resource (service.name) identifies the service.
// Dots and spaces become underscores; everything lowercased.
std::string result;
if (!prefix_.empty())
{
result = prefix_;
result += '_';
}
result.reserve(name.size());
for (char const c : name)
{
result += (c == '.') ? '_' : c;
if (c == '.' || c == ' ')
result += '_';
else
result += static_cast<char>(std::tolower(static_cast<unsigned char>(c)));
}
return result;
}

View File

@@ -394,7 +394,7 @@ public:
stopwatch(),
logs_->journal("TaggedCache"))
, cachedSLEs_(
"Cached SLEs",
"Cached_SLEs",
0,
std::chrono::minutes(1),
stopwatch(),

View File

@@ -278,7 +278,7 @@ public:
{Category::ShareCasObject, "getobject_CAS_share"},
{Category::GetCasObject, "getobject_CAS_get"},
{Category::ShareFetchPack, "getobject_Fetch_Pack_share"},
{Category::GetFetchPack, "getobject_Fetch Pack_get"},
{Category::GetFetchPack, "getobject_Fetch_Pack_get"},
{Category::GetTransactions, "getobject_Transactions_get"},
{Category::ShareHash, "getobject_share"},
{Category::GetHash, "getobject_get"},

View File

@@ -27,7 +27,7 @@ NodeFamily::NodeFamily(Application& app, CollectorManager& cm)
, j_(app.getJournal("NodeFamily"))
, fbCache_(
std::make_shared<FullBelowCache>(
"Node family full below cache",
"Node_family_full_below_cache",
stopwatch(),
app.getJournal("NodeFamilyFulLBelowCache"),
cm.collector(),
@@ -35,7 +35,7 @@ NodeFamily::NodeFamily(Application& app, CollectorManager& cm)
kFullBelowExpiration))
, tnCache_(
std::make_shared<TreeNodeCache>(
"Node family tree node cache",
"Node_family_tree_node_cache",
app.config().getValueFor(SizedItem::TreeCacheSize),
std::chrono::seconds(app.config().getValueFor(SizedItem::TreeCacheAge)),
stopwatch(),