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

[sdk] Expose the ctor on Batch<T> which accepts a single item #5642

Merged

Conversation

CodeBlanch
Copy link
Member

@CodeBlanch CodeBlanch commented May 21, 2024

To help resolve: open-telemetry/opentelemetry-dotnet-contrib#1814

Changes

  • Expose the ctor on Batch<T> which accepts a single item for the batch.

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)

@CodeBlanch CodeBlanch added the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label May 21, 2024
@CodeBlanch CodeBlanch requested a review from a team May 21, 2024 23:37
Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.61%. Comparing base (6250307) to head (8c02916).
Report is 372 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5642      +/-   ##
==========================================
+ Coverage   83.38%   86.61%   +3.22%     
==========================================
  Files         297      262      -35     
  Lines       12531    11804     -727     
==========================================
- Hits        10449    10224     -225     
+ Misses       2082     1580     -502     
Flag Coverage Δ
unittests ?
unittests-Project-Experimental 86.58% <100.00%> (?)
unittests-Project-Stable 86.54% <100.00%> (?)

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

Files with missing lines Coverage Δ
src/OpenTelemetry/Batch.cs 96.18% <100.00%> (-1.36%) ⬇️

... and 241 files with indirect coverage changes

@CodeBlanch CodeBlanch marked this pull request as draft May 22, 2024 00:04
@CodeBlanch
Copy link
Member Author

@reyang is going to explore doing something with attributes to allow users to opt-into having SimpleExportProcessor switch into a reentrant/non-blocking mode. Going to keep this in draft to give him time to investigate that and then we can decide which direction to take.

@reyang
Copy link
Member

reyang commented May 22, 2024

I have a different idea how to solve this (and a category of similar problems), check #5643.

Copy link
Contributor

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added Stale Issues and pull requests which have been flagged for closing due to inactivity and removed Stale Issues and pull requests which have been flagged for closing due to inactivity labels May 29, 2024
Copy link
Contributor

github-actions bot commented Jun 6, 2024

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label Jun 6, 2024
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@CodeBlanch
Copy link
Member Author

Re-opening this PR.

There are some good alternative proposals in #5643 and #5758 however @alanwest and I feel we need to wait for the spec to prescribe what to do before moving forward: open-telemetry/opentelemetry-specification#4231 (comment).

We have decided to expose this ctor in the meantime to unblock users.

The spec says SDK MUST allow users to implement and configure custom processors. What GenevaExporter wants to do (open-telemetry/opentelemetry-dotnet-contrib#1814) is make a custom processor which exports a single item and does not block. Having this ctor makes it possible to implement that in a safe and efficient way. The SDK shouldn't block this valid scenario from being supported/successful.

When the spec defines a concurrent simple processor it will be supported. But users should still be able to make custom implementations whatever they may be regardless.

@CodeBlanch CodeBlanch reopened this Nov 1, 2024
@CodeBlanch CodeBlanch marked this pull request as ready for review November 1, 2024 20:04
@CodeBlanch CodeBlanch requested a review from a team as a code owner November 1, 2024 20:04
Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Thanks!

@CodeBlanch CodeBlanch merged commit 7c0f24c into open-telemetry:main Nov 1, 2024
39 checks passed
@CodeBlanch CodeBlanch deleted the sdk-batch-single-item-ctor branch November 1, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package Stale Issues and pull requests which have been flagged for closing due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GenevaExporter uses Expression.Lambda from System.Linq.Expressions - AOT size and performance concerns
4 participants