Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Port MachineNameTelemetryInitializer from NuGet.ApplicationInsights.Owin#330

Merged
xavierdecoster merged 1 commit intomasterfrom
dev-telemetry
Jan 9, 2020
Merged

Port MachineNameTelemetryInitializer from NuGet.ApplicationInsights.Owin#330
xavierdecoster merged 1 commit intomasterfrom
dev-telemetry

Conversation

@xavierdecoster
Copy link
Copy Markdown
Contributor

This type belongs in NuGet.Services.Logging as it can be generally reused and is not specific to Owin.

In addition, there's no need to retrieve the machine name from Environment.MachineName on every telemetry initialization, which may happen multiple times for the same telemetry item.

{
}

private static string TryGetMachineName()
Copy link
Copy Markdown
Contributor Author

@xavierdecoster xavierdecoster Jan 9, 2020

Choose a reason for hiding this comment

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

Current version lives here: https://github.com/NuGet/NuGet.Services.Metadata/blob/master/src/NuGet.ApplicationInsights.Owin/MachineNameTelemetryInitializer.cs

Note that we now inherit from SupportPropertiesTelemetryInitializer which uses the proper AppInsights API to set properties. The current version in NuGet.ApplicationInsights.Owin still uses the obsolete API via TelemetryContext.

@xavierdecoster xavierdecoster merged commit d74bea9 into master Jan 9, 2020
@xavierdecoster xavierdecoster deleted the dev-telemetry branch January 9, 2020 16:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants