Skip to content

Commit

Permalink
Set resultCode to zero when Span.httpStatusCode is not present (#2925)
Browse files Browse the repository at this point in the history
  • Loading branch information
heyams authored Feb 22, 2023
1 parent 63e52a8 commit 4341890
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4341890

Please sign in to comment.