-
Notifications
You must be signed in to change notification settings - Fork 524
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedGood for taking. Extra help will be provided by maintainersGood for taking. Extra help will be provided by maintainerstriage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.
Description
The same code works correctly when using the OpenTelemetry Tracer, Span, and OTLP Exporter. However, the application crashes when switching to the ETW Exporter.
Code to Reproduce (ETW Exporter)
void TestEtwTracer()
{
auto traceProvider = std::make_unique<opentelemetry::exporter::etw::TracerProvider>();
auto tracer = traceProvider->GetTracer("Geneva-Tracer-Foo");
auto spanFoo = tracer->StartSpan("Span-Foo");
tracer = traceProvider->GetTracer("Geneva-Tracer-Bar");
auto spanBar = tracer->StartSpan("Span-Bar");
spanFoo->End();
spanBar->End();
}Crash Screenshot
Code to Reproduce (OTLP Exporter – Works as Expected)
void TestOTelTracer()
{
auto ostream_exporter = opentelemetry::exporter::trace::OStreamSpanExporterFactory::Create();
auto ostream_processor = opentelemetry::sdk::trace::SimpleSpanProcessorFactory::Create(std::move(ostream_exporter));
std::vector<std::unique_ptr<opentelemetry::sdk::trace::SpanProcessor>> processors;
processors.push_back(std::move(ostream_processor));
auto resource_attributes = opentelemetry::sdk::resource::ResourceAttributes{ {"service.name", "Test OTel"} };
auto resource_ptr = opentelemetry::sdk::resource::Resource::Create(resource_attributes);
std::unique_ptr<opentelemetry::sdk::trace::TracerContext> context =
opentelemetry::sdk::trace::TracerContextFactory::Create(std::move(processors), resource_ptr);
auto traceProvider = opentelemetry::sdk::trace::TracerProviderFactory::Create(std::move(context));
auto tracer = traceProvider->GetTracer("OTel-Tracer-Foo");
auto spanFoo = tracer->StartSpan("Span-Foo");
tracer = traceProvider->GetTracer("OTel-Tracer-Bar");
auto spanBar = tracer->StartSpan("Span-Bar");
spanFoo->End();
spanBar->End();
}Screenshot (No Crash)

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedGood for taking. Extra help will be provided by maintainersGood for taking. Extra help will be provided by maintainerstriage/acceptedIndicates an issue or PR is ready to be actively worked on.Indicates an issue or PR is ready to be actively worked on.