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

[EXPORTER] Delegate all API calls of gRPC into opentelemetry_exporter_otlp_grpc_client, and make it contains all symbols needed. #2005

Merged
merged 9 commits into from
Apr 14, 2023

Conversation

owent
Copy link
Member

@owent owent commented Feb 24, 2023

Fixes #1998

Changes

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@codecov
Copy link

codecov bot commented Feb 24, 2023

Codecov Report

Merging #2005 (33a625e) into main (7887d32) will decrease coverage by 0.02%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2005      +/-   ##
==========================================
- Coverage   87.19%   87.17%   -0.02%     
==========================================
  Files         166      166              
  Lines        4784     4784              
==========================================
- Hits         4171     4170       -1     
- Misses        613      614       +1     

see 1 file with indirect coverage changes

.vscode/launch.json Outdated Show resolved Hide resolved
@VivekSubr
Copy link

Changes are in only in bazel BUILD, no changes are required in any CMake file?

@owent
Copy link
Member Author

owent commented Feb 25, 2023

Changes are in only in bazel BUILD, no changes are required in any CMake file?

The main change is moving gRPC callings into otlp_grpc_client.cc , and it changes the dependencies of otlp_grpc_client. With cmake, otlp_grpc_client already linked opentelemetry_proto before.

@VivekSubr I have reproduced #1998 in my building environment and verified it. Could you try this PR or try main branch later after this PR is merged?

@VivekSubr
Copy link

@owent - cloned your branch and verified it builds, thank you!

@esigo esigo added the size/L Denotes a PR that changes 100-499 lines. label Feb 26, 2023
@lalitb
Copy link
Member

lalitb commented Feb 27, 2023

@owent Just curious, if you know how was it working in CI env, and also our local setup. As I could see opentelemetry_exporter_otlp_grpc_client having gRPC++ symbols locally in WSL ubuntu 22.04. OR is it anything to do with compiler toolchain in customer environment ?

@owent
Copy link
Member Author

owent commented Feb 28, 2023

@owent Just curious, if you know how was it working in CI env, and also our local setup. As I could see opentelemetry_exporter_otlp_grpc_client having gRPC++ symbols locally in WSL ubuntu 22.04. OR is it anything to do with compiler toolchain in customer environment ?

This problem happens only when we built gRPC as static libraries and build otel-cpp as dynamic libraries.In CI jobs, we only build both gRPC and otel-cpp as static or dynamic libraries. Do you think we should add a jobs to check this situation?

@@ -103,6 +103,60 @@ std::unique_ptr<grpc::ClientContext> OtlpGrpcClient::MakeClientContext(
return context;
}

std::unique_ptr<grpc::CompletionQueue> OtlpGrpcClient::MakeCompletionQueue()
Copy link
Member

@lalitb lalitb Mar 2, 2023

Choose a reason for hiding this comment

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

why is this method added, as it is not been used anywhere - to prevent stripping of grpc symbols ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I plan use it to implement concurrency exporting in the future. Also , the grpc::CompletionQueue is also used by Export .I think we better export it.

@lalitb
Copy link
Member

lalitb commented Mar 2, 2023

This problem happens only when we built gRPC as static libraries and build otel-cpp as dynamic libraries.

Thanks @owent . This is strange, as I normally use this setup locally on my machine ( i.e., linking dynamic otel-cpp libraries with static gRPC) but never had this error :) But if @VivekSubr is validating the problem is solved with the PR, it should be fine :)

@owent owent changed the title Delegate all API calls of gRPC into opentelemetry_exporter_otlp_grpc_client, and make it contains all symbols needed. [WIP] Delegate all API calls of gRPC into opentelemetry_exporter_otlp_grpc_client, and make it contains all symbols needed. Mar 3, 2023
@owent
Copy link
Member Author

owent commented Mar 3, 2023

Sorry but some commits are missing in this PR, I will push them again on next Monday.

@owent owent force-pushed the fix_1998 branch 3 times, most recently from 0f6b412 to b0a0e2b Compare March 6, 2023 03:21
@owent owent changed the title [WIP] Delegate all API calls of gRPC into opentelemetry_exporter_otlp_grpc_client, and make it contains all symbols needed. Delegate all API calls of gRPC into opentelemetry_exporter_otlp_grpc_client, and make it contains all symbols needed. Mar 6, 2023
@ThomsonTan ThomsonTan mentioned this pull request Mar 6, 2023
3 tasks
@owent
Copy link
Member Author

owent commented Mar 7, 2023

All commits are pushed now.

…_client`, and make it contains all symbols needed.

Signed-off-by: owent <[email protected]>
Signed-off-by: owent <[email protected]>
This reverts commit 1743bc8d3a1fa5c18a0d8f87d304245cb1cb26de.

Signed-off-by: WenTao Ou <[email protected]>
@lalitb
Copy link
Member

lalitb commented Mar 24, 2023

Sorry for the delay in reviewing this. The changes look good in general, I just want to test these changes as I always have the working setup of dynamic otel-cpp libraries with static gRPC. Will be completing the review in this week.

@owent
Copy link
Member Author

owent commented Mar 24, 2023

Sorry for the delay in reviewing this. The changes look good in general, I just want to test these changes as I always have the working setup of dynamic otel-cpp libraries with static gRPC. Will be completing the review in this week.

This PR add a ci job cmake_otprotocol_shared_libs_with_static_grpc_test to test it.

Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

Looks good to me.

My only question is about OtlpGrpcClient::MakeCompletionQueue(),
as already mentioned by @lalitb

Please merge with a recent main, to keep the PR up to date, and check CI.

@owent
Copy link
Member Author

owent commented Apr 6, 2023

Looks good to me.

My only question is about OtlpGrpcClient::MakeCompletionQueue(), as already mentioned by @lalitb

Please merge with a recent main, to keep the PR up to date, and check CI.

Sorry , I missed the comment before. I plan use it to implement concurrency exporting in the future. Also , the grpc::CompletionQueue is also used by Export of gRPC services. I think we better export it.

@marcalff
Copy link
Member

marcalff commented Apr 7, 2023

Sorry , I missed the comment before. I plan use it to implement concurrency exporting in the future. Also , the grpc::CompletionQueue is also used by Export of gRPC services. I think we better export it.

Ok, approved.

@marcalff
Copy link
Member

marcalff commented Apr 8, 2023

@lalitb @ThomsonTan - Any chance this PR can go in 1.9.0 ?

@owent owent mentioned this pull request Apr 12, 2023
3 tasks
@lalitb
Copy link
Member

lalitb commented Apr 12, 2023

@lalitb @ThomsonTan - Any chance this PR can go in 1.9.0 ?

Looking into it now. Sorry for delay, was on vacation, back today morning.

@ThomsonTan
Copy link
Contributor

Do we plan to include this in v1.9.0 or after that? Probably merge it after the release because it is not a trivial change.

@lalitb
Copy link
Member

lalitb commented Apr 12, 2023

Do we plan to include this in v1.9.0 or after that? Probably merge it after the release because it is not a trivial change.

I agree. While changes look good going through the PR, and has been open for long time, still let's not merge it at last moment before the release. Taking lesson from previous releases where we introduced breaking changes with merges just before the release.

@marcalff
Copy link
Member

Do we plan to include this in v1.9.0 or after that? Probably merge it after the release because it is not a trivial change.

I agree. While changes look good going through the PR, and has been open for long time, still let's not merge it at last moment before the release. Taking lesson from previous releases where we introduced breaking changes with merges just before the release.

Ok, will merge after 1.9.0 then.

@lalitb lalitb added the ok-to-merge The PR is ok to merge (has two approves or raised by a maintainer/approver and has one approve) label Apr 14, 2023
@marcalff marcalff merged commit 6a3ee16 into open-telemetry:main Apr 14, 2023
@owent owent deleted the fix_1998 branch April 17, 2023 02:11
@marcalff marcalff changed the title Delegate all API calls of gRPC into opentelemetry_exporter_otlp_grpc_client, and make it contains all symbols needed. [EXPORTER] Delegate all API calls of gRPC into opentelemetry_exporter_otlp_grpc_client, and make it contains all symbols needed. May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-merge The PR is ok to merge (has two approves or raised by a maintainer/approver and has one approve) size/L Denotes a PR that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OTLP example fails to build with error "undefined reference to `grpc::Status::OK' "
6 participants