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

Redesign AWS SDK V3 instrumentation to use middleware #416

Merged
merged 23 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ jobs:
if: matrix.coverage
run: |
npx lerna bootstrap --hoist
npx lerna run compile
npx lerna run testcov
npx lerna run reportcov
echo test
Expand Down
288 changes: 88 additions & 200 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
"private": true,
"license": "Apache-2.0",
"devDependencies": {
"@aws-sdk/config-resolver": "^3.3.0",
"@aws-sdk/middleware-stack": "^3.3.0",
"@aws-sdk/node-config-provider": "^3.3.0",
"@aws-sdk/smithy-client": "^3.3.0",
"@aws-sdk/types": "^3.3.0",
"@hapi/hapi": "^20.0.0",
"@types/chai": "^4.2.12",
"@types/koa": "^2.11.3",
Expand Down Expand Up @@ -45,7 +41,7 @@
"rewire": "^4.0.1",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0",
"tsd": "^0.13.1",
"tsd": "^0.15.1",
"typescript": "^4.1.3",
"upath": "^1.2.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/aws-xray.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export { captureAsyncFunc, captureCallbackFunc, captureFunc } from './capture'

export { captureAWS, captureAWSClient } from './patchers/aws_p';

export type { captureAWSClient as captureAWSv3Client } from './patchers/aws3_p';
export { captureAWSClient as captureAWSv3Client } from './patchers/aws3_p';

export { captureHTTPs, captureHTTPsGlobal } from './patchers/http_p';

Expand Down
17 changes: 10 additions & 7 deletions packages/core/lib/patchers/aws3_p.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import type { MetadataBearer, Client } from '@aws-sdk/types';
import type { RegionInputConfig } from '@aws-sdk/config-resolver';
import { Client, MetadataBearer } from '@aws-sdk/types';
import { RegionResolvedConfig } from '@aws-sdk/config-resolver';
import { SegmentLike } from '../aws-xray';
declare type DefaultConfiguration = RegionInputConfig & {
serviceId: string;
};
export declare function captureAWSClient<Input extends object, Output extends MetadataBearer, Configuration extends DefaultConfiguration>(client: Client<Input, Output, Configuration>, manualSegment?: SegmentLike): Client<Input, Output, Configuration>;
export {};
/**
* Instruments AWS SDK V3 clients with X-Ray via middleware.
*
* @param client - AWS SDK V3 client to instrument
* @param manualSegment - Parent segment or subsegment that is passed in for manual mode users
* @returns - the client with the X-Ray instrumentation middleware added to its middleware stack
*/
export declare function captureAWSClient<Input extends object, Output extends MetadataBearer, Configuration extends RegionResolvedConfig>(client: Client<Input, Output, Configuration>, manualSegment?: SegmentLike): Client<Input, Output, Configuration>;
113 changes: 0 additions & 113 deletions packages/core/lib/patchers/aws3_p.js

This file was deleted.

Loading