From b9c9dd1947f8afd61e19cb412f8213174bc873ca Mon Sep 17 00:00:00 2001 From: Jim McDonald Date: Fri, 29 Sep 2023 20:45:55 +0100 Subject: [PATCH] Additional tracing for HTTP requests. --- http/http.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/http/http.go b/http/http.go index 53f67204..dbe1b40d 100644 --- a/http/http.go +++ b/http/http.go @@ -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" ) @@ -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")