Heartbeat feature for App Services
We would like the heartbeat feature to be extended to serve App Services instrumented with Application Insights.
Heartbeat Content
Heartbeat data already includes some default properties, and for Azure App Services we'd like to add a few more default properties:
- asSiteName: The site name reported by Azure App Services.
- asStamp: The website "Home Stampname" reported by Azure App Services.
- asHost: The site host name as reported by Azure App Services.
These properties will help us to aid our customers discover the specific infrastructure their application is running under.
Implementation Options
Thus far I've identified two options for implementing this change. In either case, the process will be to create a heartbeat ITelemetryModule that will get added to the AppInsights pipeline, acquire the default field values, and add them to the heartbeat upon initialization.
Option 1:
- Create an
ITelemetryModule in the Microsoft.ApplicationInsights.Web SDK (this repo)
- Create a similar
ITelemetryModule in the Microsoft.ApplicationInsights.AspNetCore SDK
Option 2:
- Create an
ITelemetryModule in the Microsoft.ApplicationInsights.Web SDK (this repo)
- Alter the Microsoft.ApplicationInsights.Web project to support .NET Standard 1.6
- Add a dependency on the Microsoft.ApplicationInsights.Web project in the Microsoft.ApplicationInsights.AspNetCore SDK
NOTE: I am hoping to have this feature in for 2.6.0-beta3, so taking the approach of implementing Option 1, and then Option 2 is on the table here.
Adding Heartbeats for App Services Automatically
ApplicationInsights.config.install.xdt would be employed to add the created ITelemetryModule to the ApplicationInsights.config file, in the case of .NET Full Framework applications. This is already available in the Microsoft.ApplicationInsights.Web nuget configuration and would be trivial.
For .NET Core applications, however, we would have to alter code in Microsoft.ApplicationInsights.AspNetCore to follow the pattern there today regarding AdaptiveSamplingTelemetryProcessor. That is, we would by default add the heartbeat ITelemetryModule but add a member to ApplicationInsightsServiceOptions that would allow customers to turn it off. (Until we have a way of configuring the application via config, I believe this is the only facility we have available).
Heartbeat feature for App Services
We would like the heartbeat feature to be extended to serve App Services instrumented with Application Insights.
Heartbeat Content
Heartbeat data already includes some default properties, and for Azure App Services we'd like to add a few more default properties:
These properties will help us to aid our customers discover the specific infrastructure their application is running under.
Implementation Options
Thus far I've identified two options for implementing this change. In either case, the process will be to create a heartbeat
ITelemetryModulethat will get added to the AppInsights pipeline, acquire the default field values, and add them to the heartbeat upon initialization.Option 1:
ITelemetryModulein the Microsoft.ApplicationInsights.Web SDK (this repo)ITelemetryModulein the Microsoft.ApplicationInsights.AspNetCore SDKOption 2:
ITelemetryModulein the Microsoft.ApplicationInsights.Web SDK (this repo)Adding Heartbeats for App Services Automatically
ApplicationInsights.config.install.xdt would be employed to add the created
ITelemetryModuleto the ApplicationInsights.config file, in the case of .NET Full Framework applications. This is already available in the Microsoft.ApplicationInsights.Web nuget configuration and would be trivial.For .NET Core applications, however, we would have to alter code in Microsoft.ApplicationInsights.AspNetCore to follow the pattern there today regarding AdaptiveSamplingTelemetryProcessor. That is, we would by default add the heartbeat
ITelemetryModulebut add a member toApplicationInsightsServiceOptionsthat would allow customers to turn it off. (Until we have a way of configuring the application via config, I believe this is the only facility we have available).