Skip to content

Commit 198fcf9

Browse files
committed
remove unused deps/vars, update package-lock
1 parent 4dab50c commit 198fcf9

File tree

4 files changed

+101
-41
lines changed

4 files changed

+101
-41
lines changed

incubator/opentelemetry-sampler-aws-xray/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@
4040
"version:update": "node ../../scripts/version-update.js",
4141
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json"
4242
},
43+
"peerDependencies": {
44+
"@opentelemetry/api": "^1.9.0"
45+
},
4346
"dependencies": {
44-
"@opentelemetry/api": "^1.9.0",
4547
"@opentelemetry/core": "^1.26.0",
4648
"@opentelemetry/resources": "^1.10.0",
47-
"@opentelemetry/sdk-trace-base": "^1.26.0",
48-
"@opentelemetry/semantic-conventions": "^1.27.0"
49+
"@opentelemetry/sdk-trace-base": "^1.26.0"
4950
},
5051
"devDependencies": {
5152
"@opentelemetry/sdk-trace-node": "^1.26.0",

incubator/opentelemetry-sampler-aws-xray/src/remote-sampler.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export class _AWSXRayRemoteSampler implements Sampler {
8989
private awsProxyEndpoint: string;
9090
private samplerDiag: DiagLogger;
9191
private rulePoller: NodeJS.Timeout | undefined;
92-
private clientId: string;
9392
private rulePollingJitterMillis: number;
9493
private samplingClient: AWSXRaySamplingClient;
9594

@@ -114,7 +113,6 @@ export class _AWSXRayRemoteSampler implements Sampler {
114113
this.awsProxyEndpoint = samplerConfig.endpoint
115114
? samplerConfig.endpoint
116115
: DEFAULT_AWS_PROXY_ENDPOINT;
117-
this.clientId = _AWSXRayRemoteSampler.generateClientId();
118116

119117
this.samplingClient = new AWSXRaySamplingClient(
120118
this.awsProxyEndpoint,
@@ -187,30 +185,4 @@ export class _AWSXRayRemoteSampler implements Sampler {
187185
);
188186
}
189187
}
190-
191-
private static generateClientId(): string {
192-
const hexChars: string[] = [
193-
'0',
194-
'1',
195-
'2',
196-
'3',
197-
'4',
198-
'5',
199-
'6',
200-
'7',
201-
'8',
202-
'9',
203-
'a',
204-
'b',
205-
'c',
206-
'd',
207-
'e',
208-
'f',
209-
];
210-
const clientIdArray: string[] = [];
211-
for (let _ = 0; _ < 24; _ += 1) {
212-
clientIdArray.push(hexChars[Math.floor(Math.random() * hexChars.length)]);
213-
}
214-
return clientIdArray.join('');
215-
}
216188
}

incubator/opentelemetry-sampler-aws-xray/test/remote-sampler.test.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ describe('AWSXRayRemoteSampler', () => {
4646
300 * 1000
4747
);
4848
expect((sampler as any)._root._root.samplingClient).not.toBeFalsy();
49-
expect((sampler as any)._root._root.clientId).toMatch(/[a-f0-9]{24}/);
5049
});
5150

5251
it('testCreateRemoteSamplerWithPopulatedResource', () => {
@@ -61,7 +60,6 @@ describe('AWSXRayRemoteSampler', () => {
6160
300 * 1000
6261
);
6362
expect((sampler as any)._root._root.samplingClient).not.toBeFalsy();
64-
expect((sampler as any)._root._root.clientId).toMatch(/[a-f0-9]{24}/);
6563
});
6664

6765
it('testCreateRemoteSamplerWithAllFieldsPopulated', () => {
@@ -83,7 +81,6 @@ describe('AWSXRayRemoteSampler', () => {
8381
expect((sampler as any)._root._root.awsProxyEndpoint).toEqual(
8482
'http://abc.com'
8583
);
86-
expect((sampler as any)._root._root.clientId).toMatch(/[a-f0-9]{24}/);
8784
});
8885

8986
it('toString()', () => {
@@ -132,10 +129,4 @@ describe('_AWSXRayRemoteSampler', () => {
132129

133130
sinon.assert.calledThrice(xrayClientSpy);
134131
});
135-
136-
it('generates valid ClientId', () => {
137-
const clientId: string = _AWSXRayRemoteSampler['generateClientId']();
138-
const match: RegExpMatchArray | null = clientId.match(/[0-9a-z]{24}/g);
139-
expect(match).not.toBeNull();
140-
});
141132
});

package-lock.json

Lines changed: 97 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)