Skip to content

Commit

Permalink
Additional tracing for HTTP requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdee committed Sep 29, 2023
1 parent 62cac5c commit b9c9dd1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/attestantio/go-eth2-client/spec"
"github.com/pkg/errors"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
)

Expand Down Expand Up @@ -259,6 +260,7 @@ func (s *Service) get2(ctx context.Context, endpoint string) (*httpResponse, err
log.Debug().Err(err).Msg("Failed to obtain content type; assuming JSON")
res.contentType = ContentTypeJSON
}
span.SetAttributes(attribute.String("content-type", res.contentType.String()))

if err := populateConsensusVersion(res, resp); err != nil {
return nil, errors.Wrap(err, "failed to parse consensus version")
Expand Down

0 comments on commit b9c9dd1

Please sign in to comment.