[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.Protobufopentelemetry-proto=> The.protofiles that define the OTLP protocol are stored intracer/src/Datadog.Trace/Vendors/protos/**/*.protoThis also updates the
UpdateVendoredCodeNuke build target to download theGrpc.ToolsNuGet package and compile the.protofiles into C# code, and the resulting files are stored astracer/src/Datadog.Trace/OpenTelemetry/Proto/**/*.g.csReason for change
We currently must produce protobuf for the OTel Metris API feature (
http/protobuf), so vendoringGoogle.Protobufand theopentelemetry-protorepo makes our protobuf generation maintainable. Also, as we look to add agrpcOTLP exporter, we may need to useGoogle.Protobufand some of theGrpclibraries. This at least starts the process of adding the requisite libraries.Implementation details
Google.Protobufand theopentelemetry-protorepositoriesGoogle.Protobufto build correctlyUpdateVendoredCodeNuke target to also run the protobuf compiler to convert the.protofiles to corresponding.g.csfilesTest coverage
Locally, I've measured the following
Datadog.Trace.dllsize differences:I haven't done any tests to identify startup costs.
Other details