Open
Description
Description
Instrumentation for s3 records 3xx http responses as errors.
There is already http.status_code
that covers the result of the call, so recording the error does not add any useful information.
When getting objects from s3 conditionally a 3xx http response is expected if the condition is not satisfied. For example, you might get an object if is has been modified since the last time it was accessed.
Environment
- OS: Linux
- Architecture: x86
- Go Version: 1.23.2
otelaws
version: v0.52.0
Steps To Reproduce
s3Client.GetObject(ctx, &s3.GetObjectInput{
Bucket: aws.String(bucket),
Key: aws.String(object),
IfModifiedSince: lastModified,
})
Expected behavior
Don't record an error for 3xx responses.
Potential fix
The error could be checked using something like:
import (
"net/http"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
...
var respErr *awshttp.ResponseError
if errors.As(err, &respErr) && respErr.HTTPStatusCode() == http.StatusNotModified {
It seems reasonable to do this for all services, or there could be an "IsTraceableError" check for each service which would not record these "error" responses.
I can create a PR for this if useful.
Metadata
Metadata
Assignees
Type
Projects
Status
Needs triage