Skip to content

Commit 2a2492c

Browse files
committed
make type for sigv4 header patching more explicit
1 parent 208fd2f commit 2a2492c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ export class OTLPAwsSpanExporter extends OTLPProtoTraceExporter {
8181

8282
const signedRequest = await signer.sign(request);
8383

84-
(this as any)._delegate._transport._transport._parameters.headers = () => signedRequest.headers;
84+
// 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
85+
const newHeaders: () => Record<string, string> = () => signedRequest.headers;
86+
(this as any)._delegate._transport._transport._parameters.headers = newHeaders;
8587
} catch (exception) {
8688
diag.debug(
8789
`Failed to sign/authenticate the given exported Span request to OTLP XRay endpoint with error: ${exception}`

0 commit comments

Comments
 (0)