We can send 'application version' property with every insight in c# like in this tutorial by adding a initializer.
class AppVersionTelemetryInitializer : Microsoft.ApplicationInsights.Extensibility.ITelemetryInitializer
{
public void Initialize(Microsoft.ApplicationInsights.Channel.ITelemetry telemetry)
{
telemetry.Context.Component.Version = ApplicationInsightsHelper.ApplicationVersion;
}
}
https://blogs.msdn.microsoft.com/visualstudioalm/2015/01/07/application-insights-support-for-multiple-environments-stamps-and-app-versions/
How can I do this with javascript?
If you are using the @microsoft/applicationinsights-web
SDK (for client-side Javascript), you can set the application version in this way:
const appInsights = new ApplicationInsights(...);
appInsights.loadAppInsights(); // important, otherwise the `application` object is missing
appInsights.context.application.ver = "YOUR_VERSION_HERE";
This way, you'll be able to drill down into metrics by application version in the dashboards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With