-
Notifications
You must be signed in to change notification settings - Fork 847
feat: Add optional Task support for BatchExportProcessor and PeriodicExportingMetricReader #6379
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
Open
jeromelaban
wants to merge
14
commits into
open-telemetry:main
Choose a base branch
from
jeromelaban:dev/jela/tasks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
af3e82b
feat: Add optional Task support for BatchExportProcessor and Periodic…
jeromelaban d0282c6
chore: Adjust parameters ordering to avoid unnamed parameters breakin…
jeromelaban d01884e
chore: Add processor dispose validation test
jeromelaban da9d6f4
chore: Remove early exit of the exporter
jeromelaban f9d7059
chore: Adjust exit condition for ExporterProcAsync
jeromelaban 32c5eb3
chore: Reorder test parameters in xml doc
jeromelaban 8e6585a
chore: Use Task.WhenAny's output to avoid a double await
jeromelaban 74bc141
chore: Adjust volatile for potential cross-thread access
jeromelaban 124f871
chore: Remove isShutdownRequested
jeromelaban 554fe62
chore; Explain the reason for the disabled warning
jeromelaban 823622a
chore: Remove unused namespace
jeromelaban 8dcf5aa
chore: Move to BatchLogRecordExportProcessorOptions and PeriodicExpor…
jeromelaban 276d81c
chore: Adjust after review
jeromelaban 36aa05a
chore: use IsThreadingDisabled instead of browser only
jeromelaban File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
OpenTelemetry.BatchActivityExportProcessor.BatchActivityExportProcessor(OpenTelemetry.BaseExporter<System.Diagnostics.Activity!>! exporter, OpenTelemetry.BatchExportProcessorOptions<System.Diagnostics.Activity!>! options) -> void | ||
OpenTelemetry.BatchExportProcessor<T>.BatchExportProcessor(OpenTelemetry.BaseExporter<T!>! exporter, OpenTelemetry.BatchExportProcessorOptions<T!>! options) -> void | ||
OpenTelemetry.BatchExportProcessorOptions<T>.UseThreads.get -> bool | ||
OpenTelemetry.BatchExportProcessorOptions<T>.UseThreads.set -> void | ||
OpenTelemetry.BatchLogRecordExportProcessor.BatchLogRecordExportProcessor(OpenTelemetry.BaseExporter<OpenTelemetry.Logs.LogRecord!>! exporter, OpenTelemetry.BatchExportProcessorOptions<OpenTelemetry.Logs.LogRecord!>! options) -> void | ||
OpenTelemetry.Metrics.PeriodicExportingMetricReader.PeriodicExportingMetricReader(OpenTelemetry.BaseExporter<OpenTelemetry.Metrics.Metric!>! exporter, OpenTelemetry.Metrics.PeriodicExportingMetricReaderOptions! options) -> void | ||
OpenTelemetry.Metrics.PeriodicExportingMetricReaderOptions.UseThreads.get -> bool | ||
OpenTelemetry.Metrics.PeriodicExportingMetricReaderOptions.UseThreads.set -> void | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to avoid adding a public facing API for this because it exposes an implementation detail. Since it sounds like your primary concern is WebAssembly/Blazor support, would it be possible to gate using some kind of platform check? Basically we want
I understand other folks are mainly concerned with long running mostly idle threads, but maybe it makes sense to separate these concerns.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hiding the option was the intent originally, but I get the concern. The idea was to provide for a way to exercise the new path without being breaking.
For the WebAssembly detection, this is one the parts where the threads option is used:
opentelemetry-dotnet/src/OpenTelemetry/BatchExportProcessor.cs
Line 170 in 5259b1b
There's a similar change for the other class:
opentelemetry-dotnet/src/OpenTelemetry/Metrics/Reader/PeriodicExportingMetricReader.cs
Line 116 in 5259b1b
Having a set of tests for .NET WebAssembly (which is broader then blazor) would make sense, there's a similar structure available in SkiaSharp, though it's not runnable through
dotnet test
(last time I checked). Are there specific areas that should be tested, other than the two main classes touched here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the discussion in #5838, exposing this option would also enable exporters to use the thread pool instead of unnecessarily creating threads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alanwest Would you have additional thoughts on this thread? Thanks! (specifically on the thread use API visibility)