Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
/ ServerCommon Public archive

Port MachineNameTelemetryInitializer from NuGet.ApplicationInsights.Owin #330

Merged
merged 1 commit into from
Jan 9, 2020

Conversation

xavierdecoster
Copy link
Member

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
Member 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