Skip to content

Commit 4fb349c

Browse files
committed
fix copyright header, lint
1 parent 939a86e commit 4fb349c

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
13

2-
export {
3-
OTLPUdpSpanExporter
4-
} from './otlp-udp-exporter';
4+
export { OTLPUdpSpanExporter } from './otlp-udp-exporter';

exporters/aws-otel-otlp-udp-exporter/src/otlp-udp-exporter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ export class OTLPUdpSpanExporter implements SpanExporter {
6262
constructor(endpoint?: string, _signalPrefix?: string) {
6363
if (endpoint == null) {
6464
if (isLambdaEnvironment()) {
65-
this._endpoint = getXrayDaemonEndpoint() || DEFAULT_ENDPOINT
65+
this._endpoint = getXrayDaemonEndpoint() || DEFAULT_ENDPOINT;
6666
} else {
67-
this._endpoint = DEFAULT_ENDPOINT
67+
this._endpoint = DEFAULT_ENDPOINT;
6868
}
6969
} else {
70-
this._endpoint = endpoint
70+
this._endpoint = endpoint;
7171
}
7272

7373
this._udpExporter = new UdpExporter(this._endpoint);
@@ -112,4 +112,4 @@ function isLambdaEnvironment() {
112112

113113
function getXrayDaemonEndpoint() {
114114
return process.env.AWS_XRAY_DAEMON_ADDRESS;
115-
}
115+
}

exporters/aws-otel-otlp-udp-exporter/test/otlp-udp-exporter.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3+
34
import { diag, SpanContext, SpanKind } from '@opentelemetry/api';
45
import { ExportResultCode } from '@opentelemetry/core';
56
import { Resource } from '@opentelemetry/resources';
@@ -67,8 +68,9 @@ describe('UdpExporterTest', () => {
6768
});
6869

6970
it('should throw when provided invalid endpoint', () => {
71+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
7072
// @ts-ignore
71-
expect(() => new UdpExporter(123)).toThrow(new Error("Invalid endpoint: 123"));
73+
expect(() => new UdpExporter(123)).toThrow(new Error('Invalid endpoint: 123'));
7274
});
7375
});
7476

@@ -176,15 +178,15 @@ describe('OTLPUdpSpanExporterTest', () => {
176178
});
177179

178180
it('should use expected Environment Variables to configure endpoint', () => {
179-
process.env.AWS_LAMBDA_FUNCTION_NAME = "testFunctionName"
180-
process.env.AWS_XRAY_DAEMON_ADDRESS = "someaddress:1234"
181+
process.env.AWS_LAMBDA_FUNCTION_NAME = 'testFunctionName';
182+
process.env.AWS_XRAY_DAEMON_ADDRESS = 'someaddress:1234';
181183

182-
let exporter = new OTLPUdpSpanExporter(undefined);
183-
expect(exporter['_endpoint']).toBe('someaddress:1234')
184+
const exporter = new OTLPUdpSpanExporter(undefined);
185+
expect(exporter['_endpoint']).toBe('someaddress:1234');
184186
expect(exporter['_udpExporter']['_host']).toBe('someaddress');
185187
expect(exporter['_udpExporter']['_port']).toBe(1234);
186188

187-
delete process.env.AWS_XRAY_DAEMON_ADDRESS
188-
delete process.env.AWS_LAMBDA_FUNCTION_NAME
189+
delete process.env.AWS_XRAY_DAEMON_ADDRESS;
190+
delete process.env.AWS_LAMBDA_FUNCTION_NAME;
189191
});
190192
});

0 commit comments

Comments
 (0)