Skip to content

Commit

Permalink
HPCC-31320 Report name of service traced
Browse files Browse the repository at this point in the history
- Creates OTEL resource with service.name attr
- Reports current component as service.name

Signed-off-by: Rodrigo Pastrana <[email protected]>
  • Loading branch information
rpastrana committed Feb 26, 2024
1 parent 68e0dbd commit 37d3cf8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion system/jlib/jtrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1220,9 +1220,12 @@ void CTraceManager::initTracerProviderAndGlobalInternals(const IPropertyTree * t
processors.push_back(opentelemetry::sdk::trace::SimpleSpanProcessorFactory::Create(std::move(exporter)));
}

opentelemetry::sdk::resource::ResourceAttributes resourceAtts = {{"service.name", moduleName.get()}};
auto jtraceResource = opentelemetry::sdk::resource::Resource::Create(resourceAtts);

// Default is an always-on sampler.
std::shared_ptr<opentelemetry::sdk::trace::TracerContext> context =
opentelemetry::sdk::trace::TracerContextFactory::Create(std::move(processors));
opentelemetry::sdk::trace::TracerContextFactory::Create(std::move(processors), jtraceResource);
std::shared_ptr<opentelemetry::trace::TracerProvider> provider =
opentelemetry::sdk::trace::TracerProviderFactory::Create(context);

Expand Down

0 comments on commit 37d3cf8

Please sign in to comment.