Skip to content

Commit

Permalink
Merge pull request moby#46645 from thaJeztah/otel_semconv
Browse files Browse the repository at this point in the history
switch to go.opentelemetry.io/otel/semconv/v1.17.0
  • Loading branch information
thaJeztah authored Oct 16, 2023
2 parents fd3066c + 25fb4dd commit 91cb91a
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 3,021 deletions.
8 changes: 4 additions & 4 deletions client/hijack.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/propagation"
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
"go.opentelemetry.io/otel/semconv/v1.17.0/httpconv"
"go.opentelemetry.io/otel/trace"
)

Expand Down Expand Up @@ -65,8 +65,8 @@ func (cli *Client) setupHijackConn(req *http.Request, proto string) (_ net.Conn,
}
}

ctx, span := tp.Tracer("").Start(ctx, req.Method+" "+req.URL.Path)
span.SetAttributes(semconv.HTTPClientAttributesFromHTTPRequest(req)...)
ctx, span := tp.Tracer("").Start(ctx, req.Method+" "+req.URL.Path, trace.WithSpanKind(trace.SpanKindClient))
span.SetAttributes(httpconv.ClientRequest(req)...)
defer func() {
if retErr != nil {
span.RecordError(retErr)
Expand Down Expand Up @@ -98,7 +98,7 @@ func (cli *Client) setupHijackConn(req *http.Request, proto string) (_ net.Conn,
// Server hijacks the connection, error 'connection closed' expected
resp, err := clientconn.Do(req)
if resp != nil {
span.SetStatus(semconv.SpanStatusFromHTTPStatusCode(resp.StatusCode))
span.SetStatus(httpconv.ClientStatus(resp.StatusCode))
}

//nolint:staticcheck // ignore SA1019 for connecting to old (pre go1.8) daemons
Expand Down
2 changes: 1 addition & 1 deletion testutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/sdk/resource"
"go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
"gotest.tools/v3/icmd"
)

Expand Down
336 changes: 0 additions & 336 deletions vendor/go.opentelemetry.io/otel/semconv/internal/http.go

This file was deleted.

20 changes: 0 additions & 20 deletions vendor/go.opentelemetry.io/otel/semconv/v1.7.0/doc.go

This file was deleted.

Loading

0 comments on commit 91cb91a

Please sign in to comment.