Skip to content

Use fetch content for otel cpp - #653

Open
thompson-tomo wants to merge 43 commits into
open-telemetry:mainfrom
thompson-tomo:fetch_otel_cpp
Open

thompson-tomo wants to merge 43 commits into
open-telemetry:mainfrom
thompson-tomo:fetch_otel_cpp

Conversation

@thompson-tomo

@thompson-tomo thompson-tomo commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This goes through and removes the otel cpp repo checkout and local build steps and instead leverage a fetchcontent in the cmake build process.

It is easier to review this pr hiding whitespace aka https://github.com/open-telemetry/opentelemetry-cpp-contrib/pull/653/changes?w=1#diff-afedc88ba9243d94695a1f609b7a87dab38fc0dd1a86a789eaba4ddffe4780bf

@thompson-tomo
thompson-tomo force-pushed the fetch_otel_cpp branch 2 times, most recently from 5e111ff to 448cdf8 Compare August 13, 2026 04:24
@thompson-tomo
thompson-tomo force-pushed the fetch_otel_cpp branch 7 times, most recently from 74873ed to 9257d33 Compare August 20, 2026 02:33
@thompson-tomo
thompson-tomo marked this pull request as ready for review August 21, 2026 15:40
@thompson-tomo
thompson-tomo requested a review from a team as a code owner August 21, 2026 15:40
Comment thread exporters/geneva-trace/CMakeLists.txt Outdated
PROPERTIES EXPORT_NAME opentelemetry_exporter_geneva_logs)

if(MAIN_PROJECT)
target_link_libraries(opentelemetry_exporter_geneva_logs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the FetchContent and find_package paths import the public opentelemetry-cpp::* CMake targets and the call to target_link_libraries( ... opentelemetry-cpp::api) should be unconditional.

Comment thread instrumentation/boost_log/src/sink.cc Outdated
set_file_path_if_valid_ = {[](LogRecord *, const std::string &) {},
[](LogRecord *log_record, const std::string &file_name) {
log_record->SetAttribute(kCodeFilepath, file_name);
log_record->SetAttribute("code.filepath", file_name);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the auto generated code attribute constants from <opentelemetry/semconv/code_attributes.h>

@thompson-tomo thompson-tomo Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't these are the deprecated constants which no longer exist and, changing it to the new constant would be a breaking change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that these are the deprecated attributes.

The opentelemetry-cpp api target includes the <opentelemetry/semconv/incubating/code_attributes.h> header with the deprecated versions. Can these be used?

@thompson-tomo thompson-tomo Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, i had missed that the deprecated were still in the incubating conventions. Have switched them but i am more interested in what is needed to fix ci after making the previously requested reverts.

)

if(MAIN_PROJECT)
target_link_libraries(${this_target} PUBLIC

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link here should be unconditional

@github-actions github-actions Bot added exporter:geneva Geneva Exporter exporter:geneva-trace Geneva-trace Exporter exporter:user_events User_Events Exporter instrumentation:glog GLog log appender instrumentation:log4cxx Log4cxx log appender instrumentation:spdlog Spdlog log appender instrumentation:boost_log labels Sep 20, 2026
@github-actions github-actions Bot added the exporter:prometheus Prometheus Exporter label Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exporter:geneva Geneva Exporter exporter:geneva-trace Geneva-trace Exporter exporter:prometheus Prometheus Exporter exporter:user_events User_Events Exporter instrumentation:boost_log instrumentation:glog GLog log appender instrumentation:log4cxx Log4cxx log appender instrumentation:spdlog Spdlog log appender

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants