From a77b14de81dd55bd9a1ed99fc302097d9f2e6b72 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Thu, 20 Oct 2022 10:01:24 -0700 Subject: [PATCH] Fix just merged code (#2607) I forgot to remove a test commit from #2596: https://github.com/microsoft/ApplicationInsights-Java/pull/2596/commits/31a066ddcf092eacf47886f43a1d63107a3061d0 --- .../exporter/implementation/SpanDataMapper.java | 3 +++ .../src/smokeTest/resources/applicationinsights.json | 12 ------------ 2 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 smoke-tests/apps/WebFlux/src/smokeTest/resources/applicationinsights.json diff --git a/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/SpanDataMapper.java b/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/SpanDataMapper.java index bc5a2dea4b6..27ef5de0d61 100644 --- a/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/SpanDataMapper.java +++ b/agent/azure-monitor-exporter/src/main/java/com/azure/monitor/opentelemetry/exporter/implementation/SpanDataMapper.java @@ -603,6 +603,9 @@ public static String getHttpUrlFromServerSpan(Attributes attributes) { return null; } String host = attributes.get(SemanticAttributes.NET_HOST_NAME); + if (host == null) { + return null; + } Long port = attributes.get(SemanticAttributes.NET_HOST_PORT); String target = attributes.get(SemanticAttributes.HTTP_TARGET); if (target == null) { diff --git a/smoke-tests/apps/WebFlux/src/smokeTest/resources/applicationinsights.json b/smoke-tests/apps/WebFlux/src/smokeTest/resources/applicationinsights.json deleted file mode 100644 index 3c170aa1b64..00000000000 --- a/smoke-tests/apps/WebFlux/src/smokeTest/resources/applicationinsights.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "role": { - "name": "testrolename", - "instance": "testroleinstance" - }, - "sampling": { - "percentage": 100 - }, - "selfDiagnostics": { - "level": "debug" - } -}