Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@aws-sdk/client-s3 TAV tests failing in main #3523

Closed
david-luna opened this issue Jul 31, 2023 · 2 comments · Fixed by #3526
Closed

@aws-sdk/client-s3 TAV tests failing in main #3523

david-luna opened this issue Jul 31, 2023 · 2 comments · Fixed by #3526
Assignees
Labels
agent-nodejs Make available for APM Agents project planning.

Comments

@david-luna
Copy link
Member

david-luna commented Jul 31, 2023

Latest TAV tests in main are failing for @aws-sdk/client-s3 instrumentation see https://github.com/elastic/apm-agent-nodejs/actions/runs/5713633220/job/15479387000#step:3:288

We should check if there have been changes in higher versions that we are not aware of. The assertion failing is about the error reported to the APM server.

We expect to send a proper span with failure outcome.

{
  name: "S3 GetObject elasticapmtest-bucket-3",
  type: "storage",
  subtype: "s3",
  action: "GetObject",
  context:
    {
      service: { target: { type: "s3", name: "elasticapmtest-bucket-3" } },
      destination:
        {
          address: "localstack",
          port: 4566,
          cloud: { region: "us-east-2" },
          service: { type: "", name: "", resource: "elasticapmtest-bucket-3" },
        },
      http: { status_code: 404 },
    },
  otel:
    {
      attributes:
        {
          "aws.s3.bucket": "elasticapmtest-bucket-3",
          "aws.s3.key": "aDir/aFile.txt-does-not-exist",
        },
    },
  outcome: "failure"
}

But instead we get a HTTP span

{
  name: "GET localstack:4566",
  type: "external",
  subtype: "http",
  action: "GET",
  context:
    {
      service: { target: { type: "http", name: "localstack:4566" } },
      destination:
        {
          address: "localstack",
          port: 4566,
          service: { type: "", name: "", resource: "localstack:4566" },
        },
      http:
        {
          method: "GET",
          status_code: 404,
          url: "http://localstack:4566/elasticapmtest-bucket-3/aDir/aFile.txt-does-not-exist?x-id=GetObject",
        },
    },
  outcome: "failure"
}
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label Jul 31, 2023
@david-luna david-luna changed the title @aws-sed/client-s3 TAV tests failing in main @aws-sdk/client-s3 TAV tests failing in main Jul 31, 2023
@david-luna
Copy link
Member Author

Not failing when running in local but it seems the instrumentation is not working ion the CI. Snapshot of the spans generated while testing

node_tests_1  | spans [
node_tests_1  |   {
node_tests_1  |     "name": "GET localstack:4566",
node_tests_1  |     "type": "external",
node_tests_1  |     "id": "fbeeebf8af213a0a",
node_tests_1  |     "transaction_id": "d4f5c4f87fa798a8",
node_tests_1  |     "parent_id": "d4f5c4f87fa798a8",
node_tests_1  |     "trace_id": "13e731d11406da8db30b6f0da8094038",
node_tests_1  |     "subtype": "http",
node_tests_1  |     "action": "GET",
node_tests_1  |     "timestamp": 1690811926751297,
node_tests_1  |     "duration": 197.825,
node_tests_1  |     "context": {
node_tests_1  |       "service": {
node_tests_1  |         "target": {
node_tests_1  |           "type": "http",
node_tests_1  |           "name": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "destination": {
node_tests_1  |         "address": "localstack",
node_tests_1  |         "port": 4566,
node_tests_1  |         "service": {
node_tests_1  |           "type": "",
node_tests_1  |           "name": "",
node_tests_1  |           "resource": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "http": {
node_tests_1  |         "method": "GET",
node_tests_1  |         "status_code": 200,
node_tests_1  |         "url": "http://localstack:4566/"
node_tests_1  |       }
node_tests_1  |     },
node_tests_1  |     "sync": false,
node_tests_1  |     "outcome": "success",
node_tests_1  |     "sample_rate": 1
node_tests_1  |   },
node_tests_1  |   {
node_tests_1  |     "name": "PUT localstack:4566",
node_tests_1  |     "type": "external",
node_tests_1  |     "id": "acf0ecee142799a8",
node_tests_1  |     "transaction_id": "d4f5c4f87fa798a8",
node_tests_1  |     "parent_id": "d4f5c4f87fa798a8",
node_tests_1  |     "trace_id": "13e731d11406da8db30b6f0da8094038",
node_tests_1  |     "subtype": "http",
node_tests_1  |     "action": "PUT",
node_tests_1  |     "timestamp": 1690811926958147,
node_tests_1  |     "duration": 51.801,
node_tests_1  |     "context": {
node_tests_1  |       "service": {
node_tests_1  |         "target": {
node_tests_1  |           "type": "http",
node_tests_1  |           "name": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "destination": {
node_tests_1  |         "address": "localstack",
node_tests_1  |         "port": 4566,
node_tests_1  |         "service": {
node_tests_1  |           "type": "",
node_tests_1  |           "name": "",
node_tests_1  |           "resource": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "http": {
node_tests_1  |         "method": "PUT",
node_tests_1  |         "status_code": 200,
node_tests_1  |         "url": "http://localstack:4566/elasticapmtest-bucket-3/"
node_tests_1  |       }
node_tests_1  |     },
node_tests_1  |     "sync": false,
node_tests_1  |     "outcome": "success",
node_tests_1  |     "sample_rate": 1
node_tests_1  |   },
node_tests_1  |   {
node_tests_1  |     "name": "HEAD localstack:4566",
node_tests_1  |     "type": "external",
node_tests_1  |     "id": "0609adb87b89d27f",
node_tests_1  |     "transaction_id": "d4f5c4f87fa798a8",
node_tests_1  |     "parent_id": "d4f5c4f87fa798a8",
node_tests_1  |     "trace_id": "13e731d11406da8db30b6f0da8094038",
node_tests_1  |     "subtype": "http",
node_tests_1  |     "action": "HEAD",
node_tests_1  |     "timestamp": 1690811927013363,
node_tests_1  |     "duration": 5.006,
node_tests_1  |     "context": {
node_tests_1  |       "service": {
node_tests_1  |         "target": {
node_tests_1  |           "type": "http",
node_tests_1  |           "name": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "destination": {
node_tests_1  |         "address": "localstack",
node_tests_1  |         "port": 4566,
node_tests_1  |         "service": {
node_tests_1  |           "type": "",
node_tests_1  |           "name": "",
node_tests_1  |           "resource": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "http": {
node_tests_1  |         "method": "HEAD",
node_tests_1  |         "status_code": 200,
node_tests_1  |         "url": "http://localstack:4566/elasticapmtest-bucket-3/"
node_tests_1  |       }
node_tests_1  |     },
node_tests_1  |     "sync": false,
node_tests_1  |     "outcome": "success",
node_tests_1  |     "sample_rate": 1
node_tests_1  |   },
node_tests_1  |   {
node_tests_1  |     "name": "PUT localstack:4566",
node_tests_1  |     "type": "external",
node_tests_1  |     "id": "d30a3c90286ae94c",
node_tests_1  |     "transaction_id": "d4f5c4f87fa798a8",
node_tests_1  |     "parent_id": "d4f5c4f87fa798a8",
node_tests_1  |     "trace_id": "13e731d11406da8db30b6f0da8094038",
node_tests_1  |     "subtype": "http",
node_tests_1  |     "action": "PUT",
node_tests_1  |     "timestamp": 1690811927022592,
node_tests_1  |     "duration": 163.404,
node_tests_1  |     "context": {
node_tests_1  |       "service": {
node_tests_1  |         "target": {
node_tests_1  |           "type": "http",
node_tests_1  |           "name": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "destination": {
node_tests_1  |         "address": "localstack",
node_tests_1  |         "port": 4566,
node_tests_1  |         "service": {
node_tests_1  |           "type": "",
node_tests_1  |           "name": "",
node_tests_1  |           "resource": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "http": {
node_tests_1  |         "method": "PUT",
node_tests_1  |         "status_code": 200,
node_tests_1  |         "url": "http://localstack:4566/elasticapmtest-bucket-3/aDir/aFile.txt?x-id=PutObject"
node_tests_1  |       }
node_tests_1  |     },
node_tests_1  |     "sync": false,
node_tests_1  |     "outcome": "success",
node_tests_1  |     "sample_rate": 1
node_tests_1  |   },
node_tests_1  |   {
node_tests_1  |     "name": "HEAD localstack:4566",
node_tests_1  |     "type": "external",
node_tests_1  |     "id": "b6823bf790f6bdee",
node_tests_1  |     "transaction_id": "d4f5c4f87fa798a8",
node_tests_1  |     "parent_id": "d4f5c4f87fa798a8",
node_tests_1  |     "trace_id": "13e731d11406da8db30b6f0da8094038",
node_tests_1  |     "subtype": "http",
node_tests_1  |     "action": "HEAD",
node_tests_1  |     "timestamp": 1690811927189531,
node_tests_1  |     "duration": 7.286,
node_tests_1  |     "context": {
node_tests_1  |       "service": {
node_tests_1  |         "target": {
node_tests_1  |           "type": "http",
node_tests_1  |           "name": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "destination": {
node_tests_1  |         "address": "localstack",
node_tests_1  |         "port": 4566,
node_tests_1  |         "service": {
node_tests_1  |           "type": "",
node_tests_1  |           "name": "",
node_tests_1  |           "resource": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "http": {
node_tests_1  |         "method": "HEAD",
node_tests_1  |         "status_code": 200,
node_tests_1  |         "url": "http://localstack:4566/elasticapmtest-bucket-3/aDir/aFile.txt"
node_tests_1  |       }
node_tests_1  |     },
node_tests_1  |     "sync": false,
node_tests_1  |     "outcome": "success",
node_tests_1  |     "sample_rate": 1
node_tests_1  |   },
node_tests_1  |   {
node_tests_1  |     "name": "GET localstack:4566",
node_tests_1  |     "type": "external",
node_tests_1  |     "id": "5261a9bf7f101888",
node_tests_1  |     "transaction_id": "d4f5c4f87fa798a8",
node_tests_1  |     "parent_id": "d4f5c4f87fa798a8",
node_tests_1  |     "trace_id": "13e731d11406da8db30b6f0da8094038",
node_tests_1  |     "subtype": "http",
node_tests_1  |     "action": "GET",
node_tests_1  |     "timestamp": 1690811927199509,
node_tests_1  |     "duration": 46.703,
node_tests_1  |     "context": {
node_tests_1  |       "service": {
node_tests_1  |         "target": {
node_tests_1  |           "type": "http",
node_tests_1  |           "name": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "destination": {
node_tests_1  |         "address": "localstack",
node_tests_1  |         "port": 4566,
node_tests_1  |         "service": {
node_tests_1  |           "type": "",
node_tests_1  |           "name": "",
node_tests_1  |           "resource": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "http": {
node_tests_1  |         "method": "GET",
node_tests_1  |         "status_code": 200,
node_tests_1  |         "url": "http://localstack:4566/elasticapmtest-bucket-3/aDir/aFile.txt?x-id=GetObject"
node_tests_1  |       }
node_tests_1  |     },
node_tests_1  |     "sync": false,
node_tests_1  |     "outcome": "success",
node_tests_1  |     "sample_rate": 1
node_tests_1  |   },
node_tests_1  |   {
node_tests_1  |     "name": "get-signed-url",
node_tests_1  |     "type": "custom",
node_tests_1  |     "id": "39ed069b69f90c38",
node_tests_1  |     "transaction_id": "d4f5c4f87fa798a8",
node_tests_1  |     "parent_id": "d4f5c4f87fa798a8",
node_tests_1  |     "trace_id": "13e731d11406da8db30b6f0da8094038",
node_tests_1  |     "subtype": null,
node_tests_1  |     "action": null,
node_tests_1  |     "timestamp": 1690811927247045,
node_tests_1  |     "duration": 5.701,
node_tests_1  |     "sync": false,
node_tests_1  |     "outcome": "success",
node_tests_1  |     "sample_rate": 1
node_tests_1  |   },
node_tests_1  |   {
node_tests_1  |     "name": "GET localstack:4566",
node_tests_1  |     "type": "external",
node_tests_1  |     "id": "c4baf858c2aa7af6",
node_tests_1  |     "transaction_id": "d4f5c4f87fa798a8",
node_tests_1  |     "parent_id": "d4f5c4f87fa798a8",
node_tests_1  |     "trace_id": "13e731d11406da8db30b6f0da8094038",
node_tests_1  |     "subtype": "http",
node_tests_1  |     "action": "GET",
node_tests_1  |     "timestamp": 1690811927254571,
node_tests_1  |     "duration": 8.014,
node_tests_1  |     "context": {
node_tests_1  |       "service": {
node_tests_1  |         "target": {
node_tests_1  |           "type": "http",
node_tests_1  |           "name": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "destination": {
node_tests_1  |         "address": "localstack",
node_tests_1  |         "port": 4566,
node_tests_1  |         "service": {
node_tests_1  |           "type": "",
node_tests_1  |           "name": "",
node_tests_1  |           "resource": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "http": {
node_tests_1  |         "method": "GET",
node_tests_1  |         "status_code": 304,
node_tests_1  |         "url": "http://localstack:4566/elasticapmtest-bucket-3/aDir/aFile.txt?x-id=GetObject"
node_tests_1  |       }
node_tests_1  |     },
node_tests_1  |     "sync": false,
node_tests_1  |     "outcome": "success",
node_tests_1  |     "sample_rate": 1
node_tests_1  |   },
node_tests_1  |   {
node_tests_1  |     "name": "GET localstack:4566",
node_tests_1  |     "type": "external",
node_tests_1  |     "id": "807ef84b71538360",
node_tests_1  |     "transaction_id": "d4f5c4f87fa798a8",
node_tests_1  |     "parent_id": "d4f5c4f87fa798a8",
node_tests_1  |     "trace_id": "13e731d11406da8db30b6f0da8094038",
node_tests_1  |     "subtype": "http",
node_tests_1  |     "action": "GET",
node_tests_1  |     "timestamp": 1690811927266333,
node_tests_1  |     "duration": 47.862,
node_tests_1  |     "context": {
node_tests_1  |       "service": {
node_tests_1  |         "target": {
node_tests_1  |           "type": "http",
node_tests_1  |           "name": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "destination": {
node_tests_1  |         "address": "localstack",
node_tests_1  |         "port": 4566,
node_tests_1  |         "service": {
node_tests_1  |           "type": "",
node_tests_1  |           "name": "",
node_tests_1  |           "resource": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "http": {
node_tests_1  |         "method": "GET",
node_tests_1  |         "status_code": 404,
node_tests_1  |         "url": "http://localstack:4566/elasticapmtest-bucket-3/aDir/aFile.txt-does-not-exist?x-id=GetObject"
node_tests_1  |       }
node_tests_1  |     },
node_tests_1  |     "sync": false,
node_tests_1  |     "outcome": "failure",
node_tests_1  |     "sample_rate": 1
node_tests_1  |   },
node_tests_1  |   {
node_tests_1  |     "name": "DELETE localstack:4566",
node_tests_1  |     "type": "external",
node_tests_1  |     "id": "396ddc615f1f554f",
node_tests_1  |     "transaction_id": "d4f5c4f87fa798a8",
node_tests_1  |     "parent_id": "d4f5c4f87fa798a8",
node_tests_1  |     "trace_id": "13e731d11406da8db30b6f0da8094038",
node_tests_1  |     "subtype": "http",
node_tests_1  |     "action": "DELETE",
node_tests_1  |     "timestamp": 1690811927318285,
node_tests_1  |     "duration": 5.773,
node_tests_1  |     "context": {
node_tests_1  |       "service": {
node_tests_1  |         "target": {
node_tests_1  |           "type": "http",
node_tests_1  |           "name": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "destination": {
node_tests_1  |         "address": "localstack",
node_tests_1  |         "port": 4566,
node_tests_1  |         "service": {
node_tests_1  |           "type": "",
node_tests_1  |           "name": "",
node_tests_1  |           "resource": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "http": {
node_tests_1  |         "method": "DELETE",
node_tests_1  |         "status_code": 204,
node_tests_1  |         "url": "http://localstack:4566/elasticapmtest-bucket-3/aDir/aFile.txt?x-id=DeleteObject"
node_tests_1  |       }
node_tests_1  |     },
node_tests_1  |     "sync": false,
node_tests_1  |     "outcome": "success",
node_tests_1  |     "sample_rate": 1
node_tests_1  |   },
node_tests_1  |   {
node_tests_1  |     "name": "DELETE localstack:4566",
node_tests_1  |     "type": "external",
node_tests_1  |     "id": "fbb5da9c8ce08f0c",
node_tests_1  |     "transaction_id": "d4f5c4f87fa798a8",
node_tests_1  |     "parent_id": "d4f5c4f87fa798a8",
node_tests_1  |     "trace_id": "13e731d11406da8db30b6f0da8094038",
node_tests_1  |     "subtype": "http",
node_tests_1  |     "action": "DELETE",
node_tests_1  |     "timestamp": 1690811927326893,
node_tests_1  |     "duration": 5.034,
node_tests_1  |     "context": {
node_tests_1  |       "service": {
node_tests_1  |         "target": {
node_tests_1  |           "type": "http",
node_tests_1  |           "name": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "destination": {
node_tests_1  |         "address": "localstack",
node_tests_1  |         "port": 4566,
node_tests_1  |         "service": {
node_tests_1  |           "type": "",
node_tests_1  |           "name": "",
node_tests_1  |           "resource": "localstack:4566"
node_tests_1  |         }
node_tests_1  |       },
node_tests_1  |       "http": {
node_tests_1  |         "method": "DELETE",
node_tests_1  |         "status_code": 204,
node_tests_1  |         "url": "http://localstack:4566/elasticapmtest-bucket-3/"
node_tests_1  |       }
node_tests_1  |     },
node_tests_1  |     "sync": false,
node_tests_1  |     "outcome": "success",
node_tests_1  |     "sample_rate": 1
node_tests_1  |   }
node_tests_1  | ]

@david-luna
Copy link
Member Author

npm ls @smithy/smithy-client

elastic-apm-node@3.48.0 /Users/david/Documents/repos/el/apm-agent-nodejs
├─┬ @aws-sdk/client-s3@3.379.1
│ ├─┬ @aws-sdk/client-sts@3.379.1
│ │ └── @smithy/smithy-client@2.0.1
│ ├─┬ @aws-sdk/credential-provider-node@3.379.1
│ │ └─┬ @aws-sdk/credential-provider-sso@3.379.1
│ │   ├─┬ @aws-sdk/client-sso@3.379.1
│ │   │ └── @smithy/smithy-client@2.0.1
│ │   └─┬ @aws-sdk/token-providers@3.379.1
│ │     └─┬ @aws-sdk/client-sso-oidc@3.379.1
│ │       └── @smithy/smithy-client@2.0.1
│ └── @smithy/smithy-client@2.0.1
└─┬ @aws-sdk/s3-request-presigner@3.367.0
  └── @smithy/smithy-client@1.0.3

Smithy client dependency has been updated to a new major in this PR but only bumping a minor in the client-s3 package. According to semver there shouldn't be any breaking change for the package. We should check if changes in @smithy/smithy-client's instrumentation are necessary

@david-luna david-luna self-assigned this Jul 31, 2023
trentm pushed a commit that referenced this issue Jul 31, 2023
`@smithy/client@2` is used in `@aws-sdk/*` v3.378.0 and later.

Closes: #3523
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
1 participant