opentelemetry-dotnet-contrib
opentelemetry-dotnet-contrib copied to clipboard
`RecordException = true` behavior in Http instrumentation
Unit tests validating the behavior (i.e. whether the output span will contain the exception event) was added in https://github.com/open-telemetry/opentelemetry-dotnet/pull/3761. Opening this issue to summarize the details and discuss any improvements that may be needed towards making the experience consistent. Following table summarizes the output for each method that was added in unit test.
| Class Name | Method Name | Response code | Exception SpanEvent |
|---|---|---|---|
| HttpClient | GetAsync | Error response code | No |
| HttpClient | GetAsync | Network error | Yes |
| HttpClient | GetStringAsync | Network error | Yes |
| HttpClient | GetStringAsync | Error response code | No |
| WebRequest | GetResponseAsync | Error response code | Yes |
| WebRequest | GetResponseAsync | Network error | Yes |