HTTP client instrumentation was incorrectly putting the text representation of an HTTP status code into http.status_code. (#964)
Other changes - HTTP 100-200 status codes should map to OK. see https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/http.md#status
This commit is contained in:
parent
637874f49e
commit
a3e6b0364f
|
|
@ -72,7 +72,7 @@ namespace OpenTelemetry.Trace
|
|||
{
|
||||
var newStatus = Status.Unknown;
|
||||
|
||||
if (httpStatusCode >= 200 && httpStatusCode <= 399)
|
||||
if (httpStatusCode >= 100 && httpStatusCode <= 399)
|
||||
{
|
||||
newStatus = Status.Ok;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ namespace OpenTelemetry.Instrumentation.Http.Implementation
|
|||
if (this.stopResponseFetcher.Fetch(payload) is HttpResponseMessage response)
|
||||
{
|
||||
// response could be null for DNS issues, timeouts, etc...
|
||||
activity.AddTag(SemanticConventions.AttributeHttpStatusCode, response.StatusCode.ToString());
|
||||
activity.AddTag(SemanticConventions.AttributeHttpStatusCode, HttpTagHelper.GetStatusCodeTagValueFromHttpStatusCode(response.StatusCode));
|
||||
|
||||
activity.SetStatus(
|
||||
SpanHelper
|
||||
|
|
|
|||
Loading…
Reference in New Issue