From 88c94d0400f4ef2210bceb5949f9ba7ad504b7fc Mon Sep 17 00:00:00 2001 From: Ariel Machado Date: Thu, 5 Jan 2023 13:04:31 +0000 Subject: [PATCH] option 'with_logs_preview' to enable experimental Logs --- recipes/opentelemetry-cpp/all/conanfile.py | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/recipes/opentelemetry-cpp/all/conanfile.py b/recipes/opentelemetry-cpp/all/conanfile.py index 123f72d4a9130..df983ce019f16 100644 --- a/recipes/opentelemetry-cpp/all/conanfile.py +++ b/recipes/opentelemetry-cpp/all/conanfile.py @@ -22,10 +22,12 @@ class OpenTelemetryCppConan(ConanFile): options = { "fPIC": [True, False], "shared": [True, False], + "with_logs_preview": [True, False], } default_options = { "fPIC": True, "shared": False, + "with_logs_preview": False, } short_paths = True @@ -100,6 +102,8 @@ def generate(self): tc.variables["WITH_JAEGER"] = True tc.variables["WITH_OTLP"] = True tc.variables["WITH_ZIPKIN"] = True + if self.options.with_logs_preview: + tc.variables["WITH_LOGS_PREVIEW"] = True tc.generate() tc = CMakeDeps(self) @@ -190,6 +194,14 @@ def _otel_libraries(self): if Version(self.version) >= "1.7.0": libraries.append("opentelemetry_exporter_otlp_grpc_client") + if self.options.with_logs_preview: + libraries.extend([ + "opentelemetry_logs", + "opentelemetry_exporter_ostream_logs", + "opentelemetry_exporter_otlp_grpc_log", + "opentelemetry_exporter_otlp_http_log", + ]) + if self.settings.os == "Windows": libraries.extend([ "opentelemetry_exporter_etw", @@ -304,5 +316,25 @@ def package_info(self): "opentelemetry_resources", ]) + if self.options.with_logs_preview: + self.cpp_info.components["opentelemetry_logs"].requires.extend([ + "opentelemetry_resources", + "opentelemetry_common", + ]) + + self.cpp_info.components["opentelemetry_exporter_ostream_logs"].requires.extend([ + "opentelemetry_logs", + ]) + + self.cpp_info.components["opentelemetry_exporter_otlp_grpc_log"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_grpc_client", + ]) + + self.cpp_info.components["opentelemetry_exporter_otlp_http_log"].requires.extend([ + "opentelemetry_otlp_recordable", + "opentelemetry_exporter_otlp_http_client", + ]) + if self.settings.os in ("Linux", "FreeBSD"): self.cpp_info.components["opentelemetry_common"].system_libs.extend(["pthread"])