This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
The instrumentation library for AspNetCore records unhandled exceptions during handling of HTTP requests, adding them as an event to the Activity, and calling the configured Enrich action with an "OnException" event.
The same is not true for exceptions thrown during gRPC request handling, as these are swallowed by ServerCallHandlerBase in the Grpc.AspNetCore library.
Describe the solution you'd like:
Record exceptions thrown thrown during gRPC request handling if EnableGrpcAspNetCoreSupport is true:
Add an event to the Activity.
Call Enrich with an "OnException" event.
This will likely require some diagnostic events to be emitted from the HttpContextServerCallContext in the Grpc.AspNetCore library.
Describe alternatives you've considered.
One work around is to do record the exception and enrich the Activity in a gRPC interceptor, but seems unnecessary boilerplate, requiring separate configuration, in order to bring the features of gRPC tracing up to parity with regular HTTP tracing.
Feature Request
Is your feature request related to a problem?
The instrumentation library for
AspNetCore
records unhandled exceptions during handling of HTTP requests, adding them as an event to theActivity
, and calling the configuredEnrich
action with an"OnException"
event. The same is not true for exceptions thrown during gRPC request handling, as these are swallowed byServerCallHandlerBase
in theGrpc.AspNetCore
library.Describe the solution you'd like:
Record exceptions thrown thrown during gRPC request handling if
EnableGrpcAspNetCoreSupport
istrue
:Activity
.Enrich
with an"OnException"
event.This will likely require some diagnostic events to be emitted from the
HttpContextServerCallContext
in theGrpc.AspNetCore
library.Describe alternatives you've considered.
One work around is to do record the exception and enrich the
Activity
in a gRPC interceptor, but seems unnecessary boilerplate, requiring separate configuration, in order to bring the features of gRPC tracing up to parity with regular HTTP tracing.