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/logger.md
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,8 @@ Key | Example
129
129
130
130
When debugging in non-production environments, you can instruct Logger to log the incoming event with `log_event` param or via `POWERTOOLS_LOGGER_LOG_EVENT` env var.
131
131
132
-
!!! warning "Warning: This is disabled by default to prevent sensitive info being logged"
132
+
???+ warning
133
+
This is disabled by default to prevent sensitive info being logged
133
134
134
135
=== "log_handler_event.py"
135
136
@@ -147,7 +148,8 @@ When debugging in non-production environments, you can instruct Logger to log th
147
148
148
149
You can set a Correlation ID using `correlation_id_path` param by passing a [JMESPath expression](https://jmespath.org/tutorial.html){target="_blank"}.
149
150
150
-
!!! tip "Tip: You can retrieve correlation IDs via `get_correlation_id` method"
151
+
???+ tip
152
+
You can retrieve correlation IDs via `get_correlation_id` method
151
153
152
154
=== "collect.py"
153
155
@@ -595,7 +597,8 @@ You can use values ranging from `0.0` to `1` (100%) when setting `POWERTOOLS_LOG
595
597
596
598
Sampling decision happens at the Logger initialization. This means sampling may happen significantly more or less than depending on your traffic patterns, for example a steady low number of invocations and thus few cold starts.
597
599
598
-
!!! note "Note: Open a [feature request](https://github.com/awslabs/aws-lambda-powertools-python/issues/new?assignees=&labels=feature-request%2C+triage&template=feature_request.md&title=) if you want Logger to calculate sampling for every invocation"
600
+
???+ note
601
+
Open a [feature request](https://github.com/awslabs/aws-lambda-powertools-python/issues/new?assignees=&labels=feature-request%2C+triage&template=feature_request.md&title=) if you want Logger to calculate sampling for every invocation
599
602
600
603
=== "collect.py"
601
604
@@ -883,7 +886,8 @@ For **minor changes like remapping keys** after all log record processing has co
883
886
884
887
For **replacing the formatter entirely**, you can subclass `BasePowertoolsFormatter`, implement `append_keys` method, and override `format` standard logging method. This ensures the current feature set of Logger like [injecting Lambda context](#capturing-lambda-context-info) and [sampling](#sampling-debug-logs) will continue to work.
885
888
886
-
!!! info "Info: You might need to implement `remove_keys` method if you make use of the feature too."
889
+
???+ info
890
+
You might need to implement `remove_keys` method if you make use of the feature too.
887
891
888
892
=== "collect.py"
889
893
@@ -1016,7 +1020,8 @@ This is a Pytest sample that provides the minimum information necessary for Logg
1016
1020
your_lambda_handler(test_event, lambda_context)
1017
1021
```
1018
1022
1019
-
!!! tip "Tip: Check out the built-in [Pytest caplog fixture](https://docs.pytest.org/en/latest/how-to/logging.html){target="_blank"} to assert plain log messages"
1023
+
???+ tip
1024
+
Check out the built-in [Pytest caplog fixture](https://docs.pytest.org/en/latest/how-to/logging.html){target="_blank"} to assert plain log messages
You can create metrics using `add_metric`, and you can create dimensions for all your aggregate metrics using `add_dimension` method.
72
72
73
-
!!! tip
73
+
???+ tip
74
74
You can initialize Metrics in any other module too. It'll keep track of your aggregate metrics in memory to optimize costs (one blob instead of multiples).
75
75
76
76
=== "Metrics"
@@ -336,7 +336,8 @@ CloudWatch EMF uses the same dimensions across all your metrics. Use `single_met
336
336
337
337
If you prefer not to use `log_metrics` because you might want to encapsulate additional logic when doing so, you can manually flush and clear metrics as follows:
338
338
339
-
!!! warning "Warning: Metrics, dimensions and namespace validation still applies"
339
+
???+ warning
340
+
Metrics, dimensions and namespace validation still applies
340
341
341
342
=== "manual_metric_serialization.py"
342
343
@@ -358,7 +359,7 @@ If you prefer not to use `log_metrics` because you might want to encapsulate add
358
359
359
360
### Environment variables
360
361
361
-
!!! tip
362
+
???+ tip
362
363
Ignore this section, if you are explicitly setting namespace/default dimension via `namespace` and `service` parameters.
363
364
364
365
For example, `Metrics(namespace=ApplicationName, service=ServiceName)`
Copy file name to clipboardExpand all lines: docs/core/tracer.md
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,8 @@ You can trace synchronous functions using the `capture_method` decorator.
113
113
114
114
### Asynchronous and generator functions
115
115
116
-
!!! warning "Warning: We do not support asynchronous Lambda handler"
116
+
???+ warning
117
+
We do not support asynchronous Lambda handler
117
118
118
119
You can trace asynchronous functions and generator functions (including context managers) using `capture_method`.
119
120
@@ -235,7 +236,8 @@ Use **`capture_response=False`** parameter in both `capture_lambda_handler` and
235
236
236
237
Use **`capture_error=False`** parameter in both `capture_lambda_handler` and `capture_method` decorators to instruct Tracer **not** to serialize exceptions as metadata.
237
238
238
-
!!! info "Info: Useful when returning sensitive information in exceptions/stack traces you don't control"
239
+
???+ info
240
+
Useful when returning sensitive information in exceptions/stack traces you don't control
239
241
240
242
=== "sensitive_data_exception.py"
241
243
@@ -249,7 +251,8 @@ Use **`capture_error=False`** parameter in both `capture_lambda_handler` and `ca
249
251
250
252
### Tracing aiohttp requests
251
253
252
-
!!! info "Info: This snippet assumes you have aiohttp as a dependency"
254
+
???+ info
255
+
This snippet assumes you have aiohttp as a dependency
253
256
254
257
You can use `aiohttp_trace_config` function to create a valid [aiohttp trace_config object](https://docs.aiohttp.org/en/stable/tracing_reference.html). This is necessary since X-Ray utilizes aiohttp trace hooks to capture requests end-to-end.
255
258
@@ -293,7 +296,8 @@ This is useful when you need a feature available in X-Ray that is not available
293
296
294
297
### Concurrent asynchronous functions
295
298
296
-
!!! warning "Warning: [X-Ray SDK will raise an exception](https://github.com/aws/aws-xray-sdk-python/issues/164) when async functions are run and traced concurrently"
299
+
???+ warning
300
+
[X-Ray SDK will raise an exception](https://github.com/aws/aws-xray-sdk-python/issues/164) when async functions are run and traced concurrently
297
301
298
302
A safe workaround mechanism is to use `in_subsegment_async` available via Tracer escape hatch (`tracer.provider`).
Copy file name to clipboardExpand all lines: docs/index.md
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -201,7 +201,9 @@ Despite having more steps compared to the [public Layer ARN](#lambda-layer) opti
201
201
???+ warning
202
202
**Layer-extras** does not support Python 3.6 runtime. This layer also includes all extra dependencies: `22.4MB zipped`, `~155MB unzipped`.
203
203
204
-
!!! tip "Tip: You can create a shared Lambda Layers stack and make this along with other account level layers stack."
204
+
???+ tip
205
+
You can create a shared Lambda Layers stack and make this along with other account level layers stack.
206
+
205
207
206
208
If using SAM, you can include this SAR App as part of your shared Layers stack, and lock to a specific semantic version. Once deployed, it'll be available across the account this is deployed to.
207
209
@@ -434,7 +436,8 @@ You can fetch available versions via SAR API with:
434
436
435
437
## Environment variables
436
438
437
-
???+ info "Info: Explicit parameters take precedence over environment variables"
439
+
???+ info
440
+
Explicit parameters take precedence over environment variables
0 commit comments