[sdk] Provide better concurrency modes
This is following the same design as push/pull metrics exporter: https://github.com/open-telemetry/opentelemetry-dotnet/blob/3cff6dbfd15ed0b539c289a4444198fe437a5ebf/src/OpenTelemetry/Metrics/ExportModesAttribute.cs#L9-L10
Exporter (also processors, samplers, etc.) authors can optionally provide additional hints so the SDK can better serve the need:
[ConcurrencyModes(ConcurrencyModes.Multithreaded | ConcurrencyModes.Reentrant)]
internal class MyExporter : BaseExporter<LogRecord>
{
...
}
In addition, I envision that Console Exporters can leverage this to provide synchronization across multiple instances, so a log exporter and metrics exporter won't have race condition and cause garbled text in stdout:
[ConcurrencyModes(ConcurrencyModes.Global)]
internal class ConsoleExporter<T> : BaseExporter<T>
{
...
}
Codecov Report
Attention: Patch coverage is 66.66667% with 7 lines in your changes missing coverage. Please review.
Project coverage is 85.67%. Comparing base (
6250307) to head (c5b6dd1). Report is 259 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #5643 +/- ##
==========================================
+ Coverage 83.38% 85.67% +2.29%
==========================================
Files 297 255 -42
Lines 12531 11051 -1480
==========================================
- Hits 10449 9468 -981
+ Misses 2082 1583 -499
| Flag | Coverage Δ | |
|---|---|---|
| unittests | ? |
|
| unittests-Project-Experimental | 85.62% <66.66%> (?) |
|
| unittests-Project-Stable | 85.60% <66.66%> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files | Coverage Δ | |
|---|---|---|
| src/OpenTelemetry/SimpleExportProcessor.cs | 85.71% <82.35%> (-14.29%) |
:arrow_down: |
| src/OpenTelemetry/ConcurrencyModesAttribute.cs | 0.00% <0.00%> (ø) |
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.
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.
Closed as inactive. Feel free to reopen if this PR is still being worked on.
@reyang @CodeBlanch - I see this got closed due to inactivity. Do we have a plan for removing the private reflection in the GenevaExporter?
@reyang @CodeBlanch - I see this got closed due to inactivity. Do we have a plan for removing the private reflection in the GenevaExporter?
@CodeBlanch would you follow up?
@eerhardt Still working on the plan. I've been exploring some other possible APIs/alternatives. Hoping to have something to propose soon and then we'll pick a direction to have in place for the next release.