Show / Hide Table of Contents

    Phobos.Monitoring.ApplicationInsights

    Microsoft Application Insights is a monitoring, diagnostics, and telemetry service provided by Microsoft as part of Azure.

    Phobos supports both monitoring and tracing on top of Application Insights.

    Phobos' Application Insights integration is available when you install the Phobos.Monitoring.ApplicationInsights NuGet package from your organization's Phobos NuGet feed.

    NOTE

    In order to use any of the Phobos integrations, you will need to first configure your akka.actor.provider setting to use one of the ActorRefProvider implementations provided by the Phobos.Actor.* NuGet packages. Click here for details.

    Configuring via HOCON

    Phobos.Tracing.ApplicationInsights doesn't have much in the way of HOCON configuration, as most of the configuration is automated by the TelemetryClient built into Microsoft's first-party driver itself.

    ###############################################################
    # Phobos.Monitoring.ApplicationInsights Reference Config File #
    ###############################################################
    
    phobos.monitoring{
    	# Will cause the Azure Application Insights driver to be loaded
    	provider-type = appinsights
    
    	appinsights{
    		# The instrumentation key that identifies this AppInsights instance.
    		#
    		# If set to blank, Phobos.Monitoring.AppInsights will attempt to use
    		# TelemetryConfiguration.Active as the source of its configuration,
    		# which needs to be configured earlier in the .NET process before 
    		# Phobos.Monitoring attempts to load.
    		#
    		# Read more here: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-configuration-with-applicationinsights-config
    		instrumentation-key = ""
    
    		# When set to "on", has this ActorSystem log all of its metrics
    		# to AppInsights with the debug flag set to true. Should only
    		# be enabled during dev and test.
    		developer-mode = off
    	}
    }
    

    In order to use Phobos.Monitoring.ApplicationInsights you need to create an Application Insights resource inside one of your Azure resource groups and copy the Application Insights instrumentation key once it's created.

    Once you have this piece of information, you can use Application Insights inside Phobos via the following HOCON configuration:

    phobos.monitoring{
        provider-type = appinsights
        appinsights.instrumentation-key = "YOUR KEY VALUE"  
    }
    

    Test-Driving Application Insights

    If you want to evaluate Phobos in combination with Application Insights, we recommend the following:

    1. Create an Application Insights resource on Microsoft Azure, as is described here.
    2. Clone our phobos-samples repository and run any of the samples in there with the Application Insights driver installed and properly configured via HOCON.

    Viewing Activity Generated by Phobos.Monitoring in Application Insights

    One thing worth noting about Application Insights is that there is usually a 2-5 minute delay between when a trace or metric is uploaded locally and when that metric becomes visible in any of the Application Insights charts or analytics. So the first time you run your application with Phobos.Monitoring.ApplicationInsights installed, please give Application Insights some time to process your data before you go looking for it in the dashboard.

    However, once enough time has passed you can go to the Metrics screen on Application Insights and find all of the available metrics from Phobos listed as Custom Metrics on the drop down.

    In the screenshot below, we counted two different "receive count" values from actors running in two different nodes in our cluster:

    Application Insights Phobos Metrics from Akka.NET Cluster

    Back to top Copyright © 2015-2018 Petabridge®