Skip to content

Commit 60591ec

Browse files
committed
access headers without any for sigv4
1 parent 2a2492c commit 60591ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aws-distro-opentelemetry-node-autoinstrumentation/src/otlp-aws-span-exporter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class OTLPAwsSpanExporter extends OTLPProtoTraceExporter {
5656
This is bad practice but there is no other way to access and inject SigV4 headers
5757
into the request headers before the traces get exported.
5858
*/
59-
const oldHeaders = (this as any)._delegate._transport?._transport?._parameters?.headers();
59+
const oldHeaders = this['_delegate']._transport?._transport?._parameters?.headers();
6060

6161
if (oldHeaders) {
6262
const request = new this.httpRequest({
@@ -83,7 +83,7 @@ export class OTLPAwsSpanExporter extends OTLPProtoTraceExporter {
8383

8484
// See type: https://github.com/open-telemetry/opentelemetry-js/blob/experimental/v0.57.1/experimental/packages/otlp-exporter-base/src/transport/http-transport-types.ts#L31
8585
const newHeaders: () => Record<string, string> = () => signedRequest.headers;
86-
(this as any)._delegate._transport._transport._parameters.headers = newHeaders;
86+
this['_delegate']._transport._transport._parameters.headers = newHeaders;
8787
} catch (exception) {
8888
diag.debug(
8989
`Failed to sign/authenticate the given exported Span request to OTLP XRay endpoint with error: ${exception}`

0 commit comments

Comments
 (0)