From aed3d4f6ab61ba28a17a7e564cf75afd9c9482b8 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Sun, 8 Mar 2026 19:04:46 +0000 Subject: [PATCH] Respect custom service_instance_id when set in [telemetry] config Only override serviceInstanceId with the node public key when the user hasn't explicitly set service_instance_id in the [telemetry] section. This allows operators to assign human-friendly names (e.g. "validator-1") while still defaulting to the node's base58 public key. Co-Authored-By: Claude Opus 4.6 --- src/xrpld/app/main/Application.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/xrpld/app/main/Application.cpp b/src/xrpld/app/main/Application.cpp index 9bf94dd907..12427d0ffb 100644 --- a/src/xrpld/app/main/Application.cpp +++ b/src/xrpld/app/main/Application.cpp @@ -1269,10 +1269,12 @@ ApplicationImp::setup(boost::program_options::variables_map const& cmdline) nodeIdentity_ = getNodeIdentity(*this, cmdline); // Now that the node identity is known, inject it into the telemetry - // resource attributes. The Telemetry object was constructed with an - // empty serviceInstanceId because nodeIdentity_ is not available in - // the ApplicationImp member initializer list. - telemetry_->setServiceInstanceId(toBase58(TokenType::NodePublic, nodeIdentity_->first)); + // resource attributes — but only if the user didn't already set a + // custom service_instance_id in [telemetry]. The Telemetry object + // was constructed with an empty serviceInstanceId because + // nodeIdentity_ is not available in the member initializer list. + if (!config_->section("telemetry").exists("service_instance_id")) + telemetry_->setServiceInstanceId(toBase58(TokenType::NodePublic, nodeIdentity_->first)); if (!cluster_->load(config().section(SECTION_CLUSTER_NODES))) {