Dajbych.net


Why is the Application Insights TrackMetric method missing?

, 2 minutes to read

azure2017 logo

The short answer is that the method is missing because someone in the development team forgot to use an Obsolete attribute. This method in the TelemetryClient class in the Microsoft.ApplicationInsights NuGet package is used very often. After the latest update of the package, it just disappeared. Surprisingly, the method isn’t listed in IntelliSense, but the older code where this method is used can be successfully compiled without any error or warning.

The case

The chronological order of events that forced me to write this article was as follows:

May 23, Microsoft.ApplicationInsights, 2.6.4

The TelemetryClient.TrackMetric method does not contain any summary or attribute that would affect the IDE.

August 7, Microsoft.ApplicationInsights, 2.7.1

The TelemetryClient.TrackMetric method gets the summary Documentation Comment. There is nothing inherently wrong with this, but the information it contains does not have the right semantics. The summary tag is used to describe a type or a type member. It isn’t intended to mark the stage of its lifecycle.

/// <summary>
/// This method is deprecated...
/// </summary>

August 11, Microsoft.ApplicationInsights, 2.7.2

Four days later, the TelemetryClient.TrackMetric method is hidden from IntelliSense. There is nothing inherently wrong with this, but this step makes it impossible to see the content of the summary tag above.

[EditorBrowsable(EditorBrowsableState.Never)]

My recommendation