You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/tracer.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ The library has three optional settings. You can set them as environment variabl
55
55
|**Capture Errors**| Defines whether functions errors are serialized as metadata |`POWERTOOLS_TRACER_CAPTURE_ERROR`|`true`|`true` or `false`|`false`| N/A |
56
56
57
57
!!! note
58
-
Before your use this utility, your AWS Lambda function must have [Active Tracing enabled](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) as well as [have permissions](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html#services-xray-permissions) to send traces to AWS X-Ray
58
+
Before you use this utility, your AWS Lambda function must have [Active Tracing enabled](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) as well as [have permissions](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html#services-xray-permissions) to send traces to AWS X-Ray
59
59
60
60
#### Example using AWS Serverless Application Model (SAM)
|**ESM support**| Added ESM support via dual CommonJS and ESM bundling, enabling top-level `await` and tree-shaking. | - |
15
15
|**Middy.js**| Updated import path for Middy.js middlewares to leverage subpath exports - i.e. `@aws-lambda-powertools/tracer/middleware`. | Yes |
16
16
|**Types imports**| Updated import path for TypeScript types to leverage subpath exports - i.e. `@aws-lambda-powertools/logger/types`. | Yes |
17
17
|**Logger**| Changed [log sampling](./core/logger.md#sampling-logs) to dynamically switch log level to `DEBUG` on a percentage of requests. | - |
18
18
|**Logger**| Updated [custom log formatter](#custom-log-formatter) to include standard as well as persistent keys. | Yes |
19
+
|**Logger**| Removed `ContextExamples` from `@aws-lambda-powertools/commons` package. | Yes |
19
20
|**Logger and Tracer**| Removed deprecated `createLogger` and `createTracer` helper functions in favor of direct instantiation. | Yes |
20
21
21
22
@@ -280,6 +281,56 @@ In v2, you have more control over **standard** (`attributes`) and [**custom keys
280
281
2. `LogItem` is the new return object instead of a plain object.
281
282
3. If you prefer adding at the initialization, use: <br/><br/> **`LogItem({persistentAttributes: additionalLogAttributes, attributes: baseAttributes})`**
282
283
284
+
### ContextExamples for testing
285
+
286
+
In v1, we have provided a `ContextExamples` object to help you with testing.
287
+
288
+
In v2, we have removed the `ContextExamples` from the `@aws-lambda-powertools/commons` package, so you need to create it in your tests:
289
+
290
+
=== "Before"
291
+
292
+
```typescript
293
+
import { ContextExamples as dummyContext } from '@aws-lambda-powertools/commons';
0 commit comments