Configuring .NET Core data collector

You need to configure .NET Core data collector to collect metrics data of .NET Core Web and Console applications.

Configure .NET Core data collector

You must configure the following mandatory variables for .NET Core data collector in the DataCollector\appsettings.json .

Variable name Value Description
ConfigIntervalTimeInMinute 5 Minutes This key sets the value in minutes. Data collector fetches the input plugin subscription file every x minutes according to the value specified for ConfigIntervalTimeInMinute and updates the local subscription file. This interval time allows Unified Agent to fetch different attribute groups.
ProviderId This is the OCP setup subscription ID that is referenced by your Unified Agent plugin for displaying data.
IsKubernetesEnvironment false If the application and data collector are deployed in Kubernetes environment, set it to true. If the application and data collector are deployed in Docker environment, set it to false.
UA_LWDC_LISTENER_URL .NET Core Unified Agent plugin URL that is referenced by data collector to send metrics data.

Configure applications for monitoring

You need to add the names of applications for monitoring in the file DataCollector\Config\ApplicationsToMonitor.txt.

Procedure

  1. Edit the file DataCollector\Config\ApplicationsToMonitor.txt in a text editor.
  2. Add the names of the applications for monitoring the file ApplicationsToMonitor.txt.
    Note: Enter the application name without extension.
    For examples, you have the following application executables for monitoring:
    • AspNetCoreMVC3.exe
    • HttpClientFactory.exe
      Add the following lines in the file ApplicationsToMonitor.txt.
      AspNetCoreMVC3
      HttpClientFactory
      
  3. Optional: If you would like to monitor the .NET Core data collector, add the following .NET Core data collector name in the file ApplicationsToMonitor.txt.
     DotNetCoreDC
    
    Note: Metrics data for Golden Signals such as Microsoft.AspNetCore.Hosting is not applicable for Console applications.

Configure log level

You can configure .NET Core data collector log level in the file DataCollector\nlog.config.

For example:

      <logger name="*" minlevel="Info" writeTo="allfile" />
      <logger name="Microsoft. *" maxlevel="Info" final="true" />
      <logger name="*" minlevel="Info" writeTo="ownFile-web" />

Note:
writeTo - User can specify any valid log filenames.
minlevel, maxlevel - The following values are possible values:

Configure interval for metrics collection

You can configure the interval for metrics collection in the file DataCollector\Config\InputPluginSubscriptionConfig.json. This configuration will be reflected in the file DataCollector\Config\SubscriptionConfig.json after the interval time as specified for ConfigIntervalTimeInMinute.

Example of interval configuration for metrics collection in DataCollector\Config\InputPluginSubscriptionConfig.json:

"NetProcessTimeInterval": "2",
"DotnetCountersInterval": "3"

Default timer for Net Process is 2 minutes. Default timer for DotNetCounters (System.Runtime and Microsoft.AspNetCore. Hosting) is 3 minutes.