-
Notifications
You must be signed in to change notification settings - Fork 296
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
[Exporter.Geneva] Skip dispose for ETW singleton of GenevaMetricExporter #1537
[Exporter.Geneva] Skip dispose for ETW singleton of GenevaMetricExporter #1537
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1537 +/- ##
===========================================
- Coverage 73.91% 58.09% -15.83%
===========================================
Files 267 29 -238
Lines 9615 3064 -6551
===========================================
- Hits 7107 1780 -5327
+ Misses 2508 1284 -1224
Flags with carried forward coverage won't be shown. Click here to find out more.
|
src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs
Outdated
Show resolved
Hide resolved
Could you explain in the PR description how the current changes address the issue? |
I've updated the description with details. |
src/OpenTelemetry.Exporter.Geneva/Metrics/Transport/MetricEtwDataTransport.cs
Outdated
Show resolved
Hide resolved
…ataTransport.cs Co-authored-by: Rajkumar Rangaraj <[email protected]>
src/OpenTelemetry.Exporter.Geneva/Metrics/Transport/MetricEtwDataTransport.cs
Outdated
Show resolved
Hide resolved
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.
…is being referenced after disposed.
…the library has a bug, not if the library user is misusing it.
Fixes #1520. The current code disposes the
MetricEtwDataTransport
singleton when an instance ofGenevaMetricExporter
is disposed. However, the singleton shouldn't be disposed. Future instances ofGenevaMetricExporter
will still need to reference it to send data to ETW.This only happens on Windows, because ETW only allows one instance of EventSource with the same Guid (#1225). On Linux, such limit doesn't exist:
GenevaMetricExporter
uses Unix Domain Socket to send Metrics data.Changes
Fix a bug in
GenevaMetricExporter
where theMetricEtwDataTransport
singleton is disposed.Tested manually with the program in the issue. Didn't add tests in this PR since it's a bit tricky. We don't have any test of checking whether data is actually sent into ETW. Might have to use a
EventListener
to read and parse data from the ETW.For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes