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

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Exporter.Geneva/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

`GenevaMetricExporter` to be a singleton.
([#1225](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1225))

## 1.5.0-rc.1

Released 2023-Jun-05
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public GenevaMetricExporter(GenevaMetricExporterOptions options)
case TransportProtocol.Unspecified:
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
this.metricDataTransport = new MetricEtwDataTransport();
this.metricDataTransport = MetricEtwDataTransport.Shared;
break;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ internal sealed class MetricEtwDataTransport : EventSource, IMetricDataTransport
{
private readonly int fixedPayloadEndIndex;

public MetricEtwDataTransport()
static MetricEtwDataTransport()
{
Shared = new();
}

public static readonly MetricEtwDataTransport Shared;

private MetricEtwDataTransport()
{
unsafe
{
Expand Down