Skip to content

with vcpkg install opentelemetry-cpp[otlp_http], no libopentelemetry_exporter_otlp_http.a or exporters/otlp/*.h #1978

@jodavaho

Description

@jodavaho

Describe your environment

Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal

vcpkg package management program version 2023-01-24-8a88d63f241d391772fbde69af9cab96c3c64c75

I am compiling just the http_main.cc file from examples/otlp/http_main.cc in a new project that uses vcpkg to satisfy dependencies, to test the vcpkg route to see if that works better than building/installing from source.

vcpkg.json:

{
  "name": "test-otel",
    "version-string": "0.1.0",
    "dependencies": [
    {
      "name": "opentelemetry-cpp",
      "default-features": true,
      "features":["otlp-http"]
    },
    "abseil",
    "protobuf"
    ]
}

Steps to reproduce

mkdir build && cd build
cp ~/<path to opentelemetry-cpp>/examples/otlp/http_main.cc ../src/main.cpp
#... make any old ../CMakeLists.txt that has
# find_package(opentelemetry-cpp CONFIG REQUIRED)
cmake .. -DCMAKE_TOOLCHAIN_FILE=~/<path to vcpkg>/scripts/buildsystems/vcpkg.cmake
... vcpkg does its thing ...
$ tree ../vcpkg_installed/x64-linux/include/opentelemetry/exporters/
../vcpkg_installed/x64-linux/include/opentelemetry/exporters/
├── memory
│   ├── in_memory_data.h
│   ├── in_memory_span_data.h
│   ├── in_memory_span_exporter_factory.h
│   └── in_memory_span_exporter.h
└── ostream
    ├── common_utils.h
    ├── log_record_exporter.h
    ├── metric_exporter.h
    ├── span_exporter_factory.h
    └── span_exporter.h

What is the expected behavior?

$ tree ../vcpkg_installed/x64-linux/include/opentelemetry/exporters/
../vcpkg_installed/x64-linux/include/opentelemetry/exporters/
├── otlp
│   └── otlp_http_exporter.h (etc)
├── memory
│   ├── in_memory_data.h
│   ├── in_memory_span_data.h
│   ├── in_memory_span_exporter_factory.h
│   └── in_memory_span_exporter.h
└── ostream
    ├── common_utils.h
    ├── log_record_exporter.h
    ├── metric_exporter.h
    ├── span_exporter_factory.h
    └── span_exporter.h

What is the actual behavior?

  • no otlp_http related headers installed
  • no libopentelemetry_exporter_otlp_http.a (or .so)

Additional context
Similar to #1975 , I suspect the exporter will not be built unless I also include opentelemetry-cpp[otlp,otlp_http], but that is highly undesirable because it pulls grpc, which is currently a showstopper for various reasons. Since grpc is not actually required, there should be a mutually exclusive option for http.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions