Skip to content

Commit

Permalink
Fix App Map display of unknown dependencies (#1716)
Browse files Browse the repository at this point in the history
* Fix App Map display of unknown dependencies

* Add net peer mapping to target also

* Add clarifying comment
  • Loading branch information
trask authored Jun 1, 2021
1 parent ea2689e commit f9d0ef8
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,22 @@ private void applySemanticConventions(SpanData span, RemoteDependencyTelemetry r
applyServiceBusSpan(attributes, remoteDependencyData);
return;
}

// passing max value because we don't know what the default port would be in this case,
// so we always want the port included
String target = getTargetFromPeerAttributes(attributes, Integer.MAX_VALUE);
if (target != null) {
remoteDependencyData.setTarget(target);
return;
}

// with no target, the App Map falls back to creating a node based on the telemetry name,
// which is very confusing, e.g. when multiple unrelated nodes all point to a single node
// because they had dependencies with the same telemetry name
//
// so we mark these as InProc, even though they aren't INTERNAL spans,
// in order to prevent App Map from considering them
remoteDependencyData.setType("InProc");
}

private void exportLogSpan(SpanData span) {
Expand Down

0 comments on commit f9d0ef8

Please sign in to comment.