mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
chore: update otel to v1.14.0 (#6963)
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user