diff --git a/include/common/Tracer.h b/include/common/Tracer.h index 91e1de9..3edd907 100644 --- a/include/common/Tracer.h +++ b/include/common/Tracer.h @@ -31,6 +31,7 @@ struct TraceConfig { std::string otlpHeaders; bool oltpSecure; + std::string clusterID; int nodeID; }; diff --git a/src/common/Tracer.cpp b/src/common/Tracer.cpp index 19bd473..b97ade9 100644 --- a/src/common/Tracer.cpp +++ b/src/common/Tracer.cpp @@ -105,7 +105,8 @@ initTelemetry(const TraceConfig& cfg) { } if (export_created) { auto processor = trace_sdk::BatchSpanProcessorFactory::Create(std::move(exporter), {}); - resource::ResourceAttributes attributes = {{"service.name", TRACE_SERVICE_SEGCORE}, {"NodeID", cfg.nodeID}}; + auto service_name = cfg.clusterID + "-" + TRACE_SERVICE_SEGCORE; + resource::ResourceAttributes attributes = {{"service.name", service_name}, {"NodeID", cfg.nodeID}}; auto resource = resource::Resource::Create(attributes); auto sampler = std::make_unique(std::make_shared()); std::shared_ptr provider =