Skip to content

Conversation

@CodeBlanch
Copy link
Member

@CodeBlanch CodeBlanch commented Jan 24, 2024

Fixes #5250

Changes

  • Updates BatchLogRecordExportProcessor and Batch<T> to only return LogRecords to the shared pool if they were rented from it.

Details

If the SDK detects a batch processor it switches to a shared pool of LogRecords. This works fine for all of the OOB stuff and registration extensions. However if you wrap the BatchLogRecordExportProcessor inside some other processor (see #5250) it won't be detected and the SDK will choose the ThreadStatic pool.

What this PR does is make BatchLogRecordExportProcessor and Batch<T> aware that it might be used with non-pooled records.

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

@CodeBlanch CodeBlanch added pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package logs Logging signal related labels Jan 24, 2024
@CodeBlanch CodeBlanch requested a review from a team January 24, 2024 23:10
@codecov
Copy link

codecov bot commented Jan 25, 2024

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (6250307) 83.38% compared to head (cf639b2) 83.06%.
Report is 40 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5255      +/-   ##
==========================================
- Coverage   83.38%   83.06%   -0.33%     
==========================================
  Files         297      272      -25     
  Lines       12531    11985     -546     
==========================================
- Hits        10449     9955     -494     
+ Misses       2082     2030      -52     
Flag Coverage Δ
unittests ?
unittests-Solution-Experimental 82.99% <68.18%> (?)
unittests-Solution-Stable 83.05% <68.18%> (?)

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

Files Coverage Δ
...etryProtocol/Implementation/ExperimentalOptions.cs 100.00% <ø> (ø)
...tation/OpenTelemetryProtocolExporterEventSource.cs 100.00% <100.00%> (ø)
...rotocol/Implementation/OtlpLogRecordTransformer.cs 93.45% <100.00%> (ø)
...tation.AspNetCore/Implementation/HttpInListener.cs 89.79% <100.00%> (+0.21%) ⬆️
...AspNetCore/Implementation/HttpInMetricsListener.cs 89.74% <100.00%> (+0.26%) ⬆️
....GrpcNetClient/GrpcClientInstrumentationOptions.cs 100.00% <ø> (+25.00%) ⬆️
...ent/Implementation/GrpcClientDiagnosticListener.cs 75.80% <100.00%> (-2.77%) ⬇️
...n.GrpcNetClient/TracerProviderBuilderExtensions.cs 100.00% <100.00%> (ø)
...plementation/HttpWebRequestActivitySource.netfx.cs 80.77% <100.00%> (ø)
src/OpenTelemetry/Logs/LogRecord.cs 69.93% <ø> (+0.19%) ⬆️
... and 6 more

... and 33 files with indirect coverage changes

Copy link
Member

@rajkumar-rangaraj rajkumar-rangaraj left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

logs Logging signal related pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[logs] Wrapped batch processor doesn't trigger correct log pool

6 participants