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

[Exporter.Geneva] Update EventSource implmentation of GenevaMetricExporter #1225

Conversation

utpilla
Copy link
Contributor

@utpilla utpilla commented Jun 8, 2023

Fixes #1192

Changes

  • Update EventSource implementation of GenevaMetricExporter to be a Singleton
  • Appropriate CHANGELOG.md updated for non-trivial changes

@utpilla utpilla added the comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva label Jun 8, 2023
@utpilla utpilla requested a review from a team June 8, 2023 02:44
@codecov
Copy link

codecov bot commented Jun 8, 2023

Codecov Report

Merging #1225 (5da5663) into main (18b0b03) will increase coverage by 0.90%.
The diff coverage is 96.38%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1225      +/-   ##
==========================================
+ Coverage   73.17%   74.08%   +0.90%     
==========================================
  Files         260      265       +5     
  Lines        9133     9349     +216     
==========================================
+ Hits         6683     6926     +243     
+ Misses       2450     2423      -27     
Impacted Files Coverage Δ
...orter.Geneva/MsgPackExporter/MsgPackLogExporter.cs 93.33% <ø> (ø)
...etry.Exporter.Geneva/TLDExporter/TldLogExporter.cs 37.11% <ø> (ø)
src/OpenTelemetry.Sampler.AWS/Clock.cs 100.00% <ø> (ø)
...rs.AWS/Http/ServerCertificateValidationProvider.cs 59.67% <80.00%> (+0.30%) ⬆️
src/OpenTelemetry.Sampler.AWS/FallbackSampler.cs 88.88% <83.33%> (-11.12%) ⬇️
....Exporter.Geneva/GenevaExporterHelperExtensions.cs 68.18% <84.61%> (+12.62%) ⬆️
.../OpenTelemetry.Sampler.AWS/AWSXRayRemoteSampler.cs 82.60% <91.30%> (+10.86%) ⬆️
...r.Geneva/Metrics/GenevaMetricExporterExtensions.cs 93.33% <92.30%> (+3.33%) ⬆️
src/OpenTelemetry.Sampler.AWS/RulesCache.cs 90.90% <96.00%> (+17.83%) ⬆️
...xporter.Geneva/Internal/ConnectionStringBuilder.cs 92.94% <100.00%> (+0.25%) ⬆️
... and 15 more

... and 4 files with indirect coverage changes

@@ -11,6 +11,10 @@
[RS0026](https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/Microsoft.CodeAnalysis.PublicApiAnalyzers.md#rs0026-do-not-add-multiple-public-overloads-with-optional-parameters).
([#1218](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1218))

* Update `MetricEtwDataTransport` which is the `EventSource` implementation for
Copy link
Member

@reyang reyang Jun 8, 2023

Choose a reason for hiding this comment

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

I guess the user would be very confused by this message since they are not supposed to understand the internals (e.g. MetricEtwDataTransport might mean nothing to them).

Do we really need a changelog entry? (If yes, I suggest that at least we rewrite in a way that the consumer/user would understand)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this CHANGELOG entry so that we can easily figure out which version got this fix.

Update the wording.

Copy link
Member

Choose a reason for hiding this comment

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

so that we can easily figure out which version got this fix.

I guess we want to look at the commit history (e.g. git log | grep ...) rather than CHANGELOG (which is for the users, not the maintainers/owners)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's much quicker to first look for any noteworthy changes for a given release in the CHANGELOG, than going through git log which is the comprehensive source of truth.

* Fix the issue of running into the `ArgumentException`: `An instance of
EventSource with Guid edc24920-e004-40f6-a8e1-0e6e48f39d84 already exists.`
when using multiple instances of `GenevaMetricExporter` by updating
`MetricEtwDataTransport` to be a singleton.
Copy link
Member

Choose a reason for hiding this comment

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

I suggest that we remove "by updating ..." to make it concise (my take is that the reader of the changelog would want to focus on "what does it mean to me" rather than "how you've implemented it", and for folks who have curiosity to know the details, they can always go to the PR - which is why we put the PR link).

I don't feel strongly about this though, so not a blocker.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my take is that the reader of the changelog would want to focus on "what does it mean to me" rather than "how you've implemented it", and for folks who have curiosity to know the details, they can always go to the PR - which is why we put the PR link

I think CHANGELOG could be meant for developers as well? For example, look at this entry in the collector CHANGELOG under v0.79.0:

  • batchprocessor: Change multiBatcher to use sync.Map, avoid global lock on fast path (#7714)

This is too much detail for users but it gives a good reference point for developers when they quickly want to identify which version and above have that change.

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

LGTM.

@@ -11,6 +11,11 @@
[RS0026](https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/Microsoft.CodeAnalysis.PublicApiAnalyzers.md#rs0026-do-not-add-multiple-public-overloads-with-optional-parameters).
([#1218](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1218))

* Fix the issue of running into the `ArgumentException`: `An instance of
Copy link
Member

Choose a reason for hiding this comment

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

do we have same problem in log/trace exporter?

Copy link
Member

Choose a reason for hiding this comment

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

Similar but slightly different (e.g. most folks can just to two different log ETW providers, while metrics always use the same provider).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@reyang @cijothomas I was wondering if we need to worry about scenarios where there are multiple instances of an application running each with the same GenevaExporter setup. They would run into this issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, on second thoughts, maybe not? It's probably just tracked at a process level?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Multiple GenevaMetricExporter Instances in the Same Application Process
5 participants