Workiva / opentelemetry-dart

Apache License 2.0
58 stars 33 forks source link

Feature: Support gRPC protocol in CollectorExporter #161

Open huandu opened 5 months ago

huandu commented 5 months ago

Which problem is this PR solving?

In this PR, add gRPC support in CollectorExporter.

Fixes # (issue)

Short description of the change

How Has This Been Tested?

I've used this client in my production environment to export traces to Aliyun SLS, which supports gPRC protocol only.

Checklist:

aviary2-wf commented 5 months ago

Security Insights

No security relevant content was detected by automated scans.

Action Items

huandu commented 5 months ago

This PR should be a fix for #101.

huandu commented 5 months ago

@blakeroberts-wk The CI job test-darv2 fails because that an outdated protobuf package (2.1.0) is installed but gRPC requires at least 3.x. I update the pubspec.yaml and set protobuf: ^3.0.0.

blakeroberts-wk commented 5 months ago

@huandu I think we may need to make the grpc exporter a sub package so we can increase the dart sdk requirement to ^3 while still allowing ^2 for non-grpc usage 🤔

huandu commented 5 months ago

@blakeroberts-wk From my observation, the protoc_plugin is the root cause of this issue. Starting from 21.0.0, it depends on protobuf: ^3.0.0. Unfortunately, the last gRPC package running on dart v2 depends on protobuf: ^2.0.0. I think one possible solution to fix this issue is to install protoc_plugin 20.0.1 on dart v2. It requires some hacks in Makefile.