microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.06k stars 6.36k forks source link

[opentelemetry-cpp] Missing features #21124

Closed juandemanjon closed 2 years ago

juandemanjon commented 2 years ago

There are missing OpenTelemetry features:

OTLP exporter depends on opentelemetry-proto which is utilized as a submodule at opentelemetry-cpp/third_party/opentelemetry-proto@795cc81 if I do manually add otlp to the feature list in the vcpkg portfile.cmake then the vcpkg build fails because the third_party folder was empty. It is needed to clone the submodules after downloading open-telemetry-opentelemetry-cpp-v1.0.1.tar.gz

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
    FEATURES
        etw WITH_ETW
        zipkin WITH_ZIPKIN
        prometheus WITH_PROMETHEUS
        elasticsearch WITH_ELASTICSEARCH
        jaeger WITH_JAEGER

        otlp WITH_OTLP
)
jacogasp commented 1 year ago

Hello, the CMakeLists file from opentelemetry offers two flags for OTLP: WITH_OTLP_GRPC and WITH_OTLP_HTTP (and other options).

In my specific case I need to use the otlp-http feature, which requires the generic otlp feature in vcpkg, and it works as expected.

But, in the vcpkg.json of this port, there is no otlp-grpc and thus gRPC is added as dependencies for the generic otlp feature (see here), while here we can see that is required only when gRPC is explicitly requested.

Now, as I said above everything works for otlp-http but gRPC is still downloaded and compiled, taking an infinite amount of time (more than half an hour on my machine for gRPC only), and resources for nothing.

Wouldn't be better to separate the two features such as only the required dependencies are downloaded and compiled?

juandemanjon commented 1 year ago

I think what you are asking for, was done at #29483 by @ThomsonTan

try to do with the latest vcpkg

vcpkg search opentelemetry-cpp
azure-core-tracing-opentelemetry-cpp 1.0.0-beta.4 Microsoft Azure Core Tracing OpenTelemetry SDK for C++
opentelemetry-cpp        1.8.3#1          OpenTelemetry is a collection of tools, APIs, and SDKs.
opentelemetry-cpp[elasticsearch]          Whether to include the Elasticsearch Client in the SDK
opentelemetry-cpp[etw]                    Whether to include the ETW Exporter in the SDK
opentelemetry-cpp[jaeger]                 Whether to include the Jaeger exporter
opentelemetry-cpp[otlp]                   Whether to include the OpenTelemetry Protocol in the SDK
opentelemetry-cpp[otlp-http]              Whether to include the OpenTelemetry Protocol over HTTP in the SDK
opentelemetry-cpp[prometheus]             Whether to include the Prometheus Client in the SDK
opentelemetry-cpp[zipkin]                 Whether to include the Zipkin exporter in the SDK
opentelemetry-cpp[zpages]                 Whether to include the Zpages Server in the SDK
The result may be outdated. Run `git pull` to get the latest results.
If your port is not listed, please open an issue at and/or consider making a pull request.    -  https://github.com/Microsoft/vcpkg/issues

I suggest creating a new issue here and pinging @ThomsonTan and asking for help at https://cloud-native.slack.com/archives/C01N3AT62SJ

jacogasp commented 1 year ago

I think what you are asking for, was done at #29483 by @ThomsonTan

try to do with the latest vcpkg

vcpkg search opentelemetry-cpp
azure-core-tracing-opentelemetry-cpp 1.0.0-beta.4 Microsoft Azure Core Tracing OpenTelemetry SDK for C++
opentelemetry-cpp        1.8.3#1          OpenTelemetry is a collection of tools, APIs, and SDKs.
opentelemetry-cpp[elasticsearch]          Whether to include the Elasticsearch Client in the SDK
opentelemetry-cpp[etw]                    Whether to include the ETW Exporter in the SDK
opentelemetry-cpp[jaeger]                 Whether to include the Jaeger exporter
opentelemetry-cpp[otlp]                   Whether to include the OpenTelemetry Protocol in the SDK
opentelemetry-cpp[otlp-http]              Whether to include the OpenTelemetry Protocol over HTTP in the SDK
opentelemetry-cpp[prometheus]             Whether to include the Prometheus Client in the SDK
opentelemetry-cpp[zipkin]                 Whether to include the Zipkin exporter in the SDK
opentelemetry-cpp[zpages]                 Whether to include the Zpages Server in the SDK
The result may be outdated. Run `git pull` to get the latest results.
If your port is not listed, please open an issue at and/or consider making a pull request.    -  https://github.com/Microsoft/vcpkg/issues

I suggest creating a new issue here and pinging @ThomsonTan and asking for help at https://cloud-native.slack.com/archives/C01N3AT62SJ

Thank you @juandemanjon, I'm actually using that version and as I described above it downloads "unwanted" dependencies for the http version. I'm going to open a new issue as you suggested, thank you for the support.