Skip to content

Send grain telemetry to Azure Application Insights as custom events and dependency telemetry.

Notifications You must be signed in to change notification settings

Expecho/Orleans.Telemetry.ApplicationInsights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orleans.Telemetry.ApplicationInsights

Send grain and silo telemetry to Azure Application Insights.

NuGet

NuGet package for Orleans

Supported Orleans versions

The most recent version of this package works with Orleans >= 7. For the older versions of this document see Orleans older versions.

Supported telemetry:

  • Changes in grain lifecycle like (de)activations are logged as custom events.
  • Changes in sile lifecycle are logged as custom events.
  • Track grain calls as dependency telemetry.

Telemetry outputted due to grain activity is enriched with the following custom properties:

  • grainId (guid/long/string/compound)
  • grainType

Usage

Configuration is done when building the silo. It is assumed the TelemetryClient is available using Dependency Injection, for examply by adding the Microsoft.ApplicationInsights.WorkerService NuGet package.

Configure the integration using the AddOrleansApplicationInsights extension method:

siloBuilder
    .ConfigureServices(services =>
    {
        ...
        services
            .AddApplicationInsightsTelemetryWorkerService()
        ...
    }
    .AddOrleansApplicationInsights();

AddOrleansApplicationInsights can also be called with an overload to configure the options of the telemetry provider using TelemetryOptions.

.AddOrleansApplicationInsights(options =>
{
    options.TelemetryEnabledGrainTypeContainer = 
        new DefaultTelemetryEnabledGrainTypeContainer(Assembly.GetExecutingAssembly());
})

The TelemetryEnabledGrainTypeContainer determines which grains are included in the telemetry. In the above example all grains found in any of the assemblies are included in the telemetry. To create your own container implement ITelemetryEnabledGrainTypeContainer.

Tracking grain lifecycle events

Inject a GrainActivationTelemetryLogger in the grain to have it participate in the lifecycle tracking:

public MyGrain(GrainLifecycleTelemetryLogger grainLifecycleTelemetryLogger)
{
}

About

Send grain telemetry to Azure Application Insights as custom events and dependency telemetry.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages