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

[otlp] Add Trace Exporter to transmit custom serialized data. #5969

Merged

Conversation

rajkumar-rangaraj
Copy link
Contributor

@rajkumar-rangaraj rajkumar-rangaraj commented Nov 12, 2024

Fixes Part of #5730,
Design discussion issue #

Changes

Please provide a brief description of the changes here.

This PR introduces the ProtobufOtlpTraceExporter, which will replace the current OtlpTraceExporter in follow-up PRs. I validated that these changes work as expected by adding the environment variable OTEL_DOTNET_EXPERIMENTAL_USE_CUSTOM_PROTOBUF_SERIALIZER to the following example applications, enabling them to send data to Aspire Dashboard:

The changes were validated, and everything functions as expected. Please note, I marked ProtobufOtlpTraceExporter as internal.

IProtobufExportClient will replace IExportClient.

Test Changes:

No changes to the tests have been made in this PR. This decision was made to avoid redundant work, as the renaming of ProtobufOtlpTraceExporter to OtlpTraceExporter will happen shortly (within a week of this PR being merged). All tests are expected to work with the new implementation, and I’ve verified this locally by manually adjusting the tests, which confirms that everything functions as expected.

Next Steps:

  • Introduce similar changes for Logs and Metrics exporters.
  • Replace the existing exporters and update tests as necessary.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@rajkumar-rangaraj rajkumar-rangaraj requested a review from a team as a code owner November 12, 2024 21:27
@github-actions github-actions bot added the pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package label Nov 12, 2024
@rajkumar-rangaraj rajkumar-rangaraj changed the title Add Trace Exporter to transmit custom serialized data. [otlp] Add Trace Exporter to transmit custom serialized data. Nov 12, 2024
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 5.05837% with 244 lines in your changes missing coverage. Please review.

Project coverage is 85.15%. Comparing base (6250307) to head (ecb7ef9).
Report is 391 commits behind head on main.

Files with missing lines Patch % Lines
...tlpExporterPersistentStorageTransmissionHandler.cs 0.00% 59 Missing ⚠️
...ation/ExportClient/ProtobufOtlpHttpExportClient.cs 0.00% 45 Missing ⚠️
...ation/ExportClient/ProtobufOtlpGrpcExportClient.cs 0.00% 39 Missing ⚠️
...OpenTelemetryProtocol/ProtobufOtlpTraceExporter.cs 0.00% 39 Missing ⚠️
...mission/ProtobufOtlpExporterTransmissionHandler.cs 0.00% 34 Missing ⚠️
...TelemetryProtocol/OtlpExporterOptionsExtensions.cs 0.00% 16 Missing ⚠️
...on/ProtobufOtlpExporterRetryTransmissionHandler.cs 0.00% 10 Missing ⚠️
...etryProtocol/Implementation/ExperimentalOptions.cs 66.66% 1 Missing ⚠️
...metryProtocol/OtlpTraceExporterHelperExtensions.cs 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5969      +/-   ##
==========================================
+ Coverage   83.38%   85.15%   +1.77%     
==========================================
  Files         297      269      -28     
  Lines       12531    12269     -262     
==========================================
- Hits        10449    10448       -1     
+ Misses       2082     1821     -261     
Flag Coverage Δ
unittests ?
unittests-Project-Experimental 85.09% <5.05%> (?)
unittests-Project-Stable 84.99% <5.05%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...entation/Serializer/ProtobufOtlpTraceSerializer.cs 89.64% <100.00%> (ø)
...tlpExporterPersistentStorageTransmissionHandler.cs 82.60% <100.00%> (ø)
...ansmission/OtlpExporterRetryTransmissionHandler.cs 80.00% <100.00%> (ø)
...rotocol/Implementation/Transmission/RetryHelper.cs 100.00% <ø> (ø)
...etryProtocol/Implementation/ExperimentalOptions.cs 86.36% <66.66%> (-13.64%) ⬇️
...metryProtocol/OtlpTraceExporterHelperExtensions.cs 96.00% <66.66%> (-0.67%) ⬇️
...on/ProtobufOtlpExporterRetryTransmissionHandler.cs 0.00% <0.00%> (ø)
...TelemetryProtocol/OtlpExporterOptionsExtensions.cs 81.54% <0.00%> (-12.07%) ⬇️
...mission/ProtobufOtlpExporterTransmissionHandler.cs 0.00% <0.00%> (ø)
...ation/ExportClient/ProtobufOtlpGrpcExportClient.cs 0.00% <0.00%> (ø)
... and 3 more

... and 240 files with indirect coverage changes

Copy link
Member

@CodeBlanch CodeBlanch left a comment

Choose a reason for hiding this comment

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

LGTM

@CodeBlanch
Copy link
Member

@rajkumar-rangaraj Before you remove all the existing stuff make sure to capture some benchmarks so we can show the new version is better (faster, less/non-allocating) 😄

@CodeBlanch CodeBlanch merged commit 1e7397e into open-telemetry:main Nov 14, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants