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 cc7886d2712..f2abc4ecc8e 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 @@ -300,6 +300,9 @@ private static void applyHttpClientSpan( Long httpStatusCode = attributes.get(SemanticAttributes.HTTP_STATUS_CODE); if (httpStatusCode != null) { telemetryBuilder.setResultCode(Long.toString(httpStatusCode)); + } else { + // https://1dsdocs.azurewebsites.net/schema/Mappings/AzureMonitor-AI.html#remotedependencyresultcode + telemetryBuilder.setResultCode("0"); } telemetryBuilder.setData(httpUrl);