Skip to content

Commit f9d0ef8

Browse files
authored
Fix App Map display of unknown dependencies (#1716)
* Fix App Map display of unknown dependencies * Add net peer mapping to target also * Add clarifying comment
1 parent ea2689e commit f9d0ef8

File tree

1 file changed

+16
-0
lines changed
  • agent/exporter/src/main/java/com/microsoft/applicationinsights/agent

1 file changed

+16
-0
lines changed

agent/exporter/src/main/java/com/microsoft/applicationinsights/agent/Exporter.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,22 @@ private void applySemanticConventions(SpanData span, RemoteDependencyTelemetry r
322322
applyServiceBusSpan(attributes, remoteDependencyData);
323323
return;
324324
}
325+
326+
// passing max value because we don't know what the default port would be in this case,
327+
// so we always want the port included
328+
String target = getTargetFromPeerAttributes(attributes, Integer.MAX_VALUE);
329+
if (target != null) {
330+
remoteDependencyData.setTarget(target);
331+
return;
332+
}
333+
334+
// with no target, the App Map falls back to creating a node based on the telemetry name,
335+
// which is very confusing, e.g. when multiple unrelated nodes all point to a single node
336+
// because they had dependencies with the same telemetry name
337+
//
338+
// so we mark these as InProc, even though they aren't INTERNAL spans,
339+
// in order to prevent App Map from considering them
340+
remoteDependencyData.setType("InProc");
325341
}
326342

327343
private void exportLogSpan(SpanData span) {

0 commit comments

Comments
 (0)