Skip to content

Commit db2b6c2

Browse files

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

plugins/node/opentelemetry-instrumentation-aws-sdk/doc/lambda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ The following methods are automatically enhanced:
99
### Invoke
1010

1111
- Attributes are added by this instrumentation according to the [spec for Outgoing Invocations of a FaaS from a client](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/faas.md#outgoing-invocations) .
12-
- OpenTelemetry trace context is injected into the `ClientContext` parameter, allowing functions to extract this using the `Custom` property within the function.
12+
- OpenTelemetry trace context is injected into the `ClientContext` parameter, allowing functions to extract this using the `custom` property within the function.

plugins/node/opentelemetry-instrumentation-aws-sdk/src/services/lambda.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ const injectLambdaPropagationContext = (
109109

110110
const updatedClientContext = {
111111
...parsedClientContext,
112-
Custom: {
113-
...parsedClientContext.Custom,
112+
custom: {
113+
...parsedClientContext.custom,
114114
...propagatedContext,
115115
},
116116
};

plugins/node/opentelemetry-instrumentation-aws-sdk/test/lambda.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ describe('Lambda', () => {
152152
'base64'
153153
).toString()
154154
) as Record<string, any>;
155-
expect(clientContext.Custom).toHaveProperty('traceparent');
155+
expect(clientContext.custom).toHaveProperty('traceparent');
156156
});
157157

158158
it('should skip context propagation in the event it would push the ClientContext over 3583 bytes', async () => {
@@ -172,7 +172,7 @@ describe('Lambda', () => {
172172

173173
const existingClientContext = Buffer.from(
174174
JSON.stringify({
175-
Custom: {
175+
custom: {
176176
text: [...Array(2600)]
177177
.map(x => String.fromCharCode(48 + Math.random() * 74))
178178
.join(''),
@@ -225,7 +225,7 @@ describe('Lambda', () => {
225225
),
226226
ClientContext: Buffer.from(
227227
JSON.stringify({
228-
Custom: {
228+
custom: {
229229
existing: 'data',
230230
},
231231
})
@@ -242,8 +242,8 @@ describe('Lambda', () => {
242242
'base64'
243243
).toString()
244244
) as Record<string, any>;
245-
expect(clientContext.Custom).toHaveProperty('existing', 'data');
246-
expect(clientContext.Custom).toHaveProperty('traceparent');
245+
expect(clientContext.custom).toHaveProperty('existing', 'data');
246+
expect(clientContext.custom).toHaveProperty('traceparent');
247247
});
248248

249249
it('should maintain any existing top-level fields in the client context', async () => {
@@ -269,7 +269,7 @@ describe('Lambda', () => {
269269
platform: 'Symbian',
270270
platformVersion: '9.2',
271271
},
272-
Custom: {
272+
custom: {
273273
existing: 'data',
274274
},
275275
};
@@ -297,7 +297,7 @@ describe('Lambda', () => {
297297
).toString()
298298
) as Record<string, any>;
299299
expect(updatedClientContext.env).toStrictEqual(clientContext.env);
300-
expect(updatedClientContext.Custom).toHaveProperty('traceparent');
300+
expect(updatedClientContext.custom).toHaveProperty('traceparent');
301301
});
302302

303303
// It probably should be valid JSON, and I'm not sure what the lambda internals make of it if

0 commit comments

Comments
 (0)