Fix Remote IP Address - NULL reference exception (#3481)
This commit is contained in:
parent
82e041c27c
commit
0a4a625158
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
* Fix Remote IP Address - NULL reference exception.
|
||||
([#3481](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3481))
|
||||
* Metrics instrumentation to correctly populate `http.flavor` tag.
|
||||
(1.1 instead of HTTP/1.1 etc.)
|
||||
([#3379](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3379))
|
||||
|
|
|
|||
|
|
@ -360,7 +360,11 @@ namespace OpenTelemetry.Instrumentation.AspNetCore.Implementation
|
|||
activity.DisplayName = grpcMethod.TrimStart('/');
|
||||
|
||||
activity.SetTag(SemanticConventions.AttributeRpcSystem, GrpcTagHelper.RpcSystemGrpc);
|
||||
activity.SetTag(SemanticConventions.AttributeNetPeerIp, context.Connection.RemoteIpAddress.ToString());
|
||||
if (context.Connection.RemoteIpAddress != null)
|
||||
{
|
||||
activity.SetTag(SemanticConventions.AttributeNetPeerIp, context.Connection.RemoteIpAddress.ToString());
|
||||
}
|
||||
|
||||
activity.SetTag(SemanticConventions.AttributeNetPeerPort, context.Connection.RemotePort);
|
||||
|
||||
bool validConversion = GrpcTagHelper.TryGetGrpcStatusCodeFromActivity(activity, out int status);
|
||||
|
|
|
|||
Loading…
Reference in New Issue