chore: update otel to v1.14.0 (#6963)

This commit is contained in:
Colin Adler
2023-04-03 00:31:39 -05:00
committed by GitHub
parent f6f927e44f
commit a29fc7dd6f
8 changed files with 65 additions and 70 deletions

View File

@ -16,8 +16,7 @@ import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/propagation"
semconv "go.opentelemetry.io/otel/semconv/v1.11.0"
"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/semconv/v1.14.0/httpconv"
"golang.org/x/xerrors"
"github.com/coder/coder/coderd/tracing"
@ -159,8 +158,7 @@ func (c *Client) Request(ctx context.Context, method, path string, body interfac
opt(req)
}
span.SetAttributes(semconv.NetAttributesFromHTTPRequest("tcp", req)...)
span.SetAttributes(semconv.HTTPClientAttributesFromHTTPRequest(req)...)
span.SetAttributes(httpconv.ClientRequest(req)...)
// Inject tracing headers if enabled.
if c.Trace {
@ -184,8 +182,7 @@ func (c *Client) Request(ctx context.Context, method, path string, body interfac
return nil, err
}
span.SetAttributes(semconv.HTTPStatusCodeKey.Int(resp.StatusCode))
span.SetStatus(semconv.SpanStatusFromHTTPStatusCodeAndSpanKind(resp.StatusCode, trace.SpanKindClient))
span.SetAttributes(httpconv.ClientResponse(resp)...)
// Copy the response body so we can log it if it's a loggable mime type.
var respBody []byte