rebase: bump the github-dependencies group with 2 updates

Bumps the github-dependencies group with 2 updates: [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) and [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang).


Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.30.7 to 1.31.1
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/service/s3/v1.31.1/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mgn/v1.30.7...service/s3/v1.31.1)

Updates `github.com/prometheus/client_golang` from 1.20.3 to 1.20.4
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.20.3...v1.20.4)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/service/sts
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-dependencies
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2024-09-23 20:18:36 +00:00
committed by mergify[bot]
parent dbd8462bcc
commit 40ad4163cb
45 changed files with 1296 additions and 98 deletions

View File

@ -7,6 +7,7 @@ import (
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/tracing"
)
// ClientDo provides the interface for custom HTTP client implementations.
@ -42,6 +43,9 @@ func NewClientHandler(client ClientDo) ClientHandler {
func (c ClientHandler) Handle(ctx context.Context, input interface{}) (
out interface{}, metadata middleware.Metadata, err error,
) {
ctx, span := tracing.StartSpan(ctx, "DoHTTPRequest")
defer span.End()
req, ok := input.(*Request)
if !ok {
return nil, metadata, fmt.Errorf("expect Smithy http.Request value as input, got unsupported type %T", input)
@ -52,6 +56,16 @@ func (c ClientHandler) Handle(ctx context.Context, input interface{}) (
return nil, metadata, err
}
span.SetProperty("http.method", req.Method)
span.SetProperty("http.request_content_length", -1) // at least indicate unknown
length, ok, err := req.StreamLength()
if err != nil {
return nil, metadata, err
}
if ok {
span.SetProperty("http.request_content_length", length)
}
resp, err := c.client.Do(builtRequest)
if resp == nil {
// Ensure a http response value is always present to prevent unexpected
@ -79,6 +93,10 @@ func (c ClientHandler) Handle(ctx context.Context, input interface{}) (
_ = builtRequest.Body.Close()
}
span.SetProperty("net.protocol.version", fmt.Sprintf("%d.%d", resp.ProtoMajor, resp.ProtoMinor))
span.SetProperty("http.status_code", resp.StatusCode)
span.SetProperty("http.response_content_length", resp.ContentLength)
return &Response{Response: resp}, metadata, err
}