Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opentelemetry-cpp: option 'with_logs_preview' to enable experimental Logs #15198

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions recipes/opentelemetry-cpp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"])