Skip to content
This repository was archived by the owner on Jul 5, 2020. It is now read-only.
This repository was archived by the owner on Jul 5, 2020. It is now read-only.

Enabling Heartbeat in App Services for .NET and .NET Core #868

@d3r3kk

Description

@d3r3kk

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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions