open-telemetry / opentelemetry-cpp-contrib

https://opentelemetry.io/
Apache License 2.0
121 stars 130 forks source link

instrumentation/nginx: include batch_span_processor_options to fix build #314

Closed mfrw closed 10 months ago

mfrw commented 11 months ago

The current build fails as it not able to find BatchSpanProcessorOptions. This struct is only forward-declared.

../otel-cpp-contrib/opentelemetry-cpp-contrib-866351ce2422a9d953ded4447bcdea0e587d6a53/instrumentation/nginx/src/otel_ngx_module.cpp: In function 'std::unique_ptr<opentelemetry::v1::sdk::trace::SpanProcessor> CreateProcessor(const OtelNgxAgentConfig*, std::unique_ptr<opentelemetry::v1::sdk::trace::SpanExporter>)':
../otel-cpp-contrib/opentelemetry-cpp-contrib-866351ce2422a9d953ded4447bcdea0e587d6a53/instrumentation/nginx/src/otel_ngx_module.cpp:1039:41: error: aggregate 'opentelemetry::v1::sdk::trace::BatchSpanProcessorOptions opts' has incomplete type and cannot be defined.
 1039 |     sdktrace::BatchSpanProcessorOptions opts;

I have also raised a PR with opentelemetry-cpp which i feel is the actual place we should add the include. This PR is to ensure main builds with the current HEAD.

Related PR: