Skip to content

-DWITH_OTLP_FILE=ON -DWITH_EXAMPLES=ON is not compiling the file_metric_main.cc #3225

@SudhirKesti

Description

@SudhirKesti

Describe your environment
Building opentlemetry-cpp with file exporter ON. Example code examples/otlp/file_metric_main.cc is not compiling.

Steps to reproduce
cmake -S . -B cmakebuilddir -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DWITH_OTLP_FILE=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DOPENTELEMETRY_INSTALL=ON -DWITH_EXAMPLES=ON

What is the expected behavior?
As -DWITH_OTLP_FILE and WITH_EXAMPLES are set to ON expected to compile the code examples/otlp/file_metric_main.cc

What is the actual behavior?
examples/otlp/file_metric_main.cc is compiled only when WITH_OTLP_GRPC OR WITH_OTLP_HTTP

Additional context
-- NA --

Patch to fix this:
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -3,7 +3,7 @@

add_subdirectory(common)
include_directories(common)
-if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
+if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP OR WITH_OTLP_FILE)
add_subdirectory(otlp)
endif()
if(WITH_OTLP_GRPC)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions