[CMAKE] add generated protobuf headers to the opentelemetry_proto target#3400
Merged
lalitb merged 5 commits intoopen-telemetry:mainfrom May 15, 2025
Merged
Conversation
…t instead of using include_directories
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3400 +/- ##
==========================================
- Coverage 90.05% 90.04% -0.01%
==========================================
Files 212 212
Lines 6932 6932
==========================================
- Hits 6242 6241 -1
- Misses 690 691 +1 🚀 New features to boost your workflow:
|
lalitb
approved these changes
May 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
opentelemetry-proto.cmakegenerates the protobuf headers for opentelemetry-proto and includes them withinclude_directories. To propagate the headers to targets linking toopentelemetry_proto(throughopentelemetry-cpp::otlp_recordable) these headers need to be included on the target.As is, using
FetchContent_MakeAvailable(opentelemetry-cpp)withopentelemetry-cpp-contribfails here:exporters/user_events/CMakeFiles/opentelemetry_exporter_user_events_metrics.dir/src/metrics_exporter.cc.o In file included from /workspaces/opentelemetry-cpp-contrib/exporters/user_events/include/opentelemetry/exporters/user_events/metrics/exporter.h:6, from /workspaces/opentelemetry-cpp-contrib/exporters/user_events/src/metrics_exporter.cc:4: /workspaces/opentelemetry-cpp/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_metric_utils.h:14:10: fatal error: opentelemetry/proto/metrics/v1/metrics.pb.h: No such file or directory 14 | #include "opentelemetry/proto/metrics/v1/metrics.pb.h"Changes
include_directorieswithtarget_include_directoriesforGENERATED_PROTOBUF_PATHPlease provide a brief description of the changes here.
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes