diff --git a/core/src/main/java/com/microsoft/applicationinsights/telemetry/BaseTelemetry.java b/core/src/main/java/com/microsoft/applicationinsights/telemetry/BaseTelemetry.java index df9e99a05fd..4112db103b6 100644 --- a/core/src/main/java/com/microsoft/applicationinsights/telemetry/BaseTelemetry.java +++ b/core/src/main/java/com/microsoft/applicationinsights/telemetry/BaseTelemetry.java @@ -125,7 +125,7 @@ public Map getProperties() { public void serialize(JsonTelemetryDataSerializer writer) throws IOException { if (telemetryName == null || telemetryName.isEmpty()) { - telemetryName = getTelemetryName(context.getNormalizedInstrumentationKey(), this.getEnvelopName()); + telemetryName = this.getEnvelopName(); } Envelope envelope = new Envelope(); @@ -203,9 +203,4 @@ public static String normalizeInstrumentationKey(String instrumentationKey){ return instrumentationKey.replace("-", "").toLowerCase() + "."; } } - - public static String getTelemetryName(String normalizedInstrumentationKey, String envelopType){ - return TELEMETRY_NAME_PREFIX + normalizedInstrumentationKey + envelopType; - } - } diff --git a/core/src/test/java/com/microsoft/applicationinsights/telemetry/BaseTelemetryTest.java b/core/src/test/java/com/microsoft/applicationinsights/telemetry/BaseTelemetryTest.java index 710e9e28fa2..b85dd47fed4 100644 --- a/core/src/test/java/com/microsoft/applicationinsights/telemetry/BaseTelemetryTest.java +++ b/core/src/test/java/com/microsoft/applicationinsights/telemetry/BaseTelemetryTest.java @@ -114,7 +114,7 @@ public void testTelemetryNameWithIkey() throws IOException{ writer.close(); String asJson = new String(buffer.readByteArray(), Charsets.UTF_8); - int index = asJson.indexOf("\"name\":\"Microsoft.ApplicationInsights.aif00000000111122223333000000000000.Stub\""); + int index = asJson.indexOf("\"name\":\"Stub\""); assertTrue(index != -1); } @@ -132,7 +132,7 @@ public void testTelemetryNameWithIkey_SpecialChar() throws IOException{ writer.close(); String asJson = new String(buffer.readByteArray(), Charsets.UTF_8); - int index = asJson.indexOf("\"name\":\"Microsoft.ApplicationInsights.Stub\""); + int index = asJson.indexOf("\"name\":\"Stub\""); assertTrue(index != -1); } @@ -149,7 +149,7 @@ public void testTelemetryNameWithIkey_Empty() throws IOException{ writer.close(); String asJson = new String(buffer.readByteArray(), Charsets.UTF_8); - int index = asJson.indexOf("\"name\":\"Microsoft.ApplicationInsights.Stub\""); + int index = asJson.indexOf("\"name\":\"Stub\""); assertTrue(index != -1); }