-
Notifications
You must be signed in to change notification settings - Fork 509
Description
@marcalff @nikhilbhatia08, this PR breaks a bunch of existing code without providing a sensible alternative.
Prior to that we were using the following syntax using C++20 aggregate initialization:
auto processor = otel::BatchSpanProcessorFactory::Create(
std::move(exporter),
otel::BatchSpanProcessorOptions{
.max_queue_size = config.batch().max_queue_size(),
.schedule_delay_millis = std::chrono::milliseconds(config.batch().schedule_delay().MilliSeconds()),
.max_export_batch_size = config.batch().max_export_batch_size(),
}
);
Originally posted by @georgthegreat in #3661 (comment)
Solution - I believe the issue comes from adding a user-defined constructor, which means BatchSpanProcessorOptions is no longer an aggregate type. That disables C++20 designated initializers, so patterns like .max_queue_size = ... stop working even though they worked earlier.
We can fix this by removing the constructor and using default member initializers along with a small set of static helper functions for the environment variable logic. This restores aggregate initialization while keeping the original behavior intact.