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] OTLP Exporter Custom serializer Part 1 - WritingPrimitives #5910

Merged

Conversation

rajkumar-rangaraj
Copy link
Contributor

@rajkumar-rangaraj rajkumar-rangaraj commented Oct 18, 2024

Fixes Part of #5730
Design discussion issue #

Changes

Please provide a brief description of the changes here.
Based on prototype - #5731

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 October 18, 2024 22:18
@github-actions github-actions bot added the pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package label Oct 18, 2024
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.36%. Comparing base (6250307) to head (c7fc344).
Report is 356 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5910      +/-   ##
==========================================
+ Coverage   83.38%   86.36%   +2.97%     
==========================================
  Files         297      258      -39     
  Lines       12531    11345    -1186     
==========================================
- Hits        10449     9798     -651     
+ Misses       2082     1547     -535     
Flag Coverage Δ
unittests ?
unittests-Project-Experimental 86.34% <100.00%> (?)
unittests-Project-Stable 86.05% <100.00%> (?)

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

Files with missing lines Coverage Δ
...ol/Implementation/Serializer/ProtobufSerializer.cs 100.00% <100.00%> (ø)

... and 239 files with indirect coverage changes

Comment on lines 270 to 276
if (buffer.Length == writePosition)
{
if (!IncreaseBufferSize(ref buffer))
{
// TODO: throw an exception to indicate that the buffer is too large.
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I'm not going to drop a comment everywhere for this, but it might make sense to remove all of this expansion logic. Just assume the buffer has room. If not, catch indexoutofrange exception upstream, expand the buffer, and retry the entire serialization operation. This is what we do in prometheus. Why? Once we get to stable buffer size it will be a lot of faster without needing to do these checks each time we write some tiny piece of data into the blob. Also we can move from ref byte[] everywhere to just byte[].

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 CodeBlanch merged commit 0eebf97 into open-telemetry:main Oct 21, 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