in src/Library/Inputs/GrpcInput/GrpcInput.cs [98:133]
private void OnDataReceived(HandleTraceSpanRequest request, ServerCallContext context)
{
try
{
Interlocked.Increment(ref this.stats.RequestsReceived);
foreach(var instance in request.Instances)
{
try
{
this.onProcessInstance?.Invoke(instance);
Interlocked.Increment(ref this.stats.InstancesSucceeded);
}
catch (System.Exception e)
{
// unexpected exception occured while processing the batch
Interlocked.Increment(ref this.stats.InstancesFailed);
Diagnostics.LogError(FormattableString.Invariant($"Unknown exception while processing a batch received through the gRPC input. {e.ToString()}"));
}
}
}
catch (TaskCanceledException)
{
// we have been stopped
}
catch (System.Exception e)
{
// unexpected exception occured
Diagnostics.LogError(FormattableString.Invariant($"Unknown exception while reading from gRPC stream. {e.ToString()}"));
this.Stop();
}
}