Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/common/Tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct TraceConfig {
std::string otlpHeaders;
bool oltpSecure;

std::string clusterID;
int nodeID;
};

Expand Down
3 changes: 2 additions & 1 deletion src/common/Tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<trace_sdk::ParentBasedSampler>(std::make_shared<trace_sdk::AlwaysOnSampler>());
std::shared_ptr<trace::TracerProvider> provider =
Expand Down