L.s.
Where using elastic_apm_profiler version 1.19.0 to collect APM data from our IIS app pool (Windows server 2016, IIS 10.0.14393.0). Most of the data seems to arrive at our elastic deployment. But some SQL query data seems to be missing.
The data is delivert to an elastic cloud deployment (version 8.6.1)
Our config looks as followes:
$appcmd = "$($env:systemroot)\system32\inetsrv\AppCmd.exe"
$profilerHomeDir = "D:\Elastic\elastic-apm-profiler"
$appPool = "OutSystemsApplications"
$ApmUrl = "https://*.apm.westeurope.azure.elastic-cloud.com"
$ApmToken = "*"
$ApmEnvironment = "ZZZ"
$environment = @{
# config profiler
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="none"
ELASTIC_APM_PROFILER_LOG_IL="1"
# Init Agent
ELASTIC_APM_SERVER_URL="$ApmUrl"
ELASTIC_APM_SECRET_TOKEN="$ApmToken"
ELASTIC_APM_ENVIRONMENT="$ApmEnvironment"
ELASTIC_APM_SERVICE_NAME="$appPool"
ELASTIC_APM_CENTRAL_CONFIG="true"
ELASTIC_APM_METRICS_INTERVAL="30000"
}
# add entry
$environment.Keys | ForEach-Object {
write-output "[name='$appPool'].environmentVariables.[name='$_',value='$($environment[$_])']"
& $appcmd set config -section:system.applicationHost/applicationPools /+"[name='$appPool'].environmentVariables.[name='$_',value='$($environment[$_])']"
}
The error we get (in high volume) is:
//
[2023-01-30T14:30:17.8818747+01:00] [ERROR] exception whilst instrumenting integration <Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteReaderWithBehaviorIntegration, System.Data.SqlClient.SqlCommand>
System.NullReferenceException: Object reference not set to an instance of an object.
at Elastic.Apm.Model.Span.TryToCompressRegular(Span sibling) in C:\Users\jenkins\workspace\net_apm-agent-dotnet-mbp_v1.19.0\apm-agent-dotnet\src\Elastic.Apm\Model\Span.cs:line 613
at Elastic.Apm.Model.Span.TryToCompress(Span sibling) in C:\Users\jenkins\workspace\net_apm-agent-dotnet-mbp_v1.19.0\apm-agent-dotnet\src\Elastic.Apm\Model\Span.cs:line 573
at Elastic.Apm.Model.Span.End() in C:\Users\jenkins\workspace\net_apm-agent-dotnet-mbp_v1.19.0\apm-agent-dotnet\src\Elastic.Apm\Model\Span.cs:line 504
at Elastic.Apm.Model.DbSpanCommon.EndSpan(ISpan span, IDbCommand dbCommand, Outcome outcome, Nullable1 duration) in C:\Users\jenkins\workspace\net_apm-agent-dotnet-mbp_v1.19.0\apm-agent-dotnet\src\Elastic.Apm\Model\DbSpanCommon.cs:line 77 at Elastic.Apm.Profiler.Managed.Integrations.AdoNet.DbSpanFactory
1.EndSpan(ApmAgent agent, IDbCommand command, ISpan span, Exception exception) in C:\Users\jenkins\workspace\net_apm-agent-dotnet-mbp_v1.19.0\apm-agent-dotnet\src\Elastic.Apm.Profiler.Managed\Integrations\AdoNet\DbSpanFactory.cs:line 56
at Elastic.Apm.Profiler.Managed.Integrations.AdoNet.CommandExecuteReaderWithBehaviorIntegration.OnMethodEnd[TTarget,TReturn](TTarget instance, TReturn returnValue, Exception exception, CallTargetState state) in C:\Users\jenkins\workspace\net_apm-agent-dotnet-mbp_v1.19.0\apm-agent-dotnet\src\Elastic.Apm.Profiler.Managed\Integrations\AdoNet\CommandExecuteReaderWithBehaviorIntegration.cs:line 70
at CommandExecuteReaderWithBehaviorIntegration.OnMethodEnd.SqlCommand.DbDataReader(SqlCommand , DbDataReader , Exception , CallTargetState )
at Elastic.Apm.Profiler.Managed.CallTarget.Handlers.EndMethodHandler3.Invoke(TTarget instance, TReturn returnValue, Exception exception, CallTargetState state) in C:\Users\jenkins\workspace\net_apm-agent-dotnet-mbp_v1.19.0\apm-agent-dotnet\src\Elastic.Apm.Profiler.Managed\CallTarget\Handlers\EndMethodHandler
1.cs:line 100
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
//
Does anyone know what this means and how to fix it?
Thanks a lot!
Regards,
Alexander