[opentelemetry-cpp] Add geneva exporter as a feature (#36356)

* [opentelemetry-cpp] Add geneva exporter as a feature

* Initialize component path as empty list

* Update description

* Address feedback on adding comment about the design
This commit is contained in:
Tom Tan 2024-01-25 12:58:28 -08:00 committed by GitHub
parent 3b21386457
commit ecbea92dbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 4 deletions

View File

@ -23,6 +23,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
elasticsearch WITH_ELASTICSEARCH
otlp-http WITH_OTLP_HTTP
otlp-grpc WITH_OTLP_GRPC
geneva WITH_GENEVA
)
# opentelemetry-proto is a third party submodule and opentelemetry-cpp release did not pack it.
@ -43,18 +44,33 @@ if(WITH_OTLP_GRPC)
list(APPEND FEATURE_OPTIONS "-DgRPC_CPP_PLUGIN_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/grpc/grpc_cpp_plugin${VCPKG_HOST_EXECUTABLE_SUFFIX}")
endif()
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "OFF")
if(WITH_GENEVA)
# Geneva exporters from opentelemetry-cpp-contrib are tightly coupled with opentelemetry-cpp repo, so they should be ported as a feature under opentelemetry-cpp.
# TODO: merge the opentelemetry-fluentd port to opentelemery-cpp port.
vcpkg_from_github(
OUT_SOURCE_PATH CONTRIB_SOURCE_PATH
REPO open-telemetry/opentelemetry-cpp-contrib
REF bf3e3833498d45865f85423764f0d98372fe5646
HEAD_REF main
SHA512 d8468997f8d2545d3bb230fd6c8072d70f6842020e9b6ac9cd7725d4c9e728f307618943c96af9cf9116ea2952c1e225e5dd3d4cf829644ad4f1f4c74dd14a0c
)
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "")
list(APPEND OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "${CONTRIB_SOURCE_PATH}/exporters/geneva")
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTING=OFF
-DWITH_EXAMPLES=OFF
-DWITH_LOGS_PREVIEW=ON
-DOPENTELEMETRY_INSTALL=ON
-DWITH_ABSEIL=ON
-DOPENTELEMETRY_EXTERNAL_COMPONENT_PATH="${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}"
${FEATURE_OPTIONS}
MAYBE_UNUSED_VARIABLES
WITH_OTLP_GRPC
WITH_LOGS_PREVIEW
WITH_GENEVA
)
vcpkg_cmake_install()

View File

@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "opentelemetry-cpp",
"version-semver": "1.13.0",
"port-version": 1,
"port-version": 2,
"description": [
"OpenTelemetry is a collection of tools, APIs, and SDKs.",
"You use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis in order to understand your software's performance and behavior."
@ -30,6 +30,9 @@
"description": "Whether to include the ETW Exporter in the SDK",
"supports": "windows"
},
"geneva": {
"description": "Whether to include the Geneva Exporter from the opentelemetry-cpp-contrib repository"
},
"otlp": {
"description": "Whether to include the OpenTelemetry Protocol in the SDK",
"dependencies": [

View File

@ -6410,7 +6410,7 @@
},
"opentelemetry-cpp": {
"baseline": "1.13.0",
"port-version": 1
"port-version": 2
},
"opentelemetry-fluentd": {
"baseline": "2.0.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "34b7683811362c31ff5e3742dd47ee8a721817f0",
"version-semver": "1.13.0",
"port-version": 2
},
{
"git-tree": "6df7abbc5ea5cb1da3d33640ccfa7d0f086319c0",
"version-semver": "1.13.0",