Solution found!
The initial configuration consisted out of auto Profiler setup on the Application pools with the environment variables in the central /windows/microsoft.net/framework64/v4.0****/web.config
That setup works fine for stand-alone applications that do not use shared DLLs through a symbolic link.
For platforms that uses this setup you can solve it by only using the profiler setup like below:
$appcmd = "$($env:systemroot)\system32\inetsrv\AppCmd.exe"
$appPool = "OutSystemsApplications"
$profilerHomeDir = "E:\ElasticStack\elastic_apm_profiler"
$environment = @{
COR_ENABLE_PROFILING = "1"
COR_PROFILER_PATH = "$profilerHomeDir\elastic_apm_profiler.dll"
COR_PROFILER = "{FA65FE15-F085-4681-9B20-95E04F6C03CC}"
COMPlus_LoaderOptimization = "1"
ELASTIC_APM_PROFILER_HOME = "$profilerHomeDir\"
ELASTIC_APM_PROFILER_INTEGRATIONS = "$profilerHomeDir\integrations.yml"
ELASTIC_APM_PROFILER_LOG_DIR="$profilerHomeDir\logs"
ELASTIC_APM_PROFILER_LOG="warn"
ELASTIC_APM_PROFILER_LOG_IL="1"
#Added agent environment settings below for the profiler to initialize the agent correctly!
ELASTIC_APM_SERVER_URL="https://****.apm.westeurope.azure.elastic-cloud.com"
ELASTIC_APM_SECRET_TOKEN="**********"
ELASTIC_APM_ENVIRONMENT="********"
ELASTIC_APM_SERVICE_NAME="$appPool"
ELASTIC_APM_CENTRAL_CONFIG="true"
ELASTIC_APM_METRICS_INTERVAL="30000"
}
$environment.Keys | ForEach-Object {
write-output "[name='$appPool'].environmentVariables.[name='$_',value='$($environment[$_])']"
#delete entry
& $appcmd set config -section:system.applicationHost/applicationPools /-"[name='$appPool'].environmentVariables.[name='$_']"
#add entry
& $appcmd set config -section:system.applicationHost/applicationPools /+"[name='$appPool'].environmentVariables.[name='$_',value='$($environment[$_])']"
}
& $appcmd list config -section:system.applicationHost/applicationPools
It also simplifies our setup since I only need to change the Application pool name and rerun it..
@forloop Thanks for all the help!. Any chance our findings can be added to the installation documentation to help others?
Disadvantage: Can't use a service name per application anymore since it's configured centrally per app pool. But at least it's capturing, will see if we can find some way of identifying/grouping per app