[build] Vendor Google.Protobuf and opentelemetry-proto files #7653
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.
Summary of changes
Vendors the following libraries into
Datadog.Trace.dll
:Google.Protobuf
=> vendored to the namespaceDatadog.Trace.Vendors.Google.Protobuf
opentelemetry-proto
=> The.proto
files that define the OTLP protocol are stored intracer/src/Datadog.Trace/Vendors/protos/**/*.proto
This also updates the
UpdateVendoredCode
Nuke build target to download theGrpc.Tools
NuGet package and compile the.proto
files into C# code, and the resulting files are stored astracer/src/Datadog.Trace/OpenTelemetry/Proto/**/*.g.cs
Reason for change
We currently must produce protobuf for the OTel Metris API feature (
http/protobuf
), so vendoringGoogle.Protobuf
and theopentelemetry-proto
repo makes our protobuf generation maintainable. Also, as we look to add agrpc
OTLP exporter, we may need to useGoogle.Protobuf
and some of theGrpc
libraries. This at least starts the process of adding the requisite libraries.Implementation details
Google.Protobuf
and theopentelemetry-proto
repositoriesGoogle.Protobuf
to build correctlyUpdateVendoredCode
Nuke target to also run the protobuf compiler to convert the.proto
files to corresponding.g.cs
filesTest coverage
Locally, I've measured the following
Datadog.Trace.dll
size differences:I haven't done any tests to identify startup costs.
Other details