In the dotnet profiler auto-instrument agent, can I configure it to only send trace data while not sending metric and log data?

I'm using the profiler auto-instrument 1.30 to monitor a dotnet application, and it's working fine. However, I only want to send trace data to the backend, without sending metrics and logs. Can I achieve this capability through configuration?

The .NET agent only sends traces and metrics, not logs. You can disable metrics entirely by setting the MetricsInterval configuration to 0. Using the profiler, you can set this via the ELASTIC_APM_DISABLE_METRICS environment variable.

Thank you for your previous question. Regarding the configurations supported by the profiler's auto-instrumentation, do you have a list of all the configurations it supports? I would like to see them all.

I used the following script to configure environment variables for the application pool, but disabling metrics didn't work. I still see metric data being sent to the backend.

$appcmd = "$($env:systemroot)\system32\inetsrv\AppCmd.exe"
$appPool = "disablemetrictest" 
$profilerHomeDir = "D:\agent" 
$environment = @{
  CORECLR_ENABLE_PROFILING = "1"
  CORECLR_PROFILER = "{FA65FE15-F085-4681-9B20-95E04F6C03CC}"
  CORECLR_PROFILER_PATH = "$profilerHomeDir\elastic_apm_profiler.dll"
  ELASTIC_APM_PROFILER_HOME = "$profilerHomeDir"
  ELASTIC_APM_PROFILER_INTEGRATIONS = "$profilerHomeDir\integrations.yml"
  ELASTIC_APM_SERVER_URL = "http://localhost:8200" 
  ELASTIC_APM_SERVICE_NAME = "dotnettestdisablemetric"
  ELASTIC_APM_DISABLE_METRICS = "true"
}

$environment.Keys | ForEach-Object {
  & $appcmd set config -section:system.applicationHost/applicationPools /+"[name='$appPool'].environmentVariables.[name='$_',value='$($environment[$_])']"
}

And in the script above, I also tested setting the value of ELASTIC_APM_DISABLE_METRICS to 1 , but it didn't work as well.

I have tried setting ELASTIC_APM_METRICS_INTERVAL to 0 , but I am still seeing data with "metricset": { "period": 60000 } being received by the APM server. I am sure that the environment variable is successfully set, as I have found the correct configuration in the IIS configuration file applicationHost.config . However, it seems that the setting is not taking effect based on the results.

The script for setting the environment variable is as follows:

$appcmd = "$($env:systemroot)\system32\inetsrv\AppCmd.exe"
$appPool = "metrics0" 
$profilerHomeDir = "D:\agent" 
$environment = @{
  CORECLR_ENABLE_PROFILING = "1"
  CORECLR_PROFILER = "{FA65FE15-F085-4681-9B20-95E04F6C03CC}"
  CORECLR_PROFILER_PATH = "$profilerHomeDir\elastic_apm_profiler.dll"
  ELASTIC_APM_PROFILER_HOME = "$profilerHomeDir"
  ELASTIC_APM_PROFILER_INTEGRATIONS = "$profilerHomeDir\integrations.yml"
  ELASTIC_APM_SERVER_URL = "http://localhost:8200" 
  ELASTIC_APM_SERVICE_NAME = "dotnettestmetrics0"
  ELASTIC_APM_METRICS_INTERVAL = "0"
}

$environment.Keys | ForEach-Object {
  & $appcmd set config -section:system.applicationHost/applicationPools /+"[name='$appPool'].environmentVariables.[name='$_',value='$($environment[$_])']"
}